Repository navigation
perf(NOJIRA-123): save the Node cache from the Build job only - #290
Open
adriancarayol wants to merge 1 commit into
Open
adriancarayol wants to merge 1 commit into
adriancarayol wants to merge 1 commit into
Conversation
Parallel and downstream jobs in frontend-pr-workflow and frontend-deploy-workflow now pass save-cache: never to setup-node-with-cache, and the Build job takes its policy from a new save-node-cache input (default auto). Stops jobs racing to save the same key after a miss, including on pushes to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Security Analysis ResultsNo security issues found. 3 files reviewed.
|
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.
Overview
Jira ticket: NOJIRA-123
This is the follow-up to #287, and it's stacked on it: the base is #287's branch, so the diff only shows this change. Merge #287 first. GitHub then retargets this PR to
main.In
frontend-pr-workflow.ymlandfrontend-deploy-workflow.yml, only the Build job saves the Node dependency cache. Every other job that runssetup-node-with-cachepassessave-cache: 'never'.Problem and evidence
#287's
autopolicy stops PR jobs from saving after a restore-key fallback. It still saves from every job on the default branch, though, and infrontend-pr-workflowthe Unit Tests job runs in parallel with Build (it has noneeds). On a push to main that changes dependencies, both jobs miss the key, both compress the archive, and one of them fails withUnable to reserve cache … another job may be creating this cache.Measured in Typeform/automations (job logs, Nov 9–16):
Post Setup Node with Cachethere.PR / 🧪 Unit Testson push to main had a p50 post step of 249 s.Changes
New input
save-node-cache(autodefault,default-branch,never,always) in both reusable workflows. It's passed to the Build job'ssetup-node-with-cacheassave-cache.save-cache: 'never'in the other jobs that call the action:frontend-pr-workflow:unit-tests(runs alongside Build),integration-testsanddeploy-preview(bothneeds: build)frontend-deploy-workflow:unit-tests,integration-testsanddeploy(allneeds: build)The jobs that
needBuild start after its save, so they usually get an exact hit and wouldn't save anyway. Settingneverthere makes "Build saves, everything else restores" an explicit rule, rather than one that depends on timing.README row for
save-node-cacheinreusable-workflows/frontend-pr-workflow/README.md.Out of scope:
run-cypress-*andrun-playwright-visualactions callsetup-node-with-cacheinternally. They all run after Build.reusable-workflows/frontend-pr-workflow/workflow.yml: every job after Build there hasneeds: build.logicator2000-pr.yml) still needsave-cache: neverin their own parallel jobs. I'll do those per repo afterv1moves.Risks
v1moves, these workflows still call the action at@v1, which has nosave-cacheinput. GitHub logs a warning for an unexpected input and ignores it, so behaviour stays the same untilreleasemovesv1to include perf(NOJIRA-123): keep setup-node-with-cache saves off the PR critical path #287.save-node-cache: neverturns off saving for the whole workflow. That's only useful together with a separate cache-warming job.Testing
actionlint1.7.12 on both workflows gives the same findings as the base branch (32 lines; only the line numbers moved). None are new.@v1, so a caller pinned to this branch would still run the old action untilv1moves. The value passed here is the one tested end to end in perf(NOJIRA-123): keep setup-node-with-cache saves off the PR critical path #287:neverskips the save, the same path asautoon a PR fallback.Docs
For contributions to the
Typeform/.githubrepo🤖 Generated with Claude Code