feat(cache): add output globs for cache restoration#375
feat(cache): add output globs for cache restoration#375branchseer wants to merge 1 commit intomainfrom
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dbd5b86b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| None, | ||
| CacheUpdateStatus::NotUpdated(CacheNotUpdatedReason::CacheHit), | ||
| Some(ExecutionError::Cache { kind: CacheErrorKind::Lookup, source: err }), | ||
| ); | ||
| return SpawnOutcome::Failed; |
There was a problem hiding this comment.
Treat archive extraction failures as cache misses
If the cached archive file is missing or unreadable (for example after partial cache cleanup, disk corruption, or interrupted writes), this branch turns a would-be cache hit into a hard task failure instead of re-running the task. Because output archives live outside SQLite, this can happen even when the fingerprint row is valid, and it will block builds until users manually clear the DB entry. Falling back to a cache miss path here would preserve correctness and availability.
Useful? React with 👍 / 👎.
Adds an `output` field to cached tasks: archives files matching the
configured globs after a successful run and restores them on cache hit.
Supports glob patterns, negative patterns, and `{pattern, base}` form
with explicit base directory. When `output` is omitted or empty, no
output archiving happens (matches prior behavior).
Schema version bumped to 12 (CacheEntryKey carries output_config,
CacheEntryValue carries output_archive). Old caches are reset on upgrade.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9dbd5b8 to
6d03bc0
Compare
Summary
Adds an
outputfield to cached tasks: archives files matching the configured globs after a successful run and restores them on cache hit.[]: no output archiving (matches existing behavior)["dist/**"]: archive matching files; restore on cache hit[{"pattern": "...", "base": "workspace" | "package"}]: explicit base directory["!dist/cache/**"]: negative patterns exclude files{auto: true}— that comes in the follow-up feat(cache): restore output files on cache hit #321 (auto-detect via fspy)Schema bumped to v12 (
CacheEntryKeycarriesoutput_config,CacheEntryValuecarriesoutput_archive). Old caches reset on upgrade.Test plan
🤖 Generated with Claude Code