Repository navigation
Closed
Labels
area: ci-cdCI workflows, gates, and release automationarea: testsTest infrastructure and test suiteeffort: smallSmall effort - 2-4 hourspriority: lowNice to have, low urgencytype: technical-debtCode refactoring, cleanup, or architecture improvements
Description
Problem
Two files in internal/config/ now parse .github/workflows/*.yml with their own local structs:
release_gate_test.go(from ci: one definition of the gate, so a tag runs what a PR runs #500) —workflowFile/workflowJobDef, withneedsOf,readWorkflow, and theyaml:"on"YAML-1.1 handling.release_signing_test.go(from release: sign the release keylessly with cosign, no key material and no secret #501) —signingWorkflow,publishJob,releaseWorkflowSource,cutStep.
The duplication was deliberate: the two branches were cut from origin/main independently so they could merge in either order without a conflict in a shared helper. That reason expires the moment both have landed.
What to do
One parser, one readWorkflow, one needsOf, one cutStep, used by both test files. Carry over the two comments that record measured facts, because both are the kind of thing that gets "simplified" back out:
Onmust be a struct field taggedyaml:"on".gopkg.in/yaml.v2implements YAML 1.1, where a bareonkey parses as the booleantrue— so unmarshalling into a map yields atruekey and no"on"key at all.- Step-scoped assertions must cut the step out first. Searching the whole file matched
cosign verify-blobinside the release-notesechoblock, so the mutation that deleted the executed verification still passed. That hole was found by mutation, not by reading, and a shared helper is where it should be fixed once.
Metadata
Metadata
Assignees
Labels
area: ci-cdCI workflows, gates, and release automationarea: testsTest infrastructure and test suiteeffort: smallSmall effort - 2-4 hourspriority: lowNice to have, low urgencytype: technical-debtCode refactoring, cleanup, or architecture improvements
Activity
scttfrdmn commentedon Sep 19, 2026
Milestoned for v0.17.0. Correcting the premise: it is four parsers now, not two. #531 added one
yesterday, so the duplication this issue is about grew while it sat.
Current state in
internal/config:release_gate_test.go(workflowFile,workflowJobDef),release_signing_test.go(
signingWorkflow)map[any]any-based:job_timeouts_test.go,pull_request_triggers_test.go,packaging_test.go(two
yaml.Unmarshalsites)Six
yaml.Unmarshalcalls across five files, in two incompatible styles, all reading.github/workflows/. Converge on onereadWorkflow, oneneedsOf, onecutStep, one job iterator.Both blockers are cleared: #500 and #501 are merged.
Two measured facts have to survive as comments on the shared code, because each one was a real bug and
neither is guessable from the API:
onis the booleantrue. yaml.v2 reads YAML 1.1, so a bareon:key does not unmarshal as thestring
"on". In the struct form it needs a field taggedyaml:"on"; in the map form it needs the[]any{true, "on"}lookup thatpull_request_triggers_test.go'striggerSectiondoes.cosign verify-blobinside a release-notesecho, and a mutation deleting the executed verificationstill passed.
Whatever the shared helper ends up looking like, verify it by mutation against the existing tests: each
of the five callers should still fail for the reason it was written to fail, which for two of them means
re-running the mutations above rather than trusting a green suite.
fix(ci): the install-script gate authenticates, and its required-chec…