fix: skip cache save when path is missing#266
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 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