Commit a3f9c2c
ref(snapshots): Add configurable diff_threshold for snapshot comparison (#112728)
## Summary
- Add `diff_threshold` (0.0–1.0) parameter to the snapshot upload API,
allowing callers to control what percentage of changed pixels marks an
image as "changed"
- Plumb the threshold from the API endpoint through the manifest to the
comparison task
- Add a hash-mismatch safety check: if odiff reports 0 diff but content
hashes differ, force the image as changed
- Clean up dead CLI retry logic in compare.py
## Test plan
- Existing image diff tests updated and passing
- New dimension-mismatch tests cover padding behavior
- Schema validates `diff_threshold` type and range at the API boundary
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent f6e153a commit a3f9c2c
File tree
3 files changed
+24
-2
lines changed- src/sentry/preprod
- api/endpoints
- snapshots
3 files changed
+24
-2
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
| 470 | + | |
469 | 471 | | |
470 | 472 | | |
471 | 473 | | |
| |||
524 | 526 | | |
525 | 527 | | |
526 | 528 | | |
527 | | - | |
| 529 | + | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
| |||
571 | 573 | | |
572 | 574 | | |
573 | 575 | | |
574 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
575 | 583 | | |
576 | 584 | | |
577 | 585 | | |
578 | 586 | | |
579 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
580 | 599 | | |
581 | 600 | | |
582 | 601 | | |
| |||
0 commit comments