Skip to content

fix: base-cache-paths saved nothing with the default working-directory - #4

Merged
buggtb merged 1 commit into
mainfrom
fix/base-cache-paths-default-workdir
Oct 12, 2026
Merged

buggtb merged 1 commit into
mainfrom
fix/base-cache-paths-default-workdir

Conversation

@buggtb

@buggtb buggtb commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

base-check.yml built its cache path as base/${WORKDIR}/${path}. With the default working-directory: "." that is base/./acceptance-launcher.jar, which actions/cache rejects (Invalid pattern 'base/./...'. Relative pathing '.' and '..' is not allowed.) and then saves nothing, with only a warning. The prefixing now lives in scripts/prefix-cache-paths.sh (drops ./ and a trailing /, refuses absolute and climbing paths), with unit tests.

Why

Found migrating spiculedata/saiku (spiculedata/saiku#2243), whose base launcher cache keyed on the base SHA this was meant to reproduce. Evidence: on a throwaway PR, the second push to the same PR (same base SHA) logged Cache not found for input keys: acceptance-base-v1-<sha>-<fp> and rebuilt the base (~9 min) because the first run's save step logged the invalid-pattern warning. selftest.yml did not notice because it uses fixtures/consumer as its working directory.

Verification

  • node --test "scripts/*.test.mjs": 129 pass (new prefix-cache-paths.test.mjs: default dir, empty dir, sub-project, blank lines, refused paths, workflow uses the script).
  • Not verified: the fixed workflow has not run from a caller in another repository; saiku re-pins after this merges and will show Cache restored on a second push.

Risk

Low. Only the construction of the actions/cache path changes, and only for callers that set base-cache-paths. Sub-project callers get the same paths as before.

🤖 Generated with Claude Code

…-directory

base-check built the cache path as base/${WORKDIR}/${path}. With the default
working-directory "." that is base/./dist, and actions/cache rejects it
("Invalid pattern ... Relative pathing '.' and '..' is not allowed") and saves
nothing, with only a warning. The base build was therefore never cached for any
caller in the repository root, so every re-push of a spec-changing PR rebuilt
the base (found migrating saiku, whose cached base launcher this was meant to
reproduce). selftest did not notice: it uses fixtures/consumer as its working
directory.

The prefixing moves to scripts/prefix-cache-paths.sh, which drops ./ and a
trailing / from the working directory and refuses absolute or climbing paths,
with tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tom Barber <tom@spicule.co.uk>
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Acceptance self-test (fixture)

Check Result What it means
Convention (a closing PR ships its spec) Nothing to check Nothing to check on this PR.
Specs on this PR's build Pass Everything that ran passed.
Spec-first proof (red on base, green on this PR) Nothing to check Nothing to check on this PR.

Updated for commit 9ed8c60, workflow run. This comment is edited in place, never repeated.

buggtb added a commit to spiculedata/saiku that referenced this pull request Oct 12, 2026
Upstream builds base/./acceptance-launcher.jar, which actions/cache rejects
(spiculedata/acceptance-spec#4 fixes it). The setting stays so the cache starts
working on the next re-pin.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tom Barber <tom@spicule.co.uk>
@buggtb buggtb reopened this Oct 12, 2026
@buggtb
buggtb merged commit 380780e into main Oct 12, 2026
42 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.

1 participant