Repository navigation
Match .thvignore wildcard directory patterns - #7258
Merged
ChrisJBurns merged 1 commit intoNov 25, 2026
Merged
Conversation
getMatchingPaths returned early for any directory pattern (ending in a slash), so a wildcard directory pattern such as secrets-*/ or *.egg-info/ never reached the filepath.Glob fallback and matched nothing. Glob the trimmed pattern when the literal directory does not exist, keeping only directories to honor the trailing slash's directory-only semantics. Fixes stacklok#7182 Co-Authored-By: Claude Code <[email protected]>
ChrisJBurns
approved these changes
Nov 25, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7258 +/- ##
==========================================
+ Coverage 81.81% 81.87% +0.05%
==========================================
Files 914 914
Lines 92619 92626 +7
==========================================
+ Hits 75773 75833 +60
+ Misses 16841 16788 -53
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
/retest |
3 of 10 tasks
3 of 10 tasks
3 tasks done
1 task
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
getMatchingPathsreturns early for any directory pattern ending in/,only checking it as a literal path via
os.Stat. A wildcard directory patternsuch as
secrets-*/or*.egg-info/therefore never reaches thefilepath.Globfallback and matches nothing, leaving the directories it shouldhide visible in the container.
semantics.
Fixes #7182
Type of change
Test plan
task test) — addedTestGetMatchingPathsWildcardDirectoryPattern(two matching dirs plus a same-prefix file, asserting the file is not matched);
go test ./pkg/ignore/passes for the new test.Does this introduce a user-facing change?
Yes — a
.thvignoredirectory pattern with a wildcard (e.g.secrets-*/,*.egg-info/) now matches its directories and overlays them with emptydirectories, as a non-wildcard directory pattern already did.
Special notes for reviewers
pkg/ignorehas two pre-existing Windows-only failures (TestGetOverlayPaths,TestGetOverlayMounts— path/overlay-artifact related), unrelated to thischange; they also fail on
mainon Windows.🤖 Generated with Claude Code