[207] feat: selective build cache sharing between worktrees#280
Merged
[207] feat: selective build cache sharing between worktrees#280
Conversation
Add `[worktree]` config section so `parsec start` can reuse build artifacts from the main repo instead of forcing a cold rebuild. [worktree] shared_cache = ["target", "node_modules", ".venv"] cache_strategy = "symlink" # "symlink" | "copy" For each entry, the source `<repo_root>/<entry>` is shared into the new worktree. Missing sources and pre-existing destinations are skipped. Sharing failures are logged but never fail the worktree itself. Default is an empty list, preserving prior behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
[worktree]config section soparsec startcan reuse build artifacts (e.g.target/,node_modules/,.venv/) from the main repo into new worktrees, instead of forcing a cold rebuild.For each entry, the source
<repo_root>/<entry>is shared into the new worktree using the chosen strategy. Missing sources and pre-existing destinations are skipped. Sharing failures are logged but never fail the worktree itself. Default is an empty list, preserving prior behaviour.Closes #207
Changes
src/config/settings.rs—[worktree]section,CacheStrategyenum, deserialization.src/worktree/cache_share.rs(new) — share logic with skip-on-missing / skip-on-exists / traversal-guard / failure-as-warning semantics.src/worktree/manager.rs— invokesshare_cacheaftergit worktree addsucceeds.schema/parsec-config.schema.json— schema entries.README.md,CHANGELOG.md— docs.tests/cli_tests.rs— 6 new integration tests.Verification
cargo build --releasecargo testcargo clippy --all-targets -- -D warningsbool_assert_comparisonlint)cargo fmt -- --checkTest plan
parsec start <ticket>withshared_cache = ["target"]andcache_strategy = "symlink"— verify symlink is created in the new worktree pointing at the parent'starget/cache_strategy = "copy"— verify it's a real dir, not a symlinkshared_cache→ no error, just skipped (warning logged)