Skip to content

Commit a111e2c

Browse files
ref(snapshots): Track diff algorithm version on comparison results
1 parent a3f9c2c commit a111e2c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/sentry/preprod/snapshots/image_diff/compare.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# This is NOT a minimum % changed value, but
2121
# rather adjusts the sensitivity of pixel change detection.
2222
ODIFF_SENSITIVITY_DIFF_THRESHOLD = 0.01
23+
DIFF_ALGORITHM_VERSION = 1
2324

2425

2526
def _as_image(source: bytes | Image.Image) -> Image.Image:

src/sentry/preprod/snapshots/tasks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from sentry.objectstore import get_preprod_session
1616
from sentry.preprod.models import PreprodArtifact, PreprodComparisonApproval
17-
from sentry.preprod.snapshots.image_diff.compare import compare_images_batch
17+
from sentry.preprod.snapshots.image_diff.compare import DIFF_ALGORITHM_VERSION, compare_images_batch
1818
from sentry.preprod.snapshots.image_diff.odiff import OdiffServer
1919
from sentry.preprod.snapshots.manifest import (
2020
ComparisonManifest,
@@ -668,6 +668,7 @@ def _fetch_hash(h: str) -> None:
668668
extras = comparison.extras or {}
669669
# EME-896: Could become a proper column on PreprodSnapshotComparison
670670
extras["comparison_key"] = comparison_key
671+
extras["diff_algorithm_version"] = DIFF_ALGORITHM_VERSION
671672
comparison.extras = extras
672673
comparison.save(
673674
update_fields=[

0 commit comments

Comments
 (0)