fix: make auto-release path gate CWD-independent - #26
Merged
Conversation
_split_csv split the release/tool path CSVs with an unquoted `for x in $1`, so each field underwent pathname expansion. Run from a repo root — as the reusable auto-release workflow does — a tool-path glob like `tools/cfl/**` expanded into the real directory entries under tools/cfl/ instead of staying a literal pattern, so no changed file matched the tool path and EVERY change to a monorepo tool was skipped (not just version bumps; .go and go.mod too). Single-tool repos were unaffected — their tool glob has nothing to expand against. Disable globbing while splitting and restore the caller's prior setting. Add regression tests that run match-paths from a tree where tools/cfl/ exists; they fail against the old code and pass now. bash 3.2-safe. Closes #25
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.
Closes #25
Root cause
actions/auto-release/gate.sh_split_csvsplit the path CSVs with an unquotedfor x in $1, so each comma-field underwent pathname expansion. The reusable auto-release workflow runs the gate from the repo root, where a monorepo tool-path glob liketools/cfl/**names a real directory — so it expanded into the actual entries undertools/cfl/(tools/cfl/cmd,tools/cfl/internal, …) instead of staying the literal pattern. No changed file then matched the tool path, so every change to a monorepo tool was skipped.Confirmed blast radius (reproduced from a repo root, pre-fix):
tools/cfl/version.txt,tools/cfl/internal/foo.go, andtools/cfl/go.modall returnedrc=1 (skip). So atlassian-cli's auto-release has silently skipped all change types since it migrated onto the shared workflow — the survivingcfl-v1.0.57tag predates that migration. Single-tool repos (gro/nrq/slck/cr) were unaffected: their tool glob has nothing to expand against, which is why they release fine.Fix
Disable globbing for the duration of the split, restoring the caller's prior
-fsetting (no global state leak; bash 3.2-safe — no array-expansion-under-set -u).Tests
Added regression cases to
test_gate.shthat invokematch-pathsfrom a fixture tree wheretools/cfl/exists. They fail against the old code (3 of them) and pass now. The pre-existing tests passed only becausetest_gate.shcds intoactions/auto-release/, where the tool glob never expands — i.e. they never exercised the CWD-sensitive path.After merge
Advance the rolling
v1tag so the@v1callers pick this up, then a version-bump on atlassian-cli will correctly cut the pending signedcfl/jtkreleases.