setup: expose zccache store path for consumer caches#154
Conversation
📝 WalkthroughWalkthroughThe changes expose the zccache object-store directory location from the fbuild setup composite action as a step output and GitHub environment variable, enabling downstream workflows to cache it across runs. Documentation is updated to show the canonical cache block and key recommendations incorporating zccache alongside Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/actions/setup/action.yml (1)
67-74: Add azccache-dirinput and respect pre-existingZCCACHE_DIRvalues.The action unconditionally overwrites
ZCCACHE_DIRwithout providing an input override or respecting any pre-existing value set by the caller at the workflow/job level. This differs from thecache-dirinput pattern and silently surprises users who have already configuredZCCACHE_DIRviaenv:.For consistency and to avoid surprising overrides, add a
zccache-dirinput and check for pre-existingZCCACHE_DIRvalues:Suggested change
if [ -n "${{ inputs.cache-dir }}" ]; then CACHE_DIR="${{ inputs.cache-dir }}" else CACHE_DIR="${RUNNER_TEMP}/fbuild-cache" fi - ZCCACHE_DIR="${RUNNER_TEMP}/zccache" + if [ -n "${{ inputs.zccache-dir }}" ]; then + ZCCACHE_DIR="${{ inputs.zccache-dir }}" + elif [ -n "${ZCCACHE_DIR:-}" ]; then + : # honor caller-provided value + else + ZCCACHE_DIR="${RUNNER_TEMP}/zccache" + fi mkdir -p "$CACHE_DIR" "$ZCCACHE_DIR"Plus add a matching
zccache-direntry underinputs:.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/actions/setup/action.yml around lines 67 - 74, Add a new action input "zccache-dir" and update the setup logic to respect an existing ZCCACHE_DIR environment value or the new input instead of always overwriting it: if ZCCACHE_DIR is already set in the environment keep it, otherwise use the provided input "zccache-dir" (falling back to "${RUNNER_TEMP}/zccache" when neither is set), ensure mkdir -p uses the resolved ZCCACHE_DIR, and continue exporting the resolved value via the existing echo "ZCCACHE_DIR=..." >> "$GITHUB_ENV" and echo "zccache-store-path=..." >> "$GITHUB_OUTPUT" lines so callers can override via env: or input.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/actions/setup/action.yml:
- Around line 67-74: Add a new action input "zccache-dir" and update the setup
logic to respect an existing ZCCACHE_DIR environment value or the new input
instead of always overwriting it: if ZCCACHE_DIR is already set in the
environment keep it, otherwise use the provided input "zccache-dir" (falling
back to "${RUNNER_TEMP}/zccache" when neither is set), ensure mkdir -p uses the
resolved ZCCACHE_DIR, and continue exporting the resolved value via the existing
echo "ZCCACHE_DIR=..." >> "$GITHUB_ENV" and echo "zccache-store-path=..." >>
"$GITHUB_OUTPUT" lines so callers can override via env: or input.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f04347dc-1d75-47a3-893a-5139a6a746d7
📒 Files selected for processing (3)
.github/actions/setup/README.md.github/actions/setup/action.ymldocs/CI_CACHING.md
Summary
zccache-store-pathfrom.github/actions/setupZCCACHE_DIRalongsideFBUILD_CACHE_DIRso downstream steps inherit the resolved store pathactions/cache@v4pattern for caching zccache plus project build outputs, keyed with the setup action'sfbuild-hashTesting
git diff --checkzccache-store-path/ZCCACHE_DIRreferences across.github/actions/setup/action.yml,.github/actions/setup/README.md, anddocs/CI_CACHING.mdCloses #149.
Summary by CodeRabbit
New Features
zccache-store-pathoutput andZCCACHE_DIRenvironment variable.Documentation