Repository navigation
fix(sources): refuse a Windows junction as the Ubuntu source output - #578
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoOct 20, 2026
Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
Pedro Henrique Penna (ppenna) merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix reuses established detection logic and adds targeted regression coverage, with no unresolved findings.
0 open findings
What changed in this PR
Fixes #374 by rejecting Windows junctions before Ubuntu source collection can delete files in their targets.
Changes:
- Shares existing link and junction detection between both collectors.
- Guards Ubuntu output validation and reset operations.
- Adds a Windows regression test checking rejection and target-file preservation.
| File | Description |
|---|---|
| scripts/test_nvx_tools.py | Adds a real Windows junction regression test. |
| scripts/nvx_tools/common.py | Extracts shared link and junction detection. |
| scripts/nvx_tools/collect_ubuntu_sources.py | Rejects junctions during validation and reset. |
| scripts/nvx_tools/collect_alpine_sources.py | Reuses the shared detection helper. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 15, 2026 21:50
6d9dbc1 to
5c99622
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 19, 2026 04:44
1a65510 to
e9beca0
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 19, 2026 11:02
e9beca0 to
3f230fb
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 19, 2026 12:56
3f230fb to
a4fd636
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 19, 2026 13:11
a4fd636 to
dd3b1d2
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 19, 2026 13:31
dd3b1d2 to
ebd7c6b
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 19, 2026 17:47
fbe4260 to
4058c2b
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 19, 2026 17:51
4058c2b to
3b62baf
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 20, 2026 02:49
3b62baf to
a21c1ac
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 20, 2026 03:48
a21c1ac to
f2ff251
Compare
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 20, 2026 04:22
f2ff251 to
40eab7e
Compare
The Ubuntu collector's output guard used Path.is_symlink(), which misses junctions. A junction to another directory was followed, so reset deleted the target's packages/ and wrote new output there. Use the reparse-aware check, now shared with the Alpine collector, on the output and its generated paths, and refuse a linked output in the reset as well. Add a Windows regression test. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Jay (jay23606)
force-pushed
the
fix/ubuntu-source-junction
branch
from
October 20, 2026 11:59
40eab7e to
afbad81
Compare
Pedro Henrique Penna (ppenna)
enabled auto-merge
October 20, 2026 11:59
Pedro Henrique Penna (ppenna)
approved these changes
Oct 20, 2026
Pedro Henrique Penna (ppenna)
merged commit Oct 20, 2026
60ef317
into
microsoft:dev
29 checks passed
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.
Fixes #374
Summary
collect_ubuntu_sourceschecked the output withPath.is_symlink(), which misses Windows junctions. A junction to another directory was followed: the reset removed the target'spackages/and wrote new output there.common.is_link_or_junction(reparse-aware), and_reset_source_outputrefuses a linked output before it deletes anything.Test
packages/keep.txt. It fails ondev(validation accepts the junction) and passes here, and the target file survives.test_nvx_tools: 533 pass, 54 skipped as before. ruff and pyright strict on Linux and Windows are clean.🤖 Generated with Claude Code