Once Milestone 1 - 3 are complete for this project (meta bug: Bug 2049499), Crash Pings will exist in Socorro's storage alongside Crash Reports. Without an explicit filter, SuperSearch queries and views that use them (/topcrashers, /signature, /search, etc.) would return both submission types. This ticket adds a mechanism to apply a default `submission_type` filter to SuperSearch queries. This filter is applied at the model layer in `SuperSearch.get()` and `SuperSearchUnredacted.get()` (in `webapp/crashstats/supersearch/models.py`). The default is configurable via a feature flag, so that the eventual cutover (Milestone 6) can be executed without code changes. Initially, and for this ticket, the `SuperSearch` API default will be `"report"`. The cutover later on will change this default to `"ping"`. Callers can override the default by explicitly including the `submission_type` filter in their query. This will allow us to test Crash Ping support prior to the cutover. Importantly, this only affects the default for the `SuperSearch` API. The `SuperSearchUnredacted` API will always default to `"report"`, since Crash Pings do not contain the protected fields this endpoint exists to surface. Notably, reports processed prior to Bug 2053871 will not have a `submission_type` field. While we could backfill this data or reprocess these reports to add `submission_type="report"`, it would be operationally easier to create a compound Elasticsearch query, such that documents are matched where `submission_type="report"` OR the field is absent. Acceptance criteria: - Feature flag (e.g. `SUPERSEARCH_DEFAULT_SUBMISSION_TYPE`) added with default value `"report"`. - `SuperSearch.get()` applies the setting as the default `submission_type` filter when the parameter is absent from the incoming request; explicit values in the request override the default. - `SuperSearchUnredacted.get()` always applies `submission_type=report` regardless of the setting. - This filter propagates correctly to all views that use SuperSearch: /topcrashers, /signature Summary/Aggregations/Reports/Graphs, /search, /search/results, and any others. - `submission_type=report` (whether default or explicit) matches new crashes with `submission_type=report` in the processed crash AND legacy crashes where the field is absent from the indexed document (crashes processed before Bug 2053871). - `submission_type=ping` (explicit) matches only crashes with `submission_type=ping` in the processed crash. - Unit tests cover: default filter behavior for SuperSearch and SuperSearchUnredacted, explicit override behavior, legacy document handling (missing field), and filter propagation to the affected views.
Bug 2053888 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Once Milestone 1 - 3 are complete for this project (meta bug: Bug 2049499), Crash Pings will exist in Socorro's storage alongside Crash Reports. Without an explicit filter, SuperSearch queries and views that use them (/topcrashers, /signature, /search, etc.) would return both submission types. This ticket adds a mechanism to apply a default `submission_type` filter to SuperSearch queries. This filter is applied at the model layer in `SuperSearch.get()` and `SuperSearchUnredacted.get()` (in `webapp/crashstats/supersearch/models.py`). The default is configurable via a feature flag, so that the eventual cutover (Milestone 6) can be executed without code changes. Initially, and for this ticket, the `SuperSearch` API default will be `"report"`. The cutover later on will change this default to `"ping"`. Callers can override the default by explicitly including the `submission_type` filter in their query. This will allow us to test Crash Ping support prior to the cutover. Importantly, this only affects the default for the `SuperSearch` API. The `SuperSearchUnredacted` API will always default to `"report"`, since Crash Pings do not contain the protected fields this endpoint exists to surface. Notably, reports processed prior to Bug 2053871 will not have a `submission_type` field. While we could backfill this data or reprocess these reports to add `submission_type="report"`, it would be operationally easier to create a compound Elasticsearch query, such that documents are matched where `submission_type="report"` OR the field is absent. Acceptance criteria: - Feature flag (e.g. `SUPERSEARCH_DEFAULT_SUBMISSION_TYPE`) added with default value `"report"`. - `SuperSearch.get()` applies the setting as the default `submission_type` filter when the parameter is absent from the incoming request; explicit values in the request override the default. - `SuperSearchUnredacted.get()` always applies `submission_type=report` regardless of the setting. - This filter propagates correctly to all views that use SuperSearch: /topcrashers, /signature Summary/Aggregations/Reports/Graphs, /search, /search/results, and any others. - `submission_type=report` (whether default or explicit) matches new crashes with `submission_type=report` in the processed crash AND legacy crashes where the field is absent from the indexed document (crashes processed before Bug 2053871). - `submission_type=ping` (explicit) matches only crashes with `submission_type=ping` in the processed crash. - `submission_type=report&submission_type=ping` (multi-value, explicit) matches new crashes with `submission_type=report` or `submission_type=ping`, and legacy documents where the field is absent. - Unit tests cover: default filter behavior for SuperSearch and SuperSearchUnredacted, explicit override behavior, legacy document handling (missing field), and filter propagation to the affected views.