Skip to content

Conversation

@RayyanSeliya
Copy link
Contributor

Changes

  • 🐛 Fix confusing UX when using --platform flag without S2I builder
  • 🧹 Implement 2-layer error system for platform restriction errors
  • 🎁 Add educational guidance about builder capabilities

/kind enhancement

Fixes #3061

Solution:

Implement a 2-layer error system

  • Layer 1 (Technical): Return ErrPlatformNotSupported from validation in pkg/functions/errors.go
  • Layer 2 (CLI): Catch the error in cmd/build.go and cmd/deploy.go and wrap with user-friendly guidance

Release Note

func build and func deploy commands now provide clearer, more educational error messages when the --platform flag is used without the S2I builder, with actionable guidance and builder capability explanations.

…e ahead

Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
@knative-prow
Copy link

knative-prow bot commented Oct 2, 2025

Hi @RayyanSeliya. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 2, 2025
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.39%. Comparing base (05a786b) to head (b01f1cd).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3062      +/-   ##
==========================================
+ Coverage   58.60%   59.39%   +0.79%     
==========================================
  Files         133      133              
  Lines       17094    17120      +26     
==========================================
+ Hits        10018    10169     +151     
+ Misses       6146     5992     -154     
- Partials      930      959      +29     
Flag Coverage Δ
e2e-tests 40.68% <0.00%> (+1.27%) ⬆️
integration-tests 54.11% <100.00%> (+1.75%) ⬆️
unit-tests 46.37% <100.00%> (+0.08%) ⬆️

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: RayyanSeliya <rayyanseliya786@gmail.com>
@RayyanSeliya
Copy link
Contributor Author

ptal @gauron99 @lkingland when you have some moments !

@gauron99 gauron99 requested review from gauron99 and lkingland and removed request for jrangelramos and nainaz October 3, 2025 06:04
Copy link
Contributor

@gauron99 gauron99 left a comment

Choose a reason for hiding this comment

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

added some comments here

cmd/build.go Outdated
Comment on lines 174 to 180
Or remove the --platform flag:
func build --registry <registry>
Builder capabilities:
s2i Supports --platform (Source-to-Image)
pack Does not support --platform (uses default)
host Does not support --platform (uses host architecture)
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I think we dont need this SO explicitly said. You are redundantly saying the same thing here. I would be in favor of removing this whole section and just keeping the previous and following lines

cmd/deploy.go Outdated
Builder capabilities:
s2i Supports --platform (Source-to-Image)
pack Does not support --platform (uses default)
host Does not support --platform (uses host architecture)
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@gauron99
Copy link
Contributor

gauron99 commented Oct 3, 2025

BTW we have fixed the previous unrelated issue so once you make changes (or close and re-open the PR) those tests should be passing, if unrelated

@gauron99 gauron99 self-assigned this Oct 3, 2025
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
@RayyanSeliya RayyanSeliya requested a review from gauron99 October 4, 2025 08:28
Copy link
Contributor

@gauron99 gauron99 left a comment

Choose a reason for hiding this comment

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

/lgtm

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

knative-prow bot commented Oct 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99, RayyanSeliya

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 Oct 5, 2025
@knative-prow knative-prow bot merged commit c1b9a38 into knative:main Oct 5, 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/enhancement lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing UX: func build/deploy platform restriction error lacks actionable guidance

2 participants