fix(sync): compare link destination entries for overlap - #73
Open
srnnkls wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The change is tightly scoped, aligns with the stated link-mode overlap semantics, and is backed by targeted regression tests for the reported repeat-sync and aliasing scenarios.
Pull request overview
This PR fixes cross-target overlap detection for link-mode deployments by preserving the destination’s final path component (the symlink itself) while still canonicalizing its parent directory, preventing false overlap rejections on repeat syncs when different targets link to the same source.
Changes:
- Adjust cross-target overlap normalization for
DeployMode::Linkto normalize only the destination parent, not the final symlink entry. - Thread parsed source metadata into overlap checking to determine deploy mode per binding.
- Add Unix-only regression tests covering repeat sync with disjoint link targets and rejection when targets share a destination via identical or symlink-aliased parents.
File summaries
| File | Description |
|---|---|
src/sync/mod.rs |
Updates overlap detection to avoid resolving the final symlink destination when comparing physical deploy paths for link-mode sources. |
src/sync/tests.rs |
Adds regressions ensuring repeat link syncs don’t spuriously fail and that true destination overlaps (including via symlinked parents) are still rejected. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Keep the final destination entry when checking link-mode overlap: canonicalize its parent, not the final symlink. Distinct targets can link to the same source on repeat sync. Copy-mode physical normalization and ancestor-symlink checks are unchanged.
Regressions cover repeat sync for file and collapsed directory links, equal destinations, and aliased target parents.
Validation on Rust 1.96: full cargo test, strict Clippy, and formatting checks passed. The initial full test build ran out of disk space; clearing the package build cache and rerunning succeeded.
Independent of #72; based directly on main.