fix: refactor cache-checkout to use actions/cache@v4 with fallback#26702
Merged
keithwillcode merged 2 commits intomainfrom Jan 10, 2026
Merged
fix: refactor cache-checkout to use actions/cache@v4 with fallback#26702keithwillcode merged 2 commits intomainfrom
keithwillcode merged 2 commits intomainfrom
Conversation
This fixes cache propagation delay issues with Blacksmith's distributed cache. The previous implementation used separate save/restore actions with fail-on-cache-miss: true, which failed when the cache wasn't immediately available after being saved by the Prepare job. The new implementation uses actions/cache@v4 (combined save/restore) with a fallback to do the checkout if cache miss, matching the pattern used by cache-build and cache-db which don't have this issue. Changes: - Refactored cache-checkout action to use actions/cache@v4 - Added fallback checkout step when cache miss occurs - Removed mode input (no longer needed) - Updated all workflows to use the simplified cache-checkout action Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Author
anikdhabal
approved these changes
Jan 10, 2026
Contributor
Author
volnei
approved these changes
Jan 10, 2026
Contributor
There was a problem hiding this comment.
1 issue found across 20 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name=".github/actions/cache-checkout/action.yml">
<violation number="1" location=".github/actions/cache-checkout/action.yml:20">
P1: Missing fallback for `ref` parameter will break this action in non-PR contexts (e.g., `workflow_dispatch`). The cache key correctly uses `${{ github.event.pull_request.head.sha || github.sha }}` but the checkout `ref` lacks the same fallback.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| !node_modules | ||
| !**/node_modules | ||
| key: git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.event.pull_request.head.sha || github.sha }} | ||
| ref: ${{ github.event.pull_request.head.sha }} |
Contributor
There was a problem hiding this comment.
P1: Missing fallback for ref parameter will break this action in non-PR contexts (e.g., workflow_dispatch). The cache key correctly uses ${{ github.event.pull_request.head.sha || github.sha }} but the checkout ref lacks the same fallback.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/actions/cache-checkout/action.yml, line 20:
<comment>Missing fallback for `ref` parameter will break this action in non-PR contexts (e.g., `workflow_dispatch`). The cache key correctly uses `${{ github.event.pull_request.head.sha || github.sha }}` but the checkout `ref` lacks the same fallback.</comment>
<file context>
@@ -1,33 +1,26 @@
- !node_modules
- !**/node_modules
- key: git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.event.pull_request.head.sha || github.sha }}
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 2
+ sparse-checkout-cone-mode: false
</file context>
Fix confidence (alpha): 10/10
Suggested change
| ref: ${{ github.event.pull_request.head.sha }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} |
Contributor
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. |
Contributor
E2E results are ready! |
7 tasks
7 tasks
Anshumancanrock
pushed a commit
to Anshumancanrock/cal.com
that referenced
this pull request
Jan 12, 2026
…alcom#26702) This fixes cache propagation delay issues with Blacksmith's distributed cache. The previous implementation used separate save/restore actions with fail-on-cache-miss: true, which failed when the cache wasn't immediately available after being saved by the Prepare job. The new implementation uses actions/cache@v4 (combined save/restore) with a fallback to do the checkout if cache miss, matching the pattern used by cache-build and cache-db which don't have this issue. Changes: - Refactored cache-checkout action to use actions/cache@v4 - Added fallback checkout step when cache miss occurs - Removed mode input (no longer needed) - Updated all workflows to use the simplified cache-checkout action Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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 does this PR do?
Fixes cache propagation delay issues with Blacksmith's distributed cache that were causing CI failures.
Root cause: The Prepare job saves the cache, but subsequent jobs starting ~14 seconds later couldn't find it because the cache hadn't propagated yet in Blacksmith's distributed system. The previous implementation used separate
actions/cache/save@v4andactions/cache/restore@v4withfail-on-cache-miss: true, which caused immediate failures.Solution: Refactored
cache-checkoutto useactions/cache@v4(combined save/restore) with a fallback to do the checkout if cache miss occurs. This matches the pattern used bycache-buildandcache-dbwhich don't have this issue.Changes:
cache-checkoutaction to useactions/cache@v4instead of separate save/restoredangerous-git-checkout)modeinput (no longer needed)cache-checkoutactiondangerous-git-checkoutstep frompr.ymlPrepare job (now handled by cache-checkout)Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
Human Review Checklist
github.event.pull_request.head.sha) in all workflow contexts