From 2adaa8eedb927848f5ffb1bd089439fa97ee656b Mon Sep 17 00:00:00 2001 From: Nico Hinderling Date: Tue, 14 Apr 2026 14:09:05 -0700 Subject: [PATCH] fix(preprod): Hide approve button on status check when snapshots already approved Previously the GitHub check run always showed the Approve button when any snapshot changes existed, even if all changes were already approved. Now the button is only included when there are unapproved changes. Co-Authored-By: Claude --- src/sentry/preprod/vcs/status_checks/snapshots/tasks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sentry/preprod/vcs/status_checks/snapshots/tasks.py b/src/sentry/preprod/vcs/status_checks/snapshots/tasks.py index 671e2adc763ba8..56d3ec1792708a 100644 --- a/src/sentry/preprod/vcs/status_checks/snapshots/tasks.py +++ b/src/sentry/preprod/vcs/status_checks/snapshots/tasks.py @@ -242,7 +242,11 @@ def create_preprod_snapshot_status_check_task( changes_map, approvals_map=approvals_map, ) - if any(changes_map.values()): + has_unapproved_changes = any( + has_changes and artifact_id not in approvals_map + for artifact_id, has_changes in changes_map.items() + ) + if has_unapproved_changes: approve_action_identifier = APPROVE_SNAPSHOT_ACTION_IDENTIFIER completed_at: datetime | None = None