Skip to content

Cover wildcard directory patterns in the confinement test table - #7313

Merged
ChrisJBurns merged 1 commit into
stacklok:mainfrom
jstar0:test/ignore-wildcard-dir-confinement
Nov 25, 2026
Merged

ChrisJBurns merged 1 commit into
stacklok:mainfrom
jstar0:test/ignore-wildcard-dir-confinement

Conversation

@jstar0

@jstar0 jstar0 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wildcard directory patterns (secrets-*/, *.egg-info/) now match through filepath.Glob (Match .thvignore wildcard directory patterns #7258), but their interaction with overlay mount confinement in GetOverlayMounts is untested — the invariant that wildcard matches must not reach paths outside the mount.
  • This adds the missing coverage to TestGetOverlayMountsConfinedToMount as table cases (test-only, no production code changes), as originally requested in the Match wildcard .thvignore directory patterns #7195 review.

Fixes #7304

Type of change

  • Other (describe): test-only coverage addition

Test plan

  • Unit tests (task test)

go test -race ./pkg/ignore/... passes. The four new cases pin:

  • a regular file matching the wildcard (s*/) is skipped (directory-only semantics), while the sub directory matches;
  • a symlink matching the pattern resolves to a directory inside the mount → included;
  • a symlink matching the pattern resolves outside the mount → excluded;
  • a pattern reaching beyond the mount (../out*/) matches nothing.

API Compatibility

  • This PR does not break the v1beta1 API, OR the api-break-allowed label is applied and the migration guidance is described above.

Does this introduce a user-facing change?

No

Wildcard directory patterns now match through filepath.Glob, but their
interaction with overlay mount confinement is untested. Extend
TestGetOverlayMountsConfinedToMount with cases pinning that a wildcard
directory pattern skips same-prefix files, follows a symlink whose
target is a directory inside the mount, excludes a symlink whose target
leaves the mount, and matches nothing beyond the mount.

Test-only change.

This fixes stacklok#7304
@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.07%. Comparing base (74e4ad7) to head (7b26960).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7313      +/-   ##
==========================================
+ Coverage   81.96%   82.07%   +0.10%     
==========================================
  Files         922      928       +6     
  Lines       93393    94127     +734     
==========================================
+ Hits        76551    77256     +705     
- Misses      16837    16866      +29     
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisJBurns
ChrisJBurns merged commit b054019 into stacklok:main Nov 25, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing test coverage: wildcard directory patterns vs overlay mount confinement

2 participants