test(generate): relax frozen action-pins snapshot to structural invariants - #487
Merged
Merged
Conversation
TestDefaultActionPins_MatchesPriorHardcodedTable pinned the exact tag/sha/version of every emit:true action. action_pins.yaml is the single source of truth for those values and legitimately changes over time, so the frozen-value assertion failed on every governed-pin bump, including the self-heal reconcile companion's own adoption commits. Renamed to TestDefaultActionPins_OnlyEmitTrueEntriesWellFormed and relaxed it to assert the structural invariants that still matter: defaultActionPins holds exactly the manifest's emit:true actions (no emit:false leak, none missing) and every entry has a well-formed tag, sha, and version. Dropped the hardcoded per-value comparison. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
TestDefaultActionPins_MatchesPriorHardcodedTablehardcoded the exact tag/sha/version of every emit:true governed action and asserteddefaultActionPinsmatched value-for-value. That was a one-time migration-safety check for when the hardcoded table became the embeddedaction_pins.yamlmanifest. Since the manifest is now the single source of truth and legitimately changes over time (Dependabot bumps, and the new self-heal reconcile companion adopting a pin), the frozen assertion fails on every legitimate governed-pin change, including the reconcile companion's own commits.Fix
Renamed the test to
TestDefaultActionPins_OnlyEmitTrueEntriesWellFormedand relaxed it to check structural invariants derived from the manifest itself instead of hardcoded values:defaultActionPinscontains exactly the manifest's emit:true actions (no emit:false leak, none missing).commitSHAPattern.Dropped the hardcoded per-value comparison.
Verification
go build ./...,go test ./..., andgolangci-lint run ./...all clean.actions/create-github-app-token's tag/sha/version inaction_pins.yaml).