fix: PR 755 follow-up regression test and code quality#768
Merged
jevonearth merged 1 commit intomainfrom Mar 4, 2026
Merged
Conversation
Add end-to-end test (TestBallotSubkindPolicy_EndToEnd) that exercises PreparePolicy -> New -> Sign for ballot sub-kind config, preventing the class of regression introduced by PR 657 where config validation rejected valid runtime syntax. Code quality fixes: - Fix typo avilKinds -> availKinds in checkRequestKind/checkOperationKind - Replace hardcoded ballot values with core.BallotKind constants - Handle sub-kind syntax in fixupOperations for deprecated name renames - Fix trailing whitespace flagged by gofmt - Add tests for deprecated alias normalization with sub-kind syntax
Deploying signatory with
|
| Latest commit: |
cf7a804
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f04f5a2a.signatory.pages.dev |
| Branch Preview URL: | https://fix-pr755-followup-regressio.signatory.pages.dev |
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.
Summary
Follow-up to PR #755 addressing code quality issues from review and adding a regression test for the config validation vs runtime enforcement seam.
TestBallotSubkindPolicy_EndToEndexercisesPreparePolicy->signatory.New->Signwithballot:nay,ballot:pass(accepted) andballot:yay(rejected), covering all three ballot sub-kinds end-to-end. This is the exact seam that broke in PR Request and operation kind validation #657.avilKinds->availKindsincheckRequestKindandcheckOperationKind[]string{"yay", "nay", "pass"}replaced withcore.BallotYay.String(),core.BallotNay.String(),core.BallotPass.String()fixupOperationsnow handles compoundop:subkindsyntax for deprecated name renames (e.g.endorsement:foo->attestation:foo), with explicit tests documenting the normalization-before-validation behaviorgofmtTest plan
go test ./pkg/signatory/ -run TestBallotSubkindPolicy_EndToEnd -v -count=1go test ./pkg/signatory/ -run TestOperationKindCheck -v -count=1go test ./pkg/signatory/ -run TestPolicy -v -count=1go test ./pkg/signatory/ -count=1(full package suite)gofmt -l pkg/signatory/signatory.go pkg/signatory/signatory_test.go(clean)