Skip to content

feat(preprod): Show processing state for snapshot comparisons#111355

Merged
NicoHinderling merged 3 commits intomasterfrom
nh/preprod-snapshot-comparison-pending-state
Mar 23, 2026
Merged

feat(preprod): Show processing state for snapshot comparisons#111355
NicoHinderling merged 3 commits intomasterfrom
nh/preprod-snapshot-comparison-pending-state

Conversation

@NicoHinderling
Copy link
Contributor

@NicoHinderling NicoHinderling commented Mar 23, 2026

image

Creates a PreprodSnapshotComparison record with PENDING state at upload time, before the async comparison task is dispatched. This lets the frontend immediately detect that a comparison is in progress.

On the frontend, a BuildProcessing indicator is shown while the comparison is pending or processing. The page auto-polls every 5 seconds and transitions to the full diff view once the comparison completes. Previously, the page showed an empty or stale diff view until the background task finished, with no indication that work was happening.

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Mar 23, 2026
@github-actions
Copy link
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Create PreprodSnapshotComparison record with PENDING state at upload
time, before the async comparison task runs. This lets the frontend
immediately detect an in-progress comparison.

On the frontend, show a BuildProcessing indicator while the comparison
is pending or processing, and auto-poll every 5 seconds until complete.
Previously the page showed an empty or stale diff view until the task
finished.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@NicoHinderling NicoHinderling force-pushed the nh/preprod-snapshot-comparison-pending-state branch from 38bbe92 to cb9b01a Compare March 23, 2026 21:16
@NicoHinderling NicoHinderling marked this pull request as ready for review March 23, 2026 21:16
@NicoHinderling NicoHinderling requested a review from a team as a code owner March 23, 2026 21:16
Wrap get_or_create() for PreprodSnapshotComparison in try/except
IntegrityError to handle concurrent uploads for the same artifact pair.
The async task already handles this race; the endpoint just needs to
ensure a PENDING record exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
data-is-held={isHeld}
onMouseDown={onMouseDown}
onDoubleClick={onDoubleClick}
) : (
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I generally dislike the ? () : () notation in react components, it makes it hard to find the blocks of the conditional. I prefer extracting the variable above then using that to gate the functionality. So this could be:

const isProcessing = [ComparisonState.PENDING, ComparisonState.PROCESSING].includes(comparisonRunInfo.state);

return (
  ...
  {isProcessing && ( // processing state )}
  {!isProcessing && ( // default state )}
)

@NicoHinderling NicoHinderling enabled auto-merge (squash) March 23, 2026 22:10
@NicoHinderling NicoHinderling merged commit a897453 into master Mar 23, 2026
66 of 67 checks passed
@NicoHinderling NicoHinderling deleted the nh/preprod-snapshot-comparison-pending-state branch March 23, 2026 22:19
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 Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants