Skip to content

ref(snapshots): Add per-image diffThreshold support#114335

Merged
NicoHinderling merged 1 commit intomasterfrom
04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration
Apr 30, 2026
Merged

ref(snapshots): Add per-image diffThreshold support#114335
NicoHinderling merged 1 commit intomasterfrom
04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

@NicoHinderling NicoHinderling commented Apr 29, 2026

Summary

Adds support for per-image diff_threshold values in snapshot comparisons. Previously, only a single global diff_threshold applied to all images. Now, individual images in the manifest can specify their own threshold, with per-image taking precedence over global.

Changes:

  • Added optional diff_threshold field to ImageMetadata (validated to [0.0, 1.0))
  • Updated compare_snapshots task to resolve threshold with per-image > global > 0.0 fallback
  • Resolved effective diff_threshold onto each SnapshotImageResponse in the API (per-image or global fallback), so it's visible in the frontend metadata tooltip
  • Enhanced debug logging to show per-image and global threshold values

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 29, 2026
@NicoHinderling NicoHinderling marked this pull request as ready for review April 29, 2026 18:16
@NicoHinderling NicoHinderling requested a review from a team as a code owner April 29, 2026 18:16
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from a34d2c6 to a7961b9 Compare April 29, 2026 19:05
@NicoHinderling NicoHinderling changed the title ref(snapshots): Add backend support for individual image diffThreshold value consideration ref(snapshots): Add per-image diffThreshold support Apr 29, 2026
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_snapshot.py
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from a7961b9 to fee151e Compare April 29, 2026 20:19
@NicoHinderling NicoHinderling force-pushed the 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation branch from f219e4a to 36d7e60 Compare April 29, 2026 20:19
Copy link
Copy Markdown
Contributor

@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 fee151e. Configure here.

Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_snapshot.py
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from fee151e to dcfb54f Compare April 29, 2026 22:29
@NicoHinderling NicoHinderling force-pushed the 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation branch 2 times, most recently from a643679 to 6cec430 Compare April 29, 2026 22:43
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from dcfb54f to 30a0c00 Compare April 29, 2026 22:43
@NicoHinderling NicoHinderling force-pushed the 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation branch from 6cec430 to c94402b Compare April 29, 2026 22:50
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from 30a0c00 to c41fa47 Compare April 29, 2026 22:50
@NicoHinderling NicoHinderling force-pushed the 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation branch from c94402b to 3aced66 Compare April 29, 2026 23:05
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from c41fa47 to 1c527f9 Compare April 29, 2026 23:05
@NicoHinderling NicoHinderling force-pushed the 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation branch from 3aced66 to e920ab8 Compare April 29, 2026 23:34
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from 1c527f9 to 8341e0e Compare April 29, 2026 23:34
@NicoHinderling NicoHinderling force-pushed the 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation branch from e920ab8 to a5fae76 Compare April 30, 2026 00:05
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch 2 times, most recently from 1b406a8 to a09a848 Compare April 30, 2026 00:32
@NicoHinderling NicoHinderling force-pushed the 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation branch from a5fae76 to 4488ab1 Compare April 30, 2026 00:32
Base automatically changed from 04-28-perf_snapshots_buffer_image_swap_to_eliminate_flash_during_single-view_navigation to master April 30, 2026 00:41
@NicoHinderling NicoHinderling force-pushed the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch from a09a848 to 1e6255c Compare April 30, 2026 00:45
@NicoHinderling NicoHinderling merged commit b83fa81 into master Apr 30, 2026
60 checks passed
@NicoHinderling NicoHinderling deleted the 04-29-ref_snapshots_add_backend_support_for_individual_image_diffthreshold_value_consideration branch April 30, 2026 00:58
cleptric pushed a commit that referenced this pull request May 5, 2026
## Summary

Adds support for per-image `diff_threshold` values in snapshot
comparisons. Previously, only a single global `diff_threshold` applied
to all images. Now, individual images in the manifest can specify their
own threshold, with per-image taking precedence over global.

**Changes:**
- Added optional `diff_threshold` field to `ImageMetadata` (validated to
`[0.0, 1.0)`)
- Updated `compare_snapshots` task to resolve threshold with per-image >
global > 0.0 fallback
- Resolved effective `diff_threshold` onto each `SnapshotImageResponse`
in the API (per-image or global fallback), so it's visible in the
frontend metadata tooltip
- Enhanced debug logging to show per-image and global threshold values
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants