fix(discover): report a symlink skip through the ignored-files taxonomy - #1822
Open
AmirF194 wants to merge 1 commit into
Open
fix(discover): report a symlink skip through the ignored-files taxonomy#1822AmirF194 wants to merge 1 commit into
AmirF194 wants to merge 1 commit into
Conversation
walk_dir_process_entry dropped a safe_stat() symlink/reparse-point rejection with a bare return, unlike its two sibling skip paths (directory exclusion, file skip_reason), which both call file_list_add_ignored. A file reachable only through a symlinked directory vanished from the index with no trace in not_indexed, skipped, or parse_partial, so a symlink-heavy subtree looked identical to a complete index. safe_stat now reports whether a rejection was specifically the symlink/reparse-point check via an out-param, and walk_dir_process_entry records it as an ignored file with reason "symlink" when so. The count_only path and the traversal-following decision itself are untouched. Fixes DeusData#1815 Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
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.
What does this PR do?
walk_dir_process_entryrejects a directory entry whensafe_stat()skips it as a symlink or reparse point, but that branch returns with a barereturn;and never callsfile_list_add_ignored, unlike its two sibling skip paths a few lines below (directory exclusion, fileskip_reason). A file reachable only through a symlinked directory disappears from the index with no trace innot_indexed/skipped/parse_partial, so a symlink-heavy subtree looks identical to a complete index (#1815).This is the narrower, buildable half of #1815 that DeusData already called out separately from the traversal-contract question (whether symlinks should be followed), which they said needs more design time. This PR does not touch that decision.
safe_stat()now takes anis_symlinkout-param reporting whether a rejection was specifically the symlink/reparse-point check (as opposed to some other stat failure).walk_dir_process_entryrecords the entry viafile_list_add_ignored(out, rel_path, "symlink")when so. Thecount_onlypath is untouched.Rebase risk, not a conflict of claims: open PR #1803 also changes
safe_stat()'s signature (adds its ownis_linkout-param) to fix a different bug,count_onlyaborting discovery entirely on any symlink. If #1803 merges first, this branch will need a rebase to reuse its out-param instead of adding a second one; read its full diff before assuming a collision, it does not add any ignored-file reporting itself.Verification
discover_symlink_skip_is_reported(tests/test_discover.c) fails on unmodifiedmain(ignored_total == 0, expected 1) and passes on this branch; ran both in a cleanubuntu:24.04container viascripts/test.sh --suites discover, 114/114 passed, no leaks under the default ASan/LSan build.scripts/test.sh(all suites) passes in the same container, with one exception:tests/test_parallel_harness_contract.sh'sstubborn_treecase fails withoutdocker run --init; confirmed it passes identically with--initon a fresh container, so it is a container-PID-1 artifact of my verification setup, not related to this diff (it does not touch anything undersrc/discover/).scripts/lint.sh --ciwith the exact versions CI pins (cppcheck 2.20.0 built from source,clang-format-20): both changed files are clean. The overall script still exits non-zero because of pre-existingclang-format-20drift insrc/mcp/mcp.candsrc/pipeline/pipeline_incremental.c, both untouched by this diff, confirmed present on unmodifiedmain.safe_stat()(also updated, same shape) has no Windows environment available here; andlint-mem's path-sensitive clang-tidy analyzer (CI job, 60-minute budget, whole-repo) was not run locally.Fixes #1815