Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/compare/differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def has_changes(self) -> bool:
or self.increased_clusters
or self.decreased_clusters
or self.new_triggers
or self.dropped_triggers
)


Expand Down
12 changes: 10 additions & 2 deletions tests/unit/test_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,21 @@ def test_true_when_new_triggers_only(self):
)
assert r.has_changes is True

def test_true_when_dropped_triggers_only(self):
"""Dropped triggers alone must count as changes so text renderers show them."""
r = CompareResult(
window_a_start=_dt(0), window_a_end=_dt(30),
window_b_start=_dt(-1440), window_b_end=_dt(-1410),
dropped_triggers=[TriggerDiff("Deploy completed for billing v2.4.1", "svc", "b")],
)
assert r.has_changes is True

def test_false_when_only_stable_clusters(self):
"""Stable + dropped_triggers alone should not set has_changes."""
"""Stable clusters alone should not set has_changes."""
r = CompareResult(
window_a_start=_dt(0), window_a_end=_dt(30),
window_b_start=_dt(-1440), window_b_end=_dt(-1410),
stable_clusters=[ClusterDiff("fp", "msg", [], 10, 10)],
dropped_triggers=[TriggerDiff("old deploy", "svc", "b")],
)
assert r.has_changes is False

Expand Down