feat(preprod): Add auto_approved status to snapshot UI#115388
Conversation
📊 Type Coverage Diff
🔍 4 new type safety issues introduced
This is informational only and does not block the PR. |
| @@ -203,7 +206,7 @@ export function PreprodBuildsSnapshotTable({ | |||
| )} | |||
| <SimpleTable.HeaderCell>{t('Changes')}</SimpleTable.HeaderCell> | |||
| <SimpleTable.HeaderCell>{t('Branch')}</SimpleTable.HeaderCell> | |||
| <SimpleTable.HeaderCell>{t('Approval')}</SimpleTable.HeaderCell> | |||
| <SimpleTable.HeaderCell>{t('Status')}</SimpleTable.HeaderCell> | |||
There was a problem hiding this comment.
i could see an argument for making this "Approval Status" but not a big deal
Replace is_approved boolean filter with approval_status string filter supporting approved, auto_approved, and requires_approval values. Rename the Approval column header to Status and add an Auto Approved badge variant.
b3bc172 to
0fcfcee
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0fcfcee. Configure here.
| 'tags[artifact_type,number]', | ||
| ...PREPROD_IMAGE_FIELDS, | ||
| 'is_approved', | ||
| 'approval_status', |
There was a problem hiding this comment.
Bug: Adding approval_status to both SENTRY_PREPROD_STRING_TAGS and HIDDEN_PREPROD_ATTRIBUTES causes it to be filtered out from the search bar, making it invisible.
Severity: MEDIUM
Suggested Fix
Remove approval_status from the HIDDEN_PREPROD_ATTRIBUTES array. This will prevent it from being filtered out from the search bar keys while still allowing it to be available as a search tag via SENTRY_PREPROD_STRING_TAGS.
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: static/app/views/explore/constants.tsx#L148
Potential issue: The new tag `approval_status` is added to both
`SENTRY_PREPROD_STRING_TAGS` and `HIDDEN_PREPROD_ATTRIBUTES`. The `PreprodSearchBar`
component uses `HIDDEN_PREPROD_ATTRIBUTES` to determine which keys to hide from the
search UI. The logic first merges the default tags from `SENTRY_PREPROD_STRING_TAGS`
(including `approval_status`) into the available attributes, and then immediately
removes any keys found in `HIDDEN_PREPROD_ATTRIBUTES`. Because `approval_status` is
present in both constants, it is added and then removed, preventing it from appearing as
a searchable filter in the UI and defeating the purpose of the change.
Did we get this right? 👍 / 👎 to inform future reviews.

Adds frontend support for the
auto_approvedsnapshot approval status introduced in #115291.Search filter: Replaces the
is_approvedboolean search key withapproval_status, a string filter with predefined dropdown values (approved,auto_approved,requires_approval). This uses thevaluesfield definition pattern (same asartifact_type) so the search bar shows a fixed dropdown instead of hitting the trace-items values endpoint, which doesn't support derived Django-model attributes.Column & badge: Renames the "Approval" column header to "Status" and adds an "Auto Approved" tag badge for auto-approved snapshots.
Stacked on #115291 — land that first.
REFS EME-1102