Skip to content

feat: improved host builder .funcignore support#3624

Open
lkingland wants to merge 1 commit intoknative:mainfrom
lkingland:push-rrssutymzoom
Open

feat: improved host builder .funcignore support#3624
lkingland wants to merge 1 commit intoknative:mainfrom
lkingland:push-rrssutymzoom

Conversation

@lkingland
Copy link
Copy Markdown
Member

The host (OCI) builder walks the function root to build its data layer and applies a fixed defaultIgnored list (.git, .func, .funcignore, .gitignore). Workspace-specific directories outside that list — most commonly .jj/, which contains absolute symlinks to system sockets — trip validatedLinkTarget and make the build fail, with no way for the user to opt out.

Fix is to read .funcignore (which the s2i builder already honors via a .s2iignore symlink) and append its patterns to defaultIgnored. Supports two pattern forms:

/foo/bar root-relative; excludes that path and its descendants
foo base-name; excludes any entry named 'foo' at any depth

The host (OCI) builder walks the function root to build its data layer
and applies a fixed defaultIgnored list (.git, .func, .funcignore,
.gitignore). Workspace-specific directories outside that list — most
commonly .jj/, which contains absolute symlinks to system sockets — trip
validatedLinkTarget and make the build fail outright, with no way for the
user to opt out.

Read .funcignore (which the s2i builder already honors via a
.s2iignore symlink) and append its patterns to defaultIgnored. Supports
two pattern forms:

  /foo/bar  root-relative; excludes that path and its descendants
  foo       base-name; excludes any entry named 'foo' at any depth

No attempt at full gitignore semantics (no globs, no negation); the goal
is parity with the s2i builder and a working escape hatch for users with
workspace metadata the walker can't handle.
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Apr 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@knative-prow knative-prow Bot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Apr 21, 2026
@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos April 21, 2026 10:25
@knative-prow knative-prow Bot added the size/L 🤖 PR changes 100-499 lines, ignoring generated files. label Apr 21, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.34%. Comparing base (50215d6) to head (57da85a).

Files with missing lines Patch % Lines
pkg/oci/builder.go 86.20% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3624      +/-   ##
==========================================
+ Coverage   55.61%   56.34%   +0.73%     
==========================================
  Files         180      180              
  Lines       20549    20572      +23     
==========================================
+ Hits        11429    11592     +163     
+ Misses       7960     7778     -182     
- Partials     1160     1202      +42     
Flag Coverage Δ
e2e 36.25% <55.17%> (+0.03%) ⬆️
e2e go 32.90% <56.00%> (?)
e2e node 28.58% <0.00%> (-0.04%) ⬇️
e2e python 33.27% <56.00%> (?)
e2e quarkus 28.72% <0.00%> (?)
e2e rust 28.15% <0.00%> (?)
e2e springboot 26.61% <0.00%> (-0.02%) ⬇️
e2e typescript 28.69% <0.00%> (-0.04%) ⬇️
e2e-config-ci 18.06% <0.00%> (-0.03%) ⬇️
integration 17.44% <0.00%> (-0.03%) ⬇️
unit macos-14 43.44% <88.00%> (+0.09%) ⬆️
unit macos-latest 43.44% <88.00%> (+0.08%) ⬆️
unit ubuntu-24.04-arm 43.62% <86.20%> (+0.07%) ⬆️
unit ubuntu-latest 44.31% <88.00%> (+0.08%) ⬆️
unit windows-latest 43.42% <68.00%> (+0.03%) ⬆️

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.

@gauron99 gauron99 requested review from gauron99 and removed request for dsimansk and jrangelramos April 21, 2026 15:34
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. size/L 🤖 PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant