fix(hotfix): match per-component env branches in finalize trigger - #547
Merged
joshua-temple merged 2 commits intoJul 10, 2026
Merged
Conversation
The hotfix finalize pull_request trigger filtered branches on env/*, but a GitHub Actions branch glob stops at a slash. Per-component env branches carry two segments (env/api/staging), so env/* never matched them and the closed-PR finalize never fired for a multi-component pipeline: divergence went unrecorded and the component state leaf never advanced. Widen the filter to env/**, which matches both env/staging and env/api/staging with no change for single-component pipelines. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
…2e scenario 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 generated
cascade-hotfix-*.yamlfinalize job triggers onpull_request: types:[closed]filtered tobranches: ['env/*']. GitHub Actions branch-filter*does not cross/, so it matches single-segmentenv/stagingbut NOT the two-segment per-component env branches a multi-component manifest uses (env/api/staging,env/web/prod). On a monorepo, closing a hotfix PR againstenv/api/stagingnever fires the finalize: divergence is never recorded and the component state leaf never advances. Single-component repos were unaffected (theirenv/stagingmatchesenv/*), which is why this surfaced only under per-component coverage.Fix
internal/generate/hotfix.go: change the finalize branch filter to'env/**'. Per GitHub filter-pattern semantics**matches any depth, so'env/**'matches bothenv/stagingandenv/api/staging. The git refspec uses ofenv/*(refs/heads/env/*) are unchanged: git refspec*suffix-matches across/and already fetches nested env branches correctly.Verification
Regression test
TestHotfixGenerator_FinalizeTriggerMatchesNestedEnvBranches(red before, green after) asserts the emitted trigger isenv/**. Byte-identical single-component golden updated (still matchesenv/staging, no single-component regression).go build ./...,go test ./...(2700 pass),go test ./... -race,golangci-lint run ./...all clean.