Conversation
…efore restore
The debug and log steps recomputed hashFiles('**/package.json', ...) after the
cache restore, when the glob also matches every package.json inside the restored
node_modules. On frontend-packages each call took ~4s (two per step, since both
the yarn and pnpm lines are evaluated), ~16s per job, and printed a different key
than the one the cache was restored with. Hash once in a dep-hash step before the
restore and reuse it for the cache keys and both log lines. Keys are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Security Analysis ResultsNo security issues found. 1 files reviewed.
|
Contributor
Author
|
Closing for now. This is deferred, not rejected: nothing depends on it, and it isn't worth a |
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.
Problem
Debug cache contentsandLog cache status and decisionprint the cache key by recomputing it:They run after the cache restore, so
**/package.jsonalso matches everypackage.jsoninside the restorednode_modules. GitHub evaluates both the yarn and pnpm lines in eachrun:block, so each step hashes that tree twice. That causes two problems:Fix
Compute dependency cache hashstep (id: dep-hash) runs before the restore. It hashes the same files as today.steps.dep-hash.outputs.{yarn,pnpm}.Verified
Tested on
frontend-packagesin throwaway PR #37: the same inputs asfrontend-pr-workflow, run side by side onci-universal-scale-set, with both runs hitting the same cache.@v1(current)…4c45dc…❌…15aca3…✅…15aca3…-full…15aca3…-fullThat's about 20 s saved per job.
frontend-pr-workflowruns this action in both Build and Unit Tests, so each PR saves about 40 s of runner time.The #258 idea, keying on the lockfile alone, is left for a separate change.
🤖 Generated with Claude Code