Only treat a Yarn cache folder with archives as an offline cache #17087
All Vouch review confidence checks passed
Residual risk 0.37 = Change Risk (0.57) × (1 − Review Confidence (0.35)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 401 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 40% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.359
Shallow Review Depth
shallow_review_depth
0.289
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #17087"
general
weight: 0.35
BenKamin03
What are you trying to accomplish?
FileFetcher#create_yarn_cache(added in #11011) always runsFileUtils.mkdir_pon the YarncacheFolder.Helpers.yarn_offline_cache?treats any existing cache folder plusnodeLinker: node-modulesas an offline cache. As a result, every Yarn Berry project using the node-modules linker runs Yarn with--mode=skip-build, which fetches every package in the lockfile, instead of--mode=update-lockfile.This shows up in grouped updates for a project that also installs from a private registry the job has no credentials for:
1. The first dependency in the group runs
yarn add <dep>@<version> --mode=skip-build, thenyarn install --mode=skip-build. Both try to fetch every package, and the private registry returns 403, so the update fails withdependency_not_found.2. Dependabot then runs
git stash push --allandgit clean, which removes the empty cache folder.3. Every later dependency in the same group runs with
--mode=update-lockfile, only fetches what changed, and succeeds.So the grouped PR always leaves out whichever dependency is processed first.
This PR makes
yarn_offline_cache?require at least one.ziparchive in the cache folder. A project that keeps an offline cache always has archives there, so it still getsskip-build.Anything you want to highlight for special attention from reviewers?
yarn addfailure, reproduced in a private repository I can't see. If that fix worked by switching those projects toskip-build, this change would revert it for them. A maintainer who can see that reproduction may want to check it..gitignoreinto its cache folder, so a folder holding only that file would still count. The new spec covers that case.Dir.each_childis used instead ofDir.glob, so acacheFoldercontaining glob characters is handled literally.How will you know you've accomplished your goal?
Helpers.yarn_offline_cache?cover: no folder, empty folder, a folder holding only.gitignore, a folder with an archive, a customcacheFolder, and a Plug'n'Play project. The empty-folder spec fails onmain.cacheFolderspec for the file fetcher still pass.srb tc) report no errors on the changed files.Checklist
🤖 Generated with Claude Code