feat(preprod): Add snapshot image comparison task and endpoint logic#109151
feat(preprod): Add snapshot image comparison task and endpoint logic#109151NicoHinderling merged 3 commits intomasterfrom
Conversation
|
🚨 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 |
f04c5f3 to
2b4c3f4
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
2b4c3f4 to
e1d9787
Compare
eb716d6 to
6ced8f1
Compare
6ced8f1 to
66b9902
Compare
e1d9787 to
317a73a
Compare
2eb8356 to
9f93bed
Compare
43cc0fc to
03eceb6
Compare
1793aa1 to
2ea9010
Compare
b3074bd to
09db923
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
f8c1910 to
bda6dd4
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
bda6dd4 to
5239bdf
Compare
5239bdf to
b885f41
Compare
b885f41 to
c639ae7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
c639ae7 to
3766ee7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
3766ee7 to
0af68f4
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| ) | ||
| diff_mask_bytes = base64.b64decode(diff_result.diff_mask_png) | ||
| logger.info( | ||
| "compare_snapshots: uploading mask for %s (%d bytes, diff=%.4f, changed_px=%d)", |
There was a problem hiding this comment.
Errored items missing available dimension data in manifest
Medium Severity
For exceeds_pixel_limit errored items, the task has head_meta and base_meta with width/height readily available (lines 241-242) but doesn't store them in image_results. The "removed" items were fixed to include before_width/before_height per PR discussion, but errored items were missed. In the categorizer fallback path (when head_img or base_img is None), img.before_width, img.after_width, etc. are all None, causing dimensions to silently fall back to 0. This produces incorrect dimension metadata for errored diff pairs in the API response.
Additional Locations (1)
There was a problem hiding this comment.
we don't need the right dimensions for error cases since they couldn't be processed and therefore can't be displayed



Adds the ability to automatically compare snapshot images between two preprod builds using pixel-level diffing.
When a snapshot is uploaded with VCS info (base_sha, base_repo_name, base_ref), the endpoint now looks for a matching base artifact and triggers a
compare_snapshotsCelery task. This task:image_diffmodule)PreprodSnapshotComparisonmodelThe GET endpoint is updated to return categorized image lists (changed, added, removed, unchanged) along with diff metadata when comparison data is available.
New modules:
sentry.preprod.snapshots.image_diff— wraps the odiff binary in server mode for efficient batch image comparisonsentry.preprod.snapshots.tasks— Celery task for async snapshot comparisonsnapshot-diffinternal endpoint registered in URL patternsAlso adds
odiff-binas a dependency for the image diffing binary.