Skip to content

fix: make auto-release path gate CWD-independent - #26

Merged
rianjs merged 1 commit into
mainfrom
fix/auto-release-gate-cwd-glob
Jun 3, 2026
Merged

fix: make auto-release path gate CWD-independent#26
rianjs merged 1 commit into
mainfrom
fix/auto-release-gate-cwd-glob

Conversation

@rianjs

@rianjs rianjs commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Closes #25

Root cause

actions/auto-release/gate.sh _split_csv split the path CSVs with an unquoted for 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 like tools/cfl/** names a real directory — so it expanded into the actual entries under tools/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, and tools/cfl/go.mod all returned rc=1 (skip). So atlassian-cli's auto-release has silently skipped all change types since it migrated onto the shared workflow — the surviving cfl-v1.0.57 tag 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 -f setting (no global state leak; bash 3.2-safe — no array-expansion-under-set -u).

Tests

Added regression cases to test_gate.sh that invoke match-paths from a fixture tree where tools/cfl/ exists. They fail against the old code (3 of them) and pass now. The pre-existing tests passed only because test_gate.sh cds into actions/auto-release/, where the tool glob never expands — i.e. they never exercised the CWD-sensitive path.

# pre-fix, from repo root:
from root: cfl version bump  -> FAIL   from root: cfl go file -> FAIL   from root: cfl go.mod -> FAIL
# post-fix: all green

After merge

Advance the rolling v1 tag so the @v1 callers pick this up, then a version-bump on atlassian-cli will correctly cut the pending signed cfl/jtk releases.

_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
@rianjs
rianjs merged commit 215cf80 into main Jun 3, 2026
18 checks passed
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.

auto-release gate.sh: unquoted glob in _split_csv drops version-bump releases for monorepo tools

1 participant