feat: apply .funcignore rules in Fingerprint and OCI builder#3789
feat: apply .funcignore rules in Fingerprint and OCI builder#3789gauron99 wants to merge 1 commit into
Conversation
|
Skipping CI for Draft Pull Request. |
f7170fa to
4b47085
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3789 +/- ##
==========================================
- Coverage 57.06% 48.27% -8.79%
==========================================
Files 181 185 +4
Lines 21144 21753 +609
==========================================
- Hits 12065 10502 -1563
- Misses 7855 10313 +2458
+ Partials 1224 938 -286
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Export ParseFuncIgnore and IsIgnored from pkg/functions so both the Fingerprint and OCI builder share the same matching logic. This ensures that files excluded by .funcignore do not affect the fingerprint hash and are consistently excluded from the OCI image. Supported pattern forms: - basename (e.g. "foo") — matches at any depth - glob (e.g. "*.tmp") — filepath.Match semantics - root-relative (e.g. "/docs") — matches only at root - trailing slash (e.g. "build/") — stripped before matching Also fixes the .funcignore boilerplate to document glob syntax instead of the incorrect "regex pattern" reference. Closes knative#3732 Follow-up to knative#3624 review feedback from @gauron99.
4b47085 to
0f26d68
Compare
|
/lgtm |
|
/override codecov/project |
|
@lkingland: Overrode contexts on behalf of lkingland: codecov/project DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauron99, lkingland The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Export ParseFuncIgnore and IsIgnored from pkg/functions so both the Fingerprint and OCI builder share the same matching logic. This ensures that files excluded by .funcignore do not affect the fingerprint hash and are consistently excluded from the OCI image.
Supported pattern forms:
Also fixes the .funcignore boilerplate to document glob syntax instead of the incorrect "regex pattern" reference.
important notes:
hostbuilder +Fingerprint()(state on disk check -- do i need to rebuild?) now use the same logic for parsing the funcignore file;packbuilder respects the.funcignore(the user files) same as above; has extra ignore cases from theDefaultIgnoredlist because of scaffolding.s2ibuilder is the only culprit here -- it usesfilepath.Glob(contrary to the above) and*.tmppattern is NOT recursive so matches only root-level files. for deeper it would need to be*/*.tmp-- others would match*.tmpat any depth. -- to sync this we would have to manually parse the funcignore, expand the unsupported patterns and write to.s2iignoredirectlycloses #3732