Skip to content

Comments

Add label of scaffolded middleware version to function image#3270

Merged
knative-prow[bot] merged 3 commits intoknative:mainfrom
creydr:add-middleware-version-as-image-label
Dec 5, 2025
Merged

Add label of scaffolded middleware version to function image#3270
knative-prow[bot] merged 3 commits intoknative:mainfrom
creydr:add-middleware-version-as-image-label

Conversation

@creydr
Copy link
Member

@creydr creydr commented Dec 4, 2025

Changes

  • 🎁 Add the middleware version which was used during scaffolding as a label (middleware-version) to the function image
    • as we use scaffolding ATM only for s2i and host builder, this is only supported/added when one of those two builders is used

For example on a Golang build:

$ ~/development/knative-func/func build --registry quay.io/creydr/func-go-hello-world  --push --builder host        
Building function image
   f.linux.amd64
   f.linux.arm64
   f.linux.arm.v7
🙌 Function built: quay.io/creydr/func-go-hello-world/func-go-hello-world:latest

$ skopeo inspect --no-tags --tls-verify=false docker://quay.io/creydr/func-go-hello-world/func-go-hello-world:latest
{
    "Name": "quay.io/creydr/func-go-hello-world/func-go-hello-world",
    ...
    "Labels": {
        "middleware-version": "v0.21.3"
    },
   ...
}

/kind enhancement

TODOs / Follow-ups:

  • we don't have a middlewareVersionDetector for Rust yet
  • Provide this information as part of func describe (maybe only in -o json|yaml)
  • Think about adding information about the middleware package (e.g. func-python, ...) as a label too

Release Note

Provide used middleware version as a function label

@knative-prow knative-prow bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 4, 2025
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 52.10526% with 91 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.56%. Comparing base (859ef43) to head (42bcf8a).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/scaffolding/middleware_version.go 50.00% 65 Missing and 16 partials ⚠️
pkg/oci/builder.go 61.11% 4 Missing and 3 partials ⚠️
pkg/s2i/builder.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3270      +/-   ##
==========================================
+ Coverage   53.87%   54.56%   +0.69%     
==========================================
  Files         166      167       +1     
  Lines       19280    19466     +186     
==========================================
+ Hits        10387    10622     +235     
+ Misses       7888     7784     -104     
- Partials     1005     1060      +55     
Flag Coverage Δ
e2e 39.71% <19.72%> (+1.39%) ⬆️
e2e go 35.70% <19.72%> (?)
e2e node 30.94% <0.00%> (?)
e2e python 35.37% <22.44%> (?)
e2e quarkus 31.09% <0.00%> (?)
e2e rust 30.54% <0.00%> (-0.33%) ⬇️
e2e springboot 30.57% <0.00%> (-0.33%) ⬇️
e2e typescript 31.05% <0.00%> (-0.33%) ⬇️
integration 17.67% <0.00%> (-0.18%) ⬇️
unit macos-14 44.50% <47.61%> (+0.02%) ⬆️
unit macos-latest 44.50% <47.61%> (+0.02%) ⬆️
unit ubuntu-24.04-arm 44.68% <46.84%> (+0.01%) ⬆️
unit ubuntu-latest 45.42% <47.61%> (+0.01%) ⬆️
unit windows-latest 44.52% <47.61%> (+0.02%) ⬆️

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.

@creydr creydr force-pushed the add-middleware-version-as-image-label branch from b37b452 to 56d20b0 Compare December 5, 2025 08:59
@creydr creydr force-pushed the add-middleware-version-as-image-label branch from 56d20b0 to caf33e5 Compare December 5, 2025 09:10
@creydr
Copy link
Member Author

creydr commented Dec 5, 2025

/cc @gauron99

@knative-prow knative-prow bot requested a review from gauron99 December 5, 2025 12:53
@gauron99
Copy link
Contributor

gauron99 commented Dec 5, 2025

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2025
@knative-prow
Copy link

knative-prow bot commented Dec 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 5, 2025
@gauron99
Copy link
Contributor

gauron99 commented Dec 5, 2025

thanks Christoph!

@knative-prow knative-prow bot merged commit c47c428 into knative:main Dec 5, 2025
42 checks passed
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. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants