Skip to content

feat(preprod): Add snapshot_status search field with comparison state filters#115580

Merged
mtopo27 merged 2 commits into
masterfrom
maxtopolsky/eme-1147-surface-all-comparison-states-in-approval_status-search
May 14, 2026
Merged

feat(preprod): Add snapshot_status search field with comparison state filters#115580
mtopo27 merged 2 commits into
masterfrom
maxtopolsky/eme-1147-surface-all-comparison-states-in-approval_status-search

Conversation

@mtopo27
Copy link
Copy Markdown
Contributor

@mtopo27 mtopo27 commented May 14, 2026

Replaces the approval_status search field with snapshot_status, adding support for filtering by all snapshot comparison states visible in the Status column: base, no_base, pending, processing, failed, plus the existing approval values (approved, auto_approved, requires_approval).

New comparison state filters

base matches main-branch builds (no base_sha on the commit comparison). no_base matches PR builds where the base artifact hasn't been found (combines the waiting_for_base and no_base_build UI states into one searchable value). pending, processing, and failed filter by PreprodSnapshotComparison.State directly.

Breaking change: approval_status is removed. Use snapshot_status instead — the three approval values are unchanged.

Refs EME-1147

… filters

Add a `snapshot_status` search field (replacing `approval_status`) with
support for filtering by all snapshot comparison states: base, no_base,
pending, processing, and failed, in addition to the existing approval
values. This unifies all Status column badge values under a single
searchable field.

Refs EME-1147
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 14, 2026
@mtopo27 mtopo27 marked this pull request as ready for review May 14, 2026 18:09
@mtopo27 mtopo27 requested a review from a team as a code owner May 14, 2026 18:09
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 14, 2026

EME-1147

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines 65 to 71
allowed_keys={
"app_id",
"app_name",
"approval_status",
"snapshot_status",
"build_configuration_name",
"build_number",
"build_version",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The frontend allows searching by approval_status, but the backend no longer supports this key, causing search queries to fail.
Severity: MEDIUM

Suggested Fix

Remove 'approval_status' from the SNAPSHOT_ALLOWED_KEYS constant in static/app/components/preprod/constants.ts to align the frontend's autocomplete suggestions with the backend's supported search keys.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/preprod/artifact_search.py#L65-L71

Potential issue: The backend change removes `approval_status` from the list of allowed
search keys in `artifact_search.py`. However, the frontend constant
`SNAPSHOT_ALLOWED_KEYS` in `static/app/components/preprod/constants.ts` was not updated
and still includes `'approval_status'`. This causes the UI to offer `approval_status` as
a search autocomplete option. When a user selects this option, the resulting search
query will be rejected by the backend with an `InvalidSearchQuery` error.

Also affects:

  • static/app/components/preprod/constants.ts:45

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handling in #115588

@mtopo27 mtopo27 merged commit 3001ff5 into master May 14, 2026
62 checks passed
@mtopo27 mtopo27 deleted the maxtopolsky/eme-1147-surface-all-comparison-states-in-approval_status-search branch May 14, 2026 18:52
mtopo27 added a commit that referenced this pull request May 14, 2026
)

Add `snapshot_status` to the frontend search bar for snapshots,
completing the frontend half of the `approval_status` →
`snapshot_status` search rename.

**New search field with all comparison states**

`snapshot_status` is now searchable in the snapshot view with values:
`approved`, `auto_approved`, `base`, `failed`, `no_base`, `pending`,
`processing`, `requires_approval`. This matches the backend values added
in #115580.

**Hidden in general Explore UI**

The field is added to `HIDDEN_PREPROD_ATTRIBUTES` so it only appears in
the snapshot-specific search bar (via `SNAPSHOT_ALLOWED_KEYS`), not in
the general Explore interface.

Refs EME-1147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants