Skip to content

fix(snapshots): Reject uploads with pr_number but no base_sha#3300

Merged
NicoHinderling merged 2 commits into
masterfrom
nico/validate-base-sha-on-pr
May 13, 2026
Merged

fix(snapshots): Reject uploads with pr_number but no base_sha#3300
NicoHinderling merged 2 commits into
masterfrom
nico/validate-base-sha-on-pr

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

There is no valid scenario where a snapshot uploaded as part of a PR should lack a base SHA — without it, the server cannot identify which base build to compare against. Previously this was silently accepted, leading to orphaned "solo" snapshots that could never produce diffs.

This adds client-side validation that bails early with an actionable error message before any images are uploaded or API calls are made. The error points users to either pass --base-sha explicitly or ensure their CI environment exposes the merge base.

Companion to getsentry/sentry#115446, getsentry/sentry#115448, and getsentry/sentry#115460 which handle the server/UI side of base-build edge cases.

There is no valid scenario where a snapshot uploaded as part of a PR
should lack a base SHA — without it, the server cannot identify which
base build to compare against. Previously this was silently accepted,
leading to orphaned "solo" snapshots that could never produce diffs.

Bail early with an actionable error message before any images are
uploaded or API calls are made.
@NicoHinderling NicoHinderling marked this pull request as ready for review May 13, 2026 00:57
@NicoHinderling NicoHinderling requested review from a team as code owners May 13, 2026 00:57
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 551f43d. Configure here.

Comment thread src/commands/build/snapshots.rs
@NicoHinderling NicoHinderling merged commit 2624b8d into master May 13, 2026
43 of 45 checks passed
@NicoHinderling NicoHinderling deleted the nico/validate-base-sha-on-pr branch May 13, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants