Skip to content

Conversation

matejvasek
Copy link
Contributor

@matejvasek matejvasek commented Jul 1, 2025

Changes

  • fix: Python local pack build.
    Local pack build was not working because of absent scaffolding. Fix is done by doing scaffolding in docker client (that is passed into constructor of pack client). Basically our custom docker client hijacks tar stream and alters it. It moves content of /workspace/ into /workspace/fn and then puts scaffolding directly into /workspace, the scaffolding then refers handler in ./fn.

So when pack clients tires to upload something like:

/workspace/func.yaml
/workspace/handler.py
/workspace/pyproject.toml

The actual content pushed to container is:

/workspace/fn/func.yaml
/workspace/fn/handler.py
/workspace/fn/pyproject.toml
/workspace/main.py           # scaffolding main
/workspace/pyproject.toml    # scaffolding project toml refering ./fn

The thing is that the Python paketo buildpack (as opposed to Node or Go) does not allow build form sub-directory, the project must be in workspace root.

This is just temporary hacky solution, we should come up with something better in future.

  • fix: sane LISTEN_ADDRESS default for local pack build

/kind bug

fix: Python local buildpack build

@knative-prow knative-prow bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 1, 2025
@knative-prow knative-prow bot requested review from nainaz and vyasgun July 1, 2025 21:44
@matejvasek matejvasek requested review from lkingland and removed request for nainaz and vyasgun July 1, 2025 21:45
@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 Jul 1, 2025
@matejvasek matejvasek requested review from matzew and gauron99 July 1, 2025 21:45
Copy link

codecov bot commented Jul 1, 2025

Codecov Report

Attention: Patch coverage is 3.79747% with 76 lines in your changes missing coverage. Please review.

Project coverage is 61.24%. Comparing base (dfe2109) to head (2b62e93).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
pkg/builders/buildpacks/scaffolding_injector.go 0.00% 73 Missing ⚠️
pkg/builders/buildpacks/builder.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2907      +/-   ##
==========================================
+ Coverage   60.74%   61.24%   +0.49%     
==========================================
  Files         129      130       +1     
  Lines       16330    16406      +76     
==========================================
+ Hits         9920    10048     +128     
+ Misses       5481     5400      -81     
- Partials      929      958      +29     
Flag Coverage Δ
e2e-tests 42.16% <3.79%> (+1.21%) ⬆️
integration-tests 47.78% <3.79%> (+1.57%) ⬆️
unit-tests 47.92% <3.79%> (-0.21%) ⬇️

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.

Signed-off-by: Matej Vašek <mvasek@redhat.com>
Signed-off-by: Matej Vašek <mvasek@redhat.com>
Copy link
Member

@lkingland lkingland left a comment

Choose a reason for hiding this comment

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

/lgtm !
You say hacky, I say brilliant. Thanks Matej!

Copy link

knative-prow bot commented Jul 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland, matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [lkingland,matejvasek]

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 lgtm Indicates that a PR is ready to be merged. label Jul 3, 2025
@knative-prow knative-prow bot merged commit 879233d into knative:main Jul 3, 2025
39 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/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants