Skip to content

Conversation

@gauron99
Copy link
Contributor

@gauron99 gauron99 commented Nov 22, 2025

Scaffolding unification

  • Introducing new client.Scaffold step in build,deploy,run commands
  • Extract scaffolding logic into dedicated per-builder components (Scaffolder structs)
    New scaffolders
- `pkg/buildpacks/scaffolder.go`
- `pkg/oci/scaffolder.go`
- `pkg/s2i/scaffolder.go`
  • Change default pack builders
- var DefaultBaseBuilder = "ghcr.io/knative/builder-jammy-base:latest"
- var DefaultTinyBuilder = "ghcr.io/knative/builder-jammy-tiny:latest"
+ var DefaultBaseBuilder = "ghcr.io/knative/builder-jammy-base:v2"
+ var DefaultTinyBuilder = "ghcr.io/knative/builder-jammy-tiny:v2"

HOST builder changes

  • Removing the "build history" - build hashes & pid links
  • Removing the concurrency building protection (It will be part of a followup PR for separation)

scaffolding file parsing

  • Replace regex-based go.mod parsing in scaffolding with golang.org/x/mod/modfile
  • Dynamically sync Go version from user's function to scaffolding go.mod

// issue: remove custom buildpack for go, unify scaffolding
/fixes #3005

// issue: double go bin download for pack
/fixes #3178

Follow-ups

  • build concurrency protection (locking)
  • python buildpack fix (remove injector)
  • python remote deployment fix, if still issue

@knative-prow
Copy link

knative-prow bot commented Nov 22, 2025

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 the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 22, 2025
@knative-prow
Copy link

knative-prow bot commented Nov 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 22, 2025
@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

❌ Patch coverage is 48.57143% with 144 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.95%. Comparing base (c9b015e) to head (ab44dea).

Files with missing lines Patch % Lines
pkg/scaffolding/scaffold.go 31.66% 27 Missing and 14 partials ⚠️
pkg/deployer/testing/integration_test_helper.go 0.00% 30 Missing ⚠️
pkg/s2i/scaffolder.go 48.57% 13 Missing and 5 partials ⚠️
pkg/buildpacks/scaffolder.go 65.21% 7 Missing and 1 partial ⚠️
pkg/oci/scaffolder.go 61.90% 6 Missing and 2 partials ⚠️
cmd/deploy.go 70.83% 4 Missing and 3 partials ⚠️
pkg/functions/client.go 62.50% 4 Missing and 2 partials ⚠️
pkg/describer/testing/integration_test_helper.go 0.00% 5 Missing ⚠️
pkg/lister/testing/integration_test_helper.go 0.00% 5 Missing ⚠️
pkg/remover/testing/integration_test_helper.go 0.00% 5 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3237      +/-   ##
==========================================
- Coverage   55.10%   54.95%   -0.16%     
==========================================
  Files         170      173       +3     
  Lines       19963    20005      +42     
==========================================
- Hits        11001    10993       -8     
- Misses       7883     7930      +47     
- Partials     1079     1082       +3     
Flag Coverage Δ
e2e 39.39% <51.12%> (+0.01%) ⬆️
e2e go 35.48% <52.80%> (+0.06%) ⬆️
e2e node 31.13% <22.47%> (+0.17%) ⬆️
e2e python 34.97% <35.95%> (-0.10%) ⬇️
e2e quarkus 31.28% <22.47%> (+0.17%) ⬆️
e2e rust 30.67% <16.29%> (+0.09%) ⬆️
e2e springboot 30.72% <16.29%> (+0.17%) ⬆️
e2e typescript 31.25% <22.47%> (+0.19%) ⬆️
integration 17.46% <4.76%> (+0.04%) ⬆️
unit macos-14 44.78% <37.61%> (-0.33%) ⬇️
unit macos-latest 44.78% <37.61%> (-0.33%) ⬇️
unit ubuntu-24.04-arm 44.89% <36.07%> (-0.34%) ⬇️
unit ubuntu-latest 45.68% <37.61%> (-0.33%) ⬇️
unit windows-latest 44.80% <37.61%> (-0.33%) ⬇️

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 force-pushed the push-ywknoytomzzx branch 2 times, most recently from 73ce011 to f310b09 Compare November 22, 2025 15:36
@gauron99 gauron99 changed the title duplicated [DNM][WIP] duplicated func-util test Nov 22, 2025
@gauron99 gauron99 force-pushed the push-ywknoytomzzx branch 4 times, most recently from 5295030 to 8161b74 Compare November 24, 2025 07:04
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 24, 2025
@gauron99 gauron99 force-pushed the push-ywknoytomzzx branch 2 times, most recently from e6a1586 to cc15a7d Compare November 24, 2025 13:13
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 24, 2025
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 6, 2025
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 17, 2025
@knative-prow knative-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 17, 2025
@knative-prow knative-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 30, 2025
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 4, 2026
@gauron99 gauron99 force-pushed the push-ywknoytomzzx branch 2 times, most recently from 5a7d5ea to 5d2557d Compare January 9, 2026 20:56
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2026
@gauron99 gauron99 force-pushed the push-ywknoytomzzx branch 2 times, most recently from 6d03f1d to 2e3fa69 Compare January 14, 2026 21:33
@gauron99 gauron99 changed the title [DNM][WIP] scaffolding [DNM][WIP] refactor: Extract scaffolding into dedicated components and sync Go version Jan 14, 2026
@gauron99 gauron99 changed the title [DNM][WIP] refactor: Extract scaffolding into dedicated components and sync Go version [DNM][WIP] feat: Extract scaffolding into dedicated components and sync Go version Jan 14, 2026
@gauron99 gauron99 changed the title [DNM][WIP] feat: Extract scaffolding into dedicated components and sync Go version [DNM][WIP] refactor: Extract scaffolding into dedicated components and sync Go version Jan 14, 2026
@gauron99 gauron99 changed the title [DNM][WIP] refactor: Extract scaffolding into dedicated components and sync Go version [DNM][WIP] refactor: Extract scaffolding as per-builder and sync Go version Jan 14, 2026
var DefaultBaseBuilder = "ghcr.io/knative/builder-jammy-base:latest"
var DefaultTinyBuilder = "ghcr.io/knative/builder-jammy-tiny:latest"
var DefaultBaseBuilder = "ghcr.io/knative/builder-jammy-base:v2"
var DefaultTinyBuilder = "ghcr.io/knative/builder-jammy-tiny:v2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing this default switch. The v2 no longer contains the good&old custom buildpack for go.

// set scaffolding path to buildpacks builder
if f.Runtime == "go" {
opts.Env["BP_GO_WORKDIR"] = ".func/build"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the magic for buildpacks now as part of buildpacks package (replaces custom buildpack)

}

// TestBuilder_Concurrency
func TestBuilder_Concurrency(t *testing.T) {
Copy link
Contributor Author

@gauron99 gauron99 Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build concurrency functionality etc is part of followup PR

// add BP_GO_WORKDIR for go-build buildpack
if f.Runtime == "go" {
buildEnvs = append(buildEnvs, "BP_GO_WORKDIR=.func/build")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again; magic for on-cluster bp build too

@gauron99 gauron99 changed the title [DNM][WIP] refactor: Extract scaffolding as per-builder and sync Go version refactor: Extract scaffolding as per-builder and sync Go version Jan 15, 2026
@gauron99 gauron99 changed the title refactor: Extract scaffolding as per-builder and sync Go version refactor: Extract scaffolding as per-builder, new buildpacks default builder and sync Go version Jan 15, 2026
@gauron99 gauron99 requested a review from lkingland January 15, 2026 00:49
@gauron99 gauron99 marked this pull request as ready for review January 15, 2026 00:51
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 15, 2026
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2026
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go] func build installs go twice? Retire our custom go buildpacks + scaffolding

2 participants