Skip to content

fix(orchestrate): correct trigger glob matching for recursive and single-star patterns - #446

Merged
joshua-temple merged 1 commit into
mainfrom
fix/orchestrator-glob-land
Jul 5, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
fix/orchestrator-glob-land

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

The orchestrator's hand-rolled matchGlob mishandled two common trigger forms. Its ** branch compared paths against the recursive-glob suffix literally, so a trigger like **/*.go or pkg/**/*.ts never matched any real file. Change-detection then reported "no changes," silently skipping a build or deploy that had genuine changes, so a release could advance without the changed code. Its single-* branch used substring search, so * matched across / and the match was unanchored, over-matching triggers and forcing needless re-runs.

Fix

Replace the ad-hoc matcher with correct per-segment glob semantics: anchored matching, * bounded to a single path segment, and proper ** recursive handling. Add table-driven tests covering **/*.go, pkg/**/*.ts, a/*/b, and the previous over-match cases.

Verification

go build ./..., go test ./... -race -count=1, and golangci-lint run ./... all clean locally, including the new glob table tests.

…gle-star patterns

detectChanges reused a hand-rolled matchGlob that matched a recursive suffix
glob (`**/*.go`, `pkg/**/*.ts`) against the literal suffix, so it never matched
a real file and a needed build/deploy was silently skipped. The single-`*` branch
used an unanchored substring search, so `*` crossed `/` and `foo*bar` matched
`xfooybar`, over-triggering runs.

Delegate matchGlob to the shared config.MatchGlobPattern evaluator (already used
by internal/changes) so CLI-side change detection agrees with the emitted GitHub
Actions paths filter: single `*` stays within one segment and `**` expands across
any number of segments. Add table cases for the recursive-glob and anchoring
behaviour.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 6fe15ff into main Jul 5, 2026
19 checks passed
@joshua-temple
joshua-temple deleted the fix/orchestrator-glob-land branch July 5, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant