Repository navigation
Let the owner approve an exact snapshot change when the corpus is unchanged - #32
Merged
Merged
Conversation
…hanged The snapshot digest gate refuses a candidate whose snapshot contents differ from the deployed ones while the corpus is unchanged. That guards against accidental changes to published numbers, but it also refuses every deliberate core pipeline change, such as new derived columns or cost estimates, with no way through short of a corpus change. The gate now passes such a change only when the repository variable SITE_SNAPSHOT_APPROVED_CHANGE names the exact deployed-to-candidate canonical digest pair and SITE_SNAPSHOT_APPROVAL_REASON gives a reason. A failed gate prints the value to set. Any other pair, a reversed pair or an empty reason still fails, and the approved reason appears in the gate report.
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.
The snapshot digest gate refuses any candidate whose snapshot contents differ from the deployed ones while the corpus is unchanged. That stops accidental changes to published numbers. It also refuses every deliberate core pipeline change, and there was no way to approve one.
Production is blocked on exactly this today. Core BenchBox-dev/benchbox#2922 adds list-price cost estimates and query-ID repairs to the snapshot without changing the corpus. Every bundle since then fails with
canonical digest 2c1a0fbb… became b33aef4b….The gate now passes such a change only when:
SITE_SNAPSHOT_APPROVED_CHANGEequals the exact<deployed canonical digest>-><candidate canonical digest>pair, andSITE_SNAPSHOT_APPROVAL_REASONis not empty.When the gate fails, it prints the value to set. A different candidate, a different baseline, a reversed pair or an empty reason still fails. When the approval is used, the gate report shows its reason.
The flow follows the exact-match visual approval in core:
The next deploy records the new canonical digest in its receipt, so later bundles compare against it.
Tests:
npm run test:deploy: 36 of 36 pass, including a new test covering the exact pair, other pairs, a reversed pair and an empty reason.tsc -p deploy,lint:comments,lint:guard, YAML, markdownlint and cspell are clean.