fix(validator): validate untracked-but-not-ignored tool directories#704
Merged
Merged
Conversation
collect_tool_dirs (added in apache#692) filters the tools/ scan through git so gitignored artifact directories are not treated as tools, but the tracked-only `git ls-files` filter silently drops a freshly-authored tool directory that has not been `git add`ed yet — exactly when a new tool most needs validating. Switch to `git ls-files --cached --others --exclude-standard` so untracked-but-not-ignored dirs are still checked; gitignored artifact directories remain excluded. Add a regression test.
0e4d094 to
0c1141e
Compare
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
Improves the git filter in
collect_tool_dirs(added in #692), which scopes thetools/scan to git's view so gitignored artifact directories (e.g.__pycache__, build output) aren't mistaken for tools — but uses tracked files only (git ls-files).Why
The tracked-only filter silently drops a freshly-authored tool directory that hasn't been
git added yet — exactly when a new tool most needs validating. Switch to non-ignored files (git ls-files --cached --others --exclude-standard): untracked-but-not-ignored tool dirs are still checked, while gitignored artifact dirs stay excluded.Tests
test_ignored_tool_artifact_directory_skipped— gitignored dir excluded (unchanged, from feat(validator): add branch-name confidentiality check #692)test_untracked_tool_directory_still_checked— new: untracked-but-not-ignored dir still validatedThe same change is bundled (in its original tracked-only form) into #693/#694/#695; those will be rebased to drop the duplicate now that this supersedes it on
main.