Add skipContentIdenticalDuplicates flag (default on) for compact baselines - #40
Conversation
…lines After #31 shipped the duplicate-safe classification, the baseline length did not shrink — the same 241-of-244 entries from the media3 / exoplayer-ui reproducer just switched tags. The primary goal of the baseline is quick review, so keeping those lines in the file defeats the purpose. Add a per-configuration flag that drops DUPLICATE_SAFE entries before serialization. Default is true so new users see a compact, review-ready baseline out of the box — consistent with excludeAndroidXValues = true. Set skipContentIdenticalDuplicates = false to keep the historical record of byte-identical duplicates. The filter runs in HighlanderCheckTask.processBaseline, before override promotion. Scanners keep their current behavior (classification is still computed; hash cost is bounded by duplicate count, not enabled state) so toggling the flag doesn't change scan semantics, only output. Drift detection is preserved either way: a previously-identical duplicate that diverges later still appears as a new # conflict on the next guard run. Adjusts existing gradleTest cases that relied on the old default (byte- identical content in baseline) to use divergent content, and opts out explicitly in the classification-flip test where the override -> duplicate-safe transition needs duplicate-safe to remain serialized. Adds two new gradleTest cases pinning the default-on and opt-out paths. Existing 0.0.4 users will need to re-baseline once on upgrade — duplicate-safe entries that were persisted in their baseline file will disappear on the next scan. Closes #39
There was a problem hiding this comment.
Code Review
This pull request introduces the skipContentIdenticalDuplicates configuration property, which defaults to true to omit byte-identical duplicates from baseline files, ensuring they remain compact and focused on actionable conflicts. The implementation includes updates to the Gradle task logic, documentation, and test suite. Review feedback recommends refining the test configurations by removing redundant default property values to enhance readability and maintainability.
| resources = true | ||
| nativeLibs = false | ||
| assets = false | ||
| skipContentIdenticalDuplicates = false |
There was a problem hiding this comment.
The test configuration includes properties set to their default values (resources = true, nativeLibs = false). To improve readability and focus on the specific configuration for this test, it's better to only specify non-default values. This makes the test's intent clearer and reduces maintenance if defaults change.
| resources = true | |
| nativeLibs = false | |
| assets = false | |
| skipContentIdenticalDuplicates = false | |
| assets = false | |
| skipContentIdenticalDuplicates = false | |
| resources = true | ||
| nativeLibs = false | ||
| assets = false | ||
| skipContentIdenticalDuplicates = false |
There was a problem hiding this comment.
This configuration includes properties set to their default values (resources = true, nativeLibs = false). For better readability and maintainability, please only specify properties that deviate from the default. This highlights the specific setup required for the test.
| resources = true | |
| nativeLibs = false | |
| assets = false | |
| skipContentIdenticalDuplicates = false | |
| assets = false | |
| skipContentIdenticalDuplicates = false | |
Summary
Adds an opt-out flag for retaining
# duplicate-safeentries in the baseline. Default istrue— byte-identical duplicates are dropped from the file so only reviewable entries (# override,# conflict) remain.Motivation from #39: PR #31 made the
# conflictlabel trustworthy, but the baseline file length did not shrink — in the media3 + exoplayer-ui reproducer 241 of 244 entries simply switched tag. Keeping those lines defeats the point of the baseline. Matches the "compact by default" pattern already established byexcludeAndroidXValues = trueand the values id-slot skip.Behavior
HighlanderCheckTask.processBaselinefilterscurrententries whereclassification == DUPLICATE_SAFEbefore override promotion and serialization.# conflicton the next guard run.API
New public property on
HighlanderConfiguration:highlander/api/highlander.apiregenerated.Closes #39
Migration
Existing 0.0.4 baselines that persist
# duplicate-safeentries will diff against scanner output on the first guard run after upgrade — those entries disappear fromcurrentso the guard reports them as removed. Re-baseline once:Users who want to keep historical
# duplicate-saferecords in the file can setskipContentIdenticalDuplicates = false.Test plan
:highlander:test:highlander:gradleTest(default-on filter, explicit false retention; prior tests updated to use divergent content where they relied on the old default):highlander:apiCheck:sample:app:highlanderBaselineRelease --configuration-cache— sample baseline unchanged (# override drawable/ic_closekept since sample sources have divergent content)