Skip to content

feat: apply .funcignore rules in Fingerprint and OCI builder#3789

Open
gauron99 wants to merge 1 commit into
knative:mainfrom
gauron99:push-sqsrspzzoqmp
Open

feat: apply .funcignore rules in Fingerprint and OCI builder#3789
gauron99 wants to merge 1 commit into
knative:mainfrom
gauron99:push-sqsrspzzoqmp

Conversation

@gauron99
Copy link
Copy Markdown
Contributor

@gauron99 gauron99 commented May 19, 2026

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.

important notes:

host builder + Fingerprint() (state on disk check -- do i need to rebuild?) now use the same logic for parsing the funcignore file;

pack builder respects the .funcignore (the user files) same as above; has extra ignore cases from the DefaultIgnored list because of scaffolding.

s2i builder is the only culprit here -- it uses filepath.Glob (contrary to the above) and *.tmp pattern is NOT recursive so matches only root-level files. for deeper it would need to be */*.tmp -- others would match *.tmp at any depth. -- to sync this we would have to manually parse the funcignore, expand the unsupported patterns and write to .s2iignore directly

closes #3732

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 19, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow Bot added do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. approved 🤖 PR has been approved by an approver from all required OWNERS files. labels May 19, 2026
@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 19, 2026 11:18
@knative-prow knative-prow Bot added the size/XL 🤖 PR changes 500-999 lines, ignoring generated files. label May 19, 2026
@gauron99 gauron99 force-pushed the push-sqsrspzzoqmp branch from f7170fa to 4b47085 Compare May 19, 2026 11:51
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 81.96721% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.27%. Comparing base (c0d60c2) to head (0f26d68).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
pkg/functions/client.go 81.48% 7 Missing and 3 partials ⚠️
pkg/oci/builder.go 83.33% 0 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (c0d60c2) and HEAD (0f26d68). Click for more details.

HEAD has 10 uploads less than BASE
Flag BASE (c0d60c2) HEAD (0f26d68)
e2e 3 2
e2e-config-ci 1 0
e2e springboot 1 0
e2e node 1 0
e2e typescript 1 0
e2e python 1 0
e2e quarkus 1 0
e2e go 1 0
e2e rust 1 0
integration 1 0
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     
Flag Coverage Δ
e2e 22.80% <60.65%> (-13.12%) ⬇️
e2e go ?
e2e node ?
e2e python ?
e2e quarkus ?
e2e rust ?
e2e springboot ?
e2e typescript ?
e2e-config-ci ?
integration ?
unit macos-14 44.96% <86.00%> (-0.09%) ⬇️
unit macos-latest 44.96% <86.00%> (-0.09%) ⬇️
unit ubuntu-24.04-arm 45.17% <81.96%> (-0.15%) ⬇️
unit ubuntu-latest 45.89% <86.00%> (-0.12%) ⬇️
unit windows-latest 45.04% <86.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.
@gauron99 gauron99 force-pushed the push-sqsrspzzoqmp branch from 4b47085 to 0f26d68 Compare May 19, 2026 14:45
@gauron99 gauron99 marked this pull request as ready for review May 19, 2026 14:48
@knative-prow knative-prow Bot removed the do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. label May 19, 2026
@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 19, 2026 14:48
@gauron99 gauron99 requested review from lkingland and matejvasek and removed request for dsimansk and jrangelramos May 19, 2026 15:19
@lkingland
Copy link
Copy Markdown
Member

/lgtm

@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label May 20, 2026
@lkingland
Copy link
Copy Markdown
Member

/override codecov/project

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 20, 2026

@lkingland: Overrode contexts on behalf of lkingland: codecov/project

Details

In response to this:

/override codecov/project

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.

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 20, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. lgtm 🤖 PR is ready to be merged. size/XL 🤖 PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

functions: apply .funcignore rules in Fingerprint()

2 participants