Repository navigation
Repair wp/7.1 branch Actions: Disable the node_modules cache in the Storybook check - #84178
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
c10caf8 to
c9f3ea3
Compare
c9f3ea3 to
59a44ae
Compare
59a44ae to
1dc3c89
Compare
Part of #82781.
What?
Sets
cache: falseon the./.github/setup-nodestep in the Storybook check workflow (.github/workflows/storybook-check.yml), so the job neither restores nor saves thenode_modulesand npm caches.Why?
The Storybook check runs
./.github/setup-node, then runsnpm install --no-save @storybook/test-runner@..., which adds and changes packages insidenode_modules. At the end of the job, thenode_modulescache step saves that modified tree. Its cache key only covers the OS, architecture, Node.js version and lockfile hash, so the modified tree is saved as if it were a clean install. Later jobs on the same ref restore it, skipnpm ci, and fail.For example, on #84039 the Storybook check (https://github.com/WordPress/gutenberg/actions/runs/37631035082) saved the cache after
npm install --no-savereported "added 101 packages, changed 29 packages". The Unit Tests run (https://github.com/WordPress/gutenberg/actions/runs/37631034438) restored it a few minutes later, and "Build JavaScript assets for PHP unit tests" failed withTS2307: Cannot find module 'http'and other missing Node.js type errors.How?
Uses the
cacheinput that #83400 adds to.github/setup-node/action.ymlon this branch. Withcache: false, the Storybook check always runs a freshnpm ciand never writes its modifiednode_modulesback to the shared cache.Trunk fixed this differently in b7fb03b, which removed the
npm install --no-savestep. That change depends on astorybookworkspace that this branch does not have.Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code