fix(comparator): fix change detection for schema evolution and cold starts - #2228
Merged
Conversation
jcscottiii
requested review from
DanielRyanSmith,
jrobbins,
neilv-g and
szy196
February 5, 2026 15:32
jcscottiii
force-pushed
the
jcscottiii/fix-comparator
branch
from
February 5, 2026 16:05
39ad4b8 to
a41d332
Compare
jrobbins
approved these changes
Feb 5, 2026
jcscottiii
enabled auto-merge
February 5, 2026 21:32
jcscottiii
disabled auto-merge
February 5, 2026 21:46
jcscottiii
enabled auto-merge
February 5, 2026 21:46
…tarts This change fixes a bug where new browser implementation data was not triggering notifications if the feature previously had no browser data (the "Cold Start" problem). It also standardizes how optional fields are compared to support clean schema evolution. Key Changes: - **Comparator Logic (`lib/blobtypes/v1/comparator.go`):** - Refactored `compareBrowserImpls` to remove an early return when the old state is unset. It now correctly detects when browser data is added for the first time. - Standardized all `compareXYZ` methods to explicitly handle the four states of `OptionallySet` fields: Unset/Unset (No Change), Unset/Set (Added), Set/Unset (Removed), and Set/Set (Value comparison). - Implemented "Quiet Rollout" logic for browsers: additions are ignored if the status is "Unavailable" and no other details (version/date) are present, reducing noise during backfills. - Refactored Name comparison to be robust against Unset states. - **Documentation:** - Added a "Guide for Adding New Fields" to `comparator.go` to ensure future maintainers follow the same robust comparison patterns. - Documented the "Quiet Rollout" and "Cold Start" philosophies. - **Testing:** - Added test cases to verify parent-level container additions (e.g., adding the first `BrowserImplementations` or `BaselineStatus` to a feature). - Verified that all transitions (Unset <-> Set) for names and baseline statuses trigger correct changes.
jcscottiii
force-pushed
the
jcscottiii/fix-comparator
branch
from
February 5, 2026 22:07
a41d332 to
5b9899d
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes a bug where new browser implementation data was not triggering notifications if the feature previously had no browser data (the "Cold Start" problem). It also standardizes how optional fields are compared to support clean schema evolution.
Key Changes:
Comparator Logic (
lib/blobtypes/v1/comparator.go):compareBrowserImplsto remove an early return when the old state is unset. It now correctly detects when browser data is added for the first time.compareXYZmethods to explicitly handle the four states ofOptionallySetfields: Unset/Unset (No Change), Unset/Set (Added), Set/Unset (Removed), and Set/Set (Value comparison).Documentation:
comparator.goto ensure future maintainers follow the same robust comparison patterns.Testing:
BrowserImplementationsorBaselineStatusto a feature).