Repository navigation
fix: base-cache-paths saved nothing with the default working-directory - #4
Merged
Merged
Conversation
…-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>
Acceptance self-test (fixture)
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>
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.
What
base-check.ymlbuilt its cache path asbase/${WORKDIR}/${path}. With the defaultworking-directory: "."that isbase/./acceptance-launcher.jar, whichactions/cacherejects (Invalid pattern 'base/./...'. Relative pathing '.' and '..' is not allowed.) and then saves nothing, with only a warning. The prefixing now lives inscripts/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.ymldid not notice because it usesfixtures/consumeras its working directory.Verification
node --test "scripts/*.test.mjs": 129 pass (newprefix-cache-paths.test.mjs: default dir, empty dir, sub-project, blank lines, refused paths, workflow uses the script).Cache restoredon a second push.Risk
Low. Only the construction of the
actions/cachepath changes, and only for callers that setbase-cache-paths. Sub-project callers get the same paths as before.🤖 Generated with Claude Code