fix: skip cache save when path is missing#266
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-05-11T12:04:07.383ZApplied to files:
🔇 Additional comments (2)
📝 WalkthroughWalkthroughThe PR adds a guard to ChangesCache path existence check
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
PR Summary by QodoSkip cache save when PNPM store path is missing WalkthroughsDescription• Skip post-job cache save when the resolved cache path does not exist. • Prevent cold-cache workflows from failing when pnpm store is never created. • Regenerate the bundled action output to include the new guard. Diagramgraph TD
A["GitHub Actions job"] --> B["Restore cache"] --> C["runSaveCache()"] --> D{"Primary key hit?"}
D -- "Yes" --> E["Skip save"]
D -- "No" --> F{"Cache path exists?"}
F -- "No" --> E
F -- "Yes" --> G["saveCache()"] --> H["GitHub Cache"]
High-Level AssessmentThe following are alternative approaches to this PR: 1. Try/catch around saveCache() and treat ENOENT as non-fatal
2. Ensure pnpm store directory exists before saving (mkdir -p)
Recommendation: The current existsSync(path) guard is the simplest and most predictable fix: it prevents a known failure mode (missing store directory) without altering cache contents or error semantics for other failures. The alternatives add complexity or introduce new side effects (saving empty caches). File ChangesBug fix (1)
Other (1)
|
Summary
Fixes #265.
Validation
pnpm install --frozen-lockfilepnpm run buildpnpm exec tsc --noEmitSummary by CodeRabbit
Bug Fixes