feat(task): add cache fingerprint ignore patterns#214
Conversation
Allow tasks to exclude specific files/directories from cache fingerprint
calculation using glob patterns with gitignore-style negation support.
This enables selective caching for tasks like package installation where
only dependency manifests (package.json) matter for cache validation,
not implementation files. Cache hits occur when ignored files change.
Key features:
- Optional fingerprintIgnores field accepts glob patterns
- Negation patterns (!) to include files within ignored directories
- Leverages existing vite_glob crate for pattern matching
- Fully backward compatible (defaults to None)
Example:
{
"fingerprintIgnores": [
"node_modules/**/*",
"!node_modules/**/package.json"
]
}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b28e9ad to
9cad5cb
Compare
Add comprehensive snap-test demonstrating cache fingerprint ignore patterns. The test verifies: - Cache hit when ignored files change (node_modules/*/index.js, dist/*) - Cache miss when non-ignored files change (package.json via negation) - Negation patterns work correctly (!node_modules/**/package.json) Test scenario: 1. First run - cache miss (initial execution) 2. Second run - cache hit (no changes) 3. Modify index.js - cache hit (ignored by node_modules/**/* pattern) 4. Modify dist/bundle.js - cache hit (ignored by dist/**/* pattern) 5. Modify package.json - cache miss (NOT ignored due to negation pattern) This validates the selective caching feature for package installation tasks where only dependency manifests matter for cache validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
9cad5cb to
73eb4ec
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds cache fingerprint ignore patterns to allow tasks to exclude specific files/directories from triggering cache invalidation. The feature enables selective caching where only certain files (like package.json) matter for cache validation, not all accessed files.
Key changes:
- Adds optional
fingerprintIgnoresfield to task configuration supporting glob patterns with gitignore-style negation - Leverages existing
vite_globcrate for pattern matching with last-match-wins semantics - Maintains full backward compatibility with no behavior changes when field is omitted
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
crates/vite_task/src/config/mod.rs |
Adds fingerprint_ignores field to TaskConfig and CommandFingerprint structs |
crates/vite_task/src/fingerprint.rs |
Implements pattern filtering in PostRunFingerprint creation with comprehensive unit tests |
crates/vite_task/src/cache.rs |
Updates cache value creation to pass fingerprint ignore patterns |
crates/vite_task/src/schedule.rs |
Integrates ignore patterns into task execution flow |
packages/cli/snap-tests/fingerprint-ignore-test/ |
Adds comprehensive end-to-end test fixture demonstrating the feature |
crates/vite_task/docs/rfc-cache-fingerprint-ignore-patterns.md |
Complete RFC documentation with implementation details and examples |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
cursor review |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Allow tasks to exclude specific files/directories from cache fingerprint
calculation using glob patterns with gitignore-style negation support.
This enables selective caching for tasks like package installation where
only dependency manifests (package.json) matter for cache validation,
not implementation files. Cache hits occur when ignored files change.
Key features:
Example:
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Note
Adds gitignore-style glob patterns to filter post-run fingerprint inputs, wiring config through execution and caching to control cache invalidation.
PostRunFingerprint::create()filterspath_readsviavite_glob::GlobPatternSet, honoring negation and order offingerprint_ignores.TaskConfig.fingerprint_ignores?: Option<Vec<Str>>.fingerprint_ignoresinCommandFingerprintto affect cache keys.ResolvedTaskConfig::resolve_command()and builtin resolver.CommandCacheValue::create()andschedule.rspassfingerprint_ignoresto post-run fingerprint creation.user_versionto3and adjust migration handling.Written by Cursor Bugbot for commit 73eb4ec. This will update automatically on new commits. Configure here.