Skip to content

feat(preprod): Add image comparison library with odiff batch support#109381

Merged
NicoHinderling merged 14 commits intomasterfrom
create-compare-task-v1-part2
Feb 26, 2026
Merged

feat(preprod): Add image comparison library with odiff batch support#109381
NicoHinderling merged 14 commits intomasterfrom
create-compare-task-v1-part2

Conversation

@NicoHinderling
Copy link
Contributor

Summary

  • Add compare_images and compare_images_batch functions using dual-threshold detection (base + color-sensitive)
  • Produces base64-encoded diff mask PNGs with pixel-level change data
  • Unit tests covering identical, different, different-size, threshold sensitivity, bytes input, and batch modes

Stack: 2/3 — depends on #109380, next: Celery task

@NicoHinderling NicoHinderling requested a review from a team as a code owner February 25, 2026 21:54
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 25, 2026
Copy link
Contributor Author

NicoHinderling commented Feb 25, 2026

@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part2 branch from 925d6b9 to bbf23d9 Compare February 25, 2026 23:12
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part1 branch from 10e12d3 to 5b2dabe Compare February 25, 2026 23:12
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part1 branch from 5b2dabe to 01b72d2 Compare February 25, 2026 23:22
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part2 branch from bbf23d9 to 8c12f49 Compare February 25, 2026 23:22
@NicoHinderling NicoHinderling mentioned this pull request Feb 25, 2026
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part2 branch from 8c12f49 to bbba6eb Compare February 25, 2026 23:34
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part2 branch from bbba6eb to 99c5a0b Compare February 25, 2026 23:40
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part1 branch from ca48cee to 12f0802 Compare February 25, 2026 23:52
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part2 branch from 99c5a0b to 6e0d8b2 Compare February 25, 2026 23:52
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part2 branch from 6e0d8b2 to b13b82d Compare February 26, 2026 00:16
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part1 branch from 12f0802 to 740cd3e Compare February 26, 2026 00:16
NicoHinderling and others added 14 commits February 26, 2026 14:48
Add compare_images and compare_images_batch functions that use the
OdiffServer to produce diff masks with dual-threshold detection.
Includes unit tests.
Move _to_pil_image calls inside try block so the finally cleanup
handles the case where the second image conversion fails after the
first succeeds.

Co-Authored-By: Claude <noreply@anthropic.com>
@NicoHinderling NicoHinderling force-pushed the create-compare-task-v1-part2 branch from 09b9a1a to 5d1761a Compare February 26, 2026 22:51
@NicoHinderling NicoHinderling enabled auto-merge (squash) February 26, 2026 23:10
@NicoHinderling NicoHinderling merged commit 65d7311 into master Feb 26, 2026
56 checks passed
@NicoHinderling NicoHinderling deleted the create-compare-task-v1-part2 branch February 26, 2026 23:12
NicoHinderling added a commit that referenced this pull request Feb 27, 2026
## Summary
- Add `compare_snapshots` instrumented task that loads manifests from
objectstore, diffs matched images in pixel-budget batches, uploads diff
masks, and writes comparison results
- State machine guards with atomic transitions (PENDING → PROCESSING →
SUCCESS/FAILED)
- Handles added/removed/unchanged/changed/skipped/errored image
categories
- Register task import in `server.py`

**Stack**: 3/3 — depends on #109381
rbro112 added a commit that referenced this pull request Mar 5, 2026
Last week #109381 was merged
which added the odiff binary to the backend CI workflow as it was a new
required dependency for CI tests.

Unfortunately, we missed adding this to the `backend-with-coverage` job
which is used to upload selective testing coverage metrics. This caused
all runs of backend with coverage to fail, resulting in no coverage data
being uploaded.

This fixes the `backend-with-coverage` workflow to install the odiff
binary which should fix tests.

Manual run to confirm this fixes:
https://github.com/getsentry/sentry/actions/runs/22696037548
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