refactor(generate): promote the shared pin-reconcile core - #474
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
…ary regenerate Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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
The action-pin drift scanner lived only inside a test file, and there was no way to read the incoming ref from a changed workflow line, load an action-pin table from an arbitrary disk path, overlay those pins onto a config for a pinned-binary regenerate, or fold multiple observed refs into a single adopted value. These are the shared primitives a pin-reconciliation engine needs.
Fix
Adds the load-bearing, source-agnostic reconcile core (no CLI wiring yet):
internal/generate/pin_scan.go(PinMismatch,ScanUsesForPinDrift,LoadEmbeddedPinManifest) and rewires the existing consistency/anchor tests to the exported names, behavior-preserving.ParseUsesLineto parse a singleuses:line into its action and verbatim ref.internal/generate/pin_load.go:LoadActionPinTable(disk pin loader) andApplyDiskPinOverrides(overlay disk pins ontocfg.ActionPins, with an explicit user pin still winning), so a version-pinned binary regenerates against the repo's current pins across every sub-generator.internal/pinreconcile/consensus.go(consensusRef, refuse-on-ambiguity) andinternal/pinreconcile/reconcile.go(PlanAdoptions, verbatim governed-pin adoption that never touches ungoverned actions).Verification
go build ./...,go test ./...(2383 passed),golangci-lint run ./...all clean.Part of #440.