test(generate): fill correctness-census followup assertions - #638
Merged
Merged
Conversation
Turn the reviewed followup markers in the generation-correctness census into named assertions that pin each field's emitted shape, and reclassify the one field with no distinct emitted contract. - gpg_key_id / gpg_key_secret: assert the emitted git setup imports the key, turns on commit.gpgsign, and wires the signing key, so state and finalize commits are actually signed. - run_policy (builds, deploys, validate): assert the emitted job if: gate matches the policy (change-detection gate vs always()). - depends_on / optional_depends_on (build and deploy): assert required deps both sequence and gate, while optional deps only sequence. - environments role: assert role: release moves the release stage off the positional-last environment. - pin_mode: assert sha mode emits SHA refs, tag mode emits tag refs. - release_trigger: assert dispatch drops the push trigger. - reconcile.commit: assert append vs followup emit their distinct steps. - reconcile.source: reclassify as not-emitted (single valid value, no sink). Also add a positive deploy-side permissions case, so a configured deploy permission is asserted to emit, not only the least-privilege omission. 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 generation-correctness census classifies every emitted-affecting manifest field as either a named correctness assertion or a reviewed marker. It shipped with a set of
followupmarkers: fields with a distinct emitted semantic shape whose assertion was deferred. Afollowupis a tracked acknowledgment, not a silent skip, but it still leaves the field's emitted contract unpinned.Fix
Fill the followup entries with real assertions (each proven red-first by breaking the emitter and watching the assertion fail):
commit.gpgsign true, and wiresuser.signingkey. A dropped signing line reds the assertion, so a regression cannot silently ship unsigned commits.if:gate matches the policy (change-detection gate vsalways()).needs:) and gate (if:); optional deps only sequence.role: releasemoves the release stage off the positional-last environment.push:trigger.Honestly reclassified rather than asserted:
not-emitted. It has a single valid value and no emitted consumer in the generate package, so there is no distinct shape to pin.followup. The same-repo optional contract is now asserted, but the external-deploy emit path is distinct and not exercised here.Also adds a positive deploy-side permissions case: a configured deploy permission is asserted to emit, not only the least-privilege omission (reviewer nit from the prior PR).
Where a field's correctness has a runtime component (run_policy gating, depends_on skip behavior), the assertion pins the emitted shape and notes that the runtime proof is fleet-only.
Verification
go build ./...,go vet,golangci-lint run ./...: clean.go test ./...: green except the documentedTestPushWithRebaseRetry_FailsFastOnRemoteRejectionflake.go test ./internal/generate/ -race: clean.cascade verify --own-repo: no drift.