Skip to content

feat: warn when func invoke type mismatches declared function type#3162

Merged
knative-prow[bot] merged 3 commits intoknative:mainfrom
intojhanurag:fix/invoke-type-mismatch
Nov 4, 2025
Merged

feat: warn when func invoke type mismatches declared function type#3162
knative-prow[bot] merged 3 commits intoknative:mainfrom
intojhanurag:fix/invoke-type-mismatch

Conversation

@intojhanurag
Copy link
Copy Markdown
Member

@intojhanurag intojhanurag commented Oct 30, 2025

fix: #3083
This PR improves the developer experience when invoking functions with mismatched types.

Previously, if a user invoked a function with func invoke -f cloudevents while the function's func.yaml declared invoke: http, the command failed silently with a confusing error.
Now, the CLI detects this mismatch and prints a clear warning before proceeding.

image

@knative-prow knative-prow Bot added needs-ok-to-test 🤖 Needs an org member to approve testing size/XS 🤖 PR changes 0-9 lines, ignoring generated files. labels Oct 30, 2025
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Oct 30, 2025

Hi @intojhanurag. Thanks for your PR.

I'm waiting for a github.com 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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.12%. Comparing base (83ea554) to head (e4a89cf).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
cmd/invoke.go 0.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3162      +/-   ##
==========================================
+ Coverage   59.37%   60.12%   +0.74%     
==========================================
  Files         134      134              
  Lines       13500    13505       +5     
==========================================
+ Hits         8016     8120     +104     
+ Misses       4540     4412     -128     
- Partials      944      973      +29     
Flag Coverage Δ
e2e-tests 41.66% <0.00%> (+1.44%) ⬆️
integration-tests 54.65% <0.00%> (+1.66%) ⬆️
unit-tests 46.70% <0.00%> (-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.

@intojhanurag
Copy link
Copy Markdown
Member Author

Hey @gauron99, this issue was pending for a while. Since you were assigned , I went ahead and created one to move it forward.

Copy link
Copy Markdown
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
thanks!

@knative-prow knative-prow Bot added lgtm 🤖 PR is ready to be merged. approved 🤖 PR has been approved by an approver from all required OWNERS files. labels Oct 30, 2025
@gauron99
Copy link
Copy Markdown
Contributor

/ok-to-test

@knative-prow knative-prow Bot added ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test 🤖 Needs an org member to approve testing labels Oct 30, 2025
@knative-prow knative-prow Bot added size/S 🤖 PR changes 10-29 lines, ignoring generated files. and removed lgtm 🤖 PR is ready to be merged. size/XS 🤖 PR changes 0-9 lines, ignoring generated files. labels Oct 30, 2025
@knative-prow knative-prow Bot added size/XS 🤖 PR changes 0-9 lines, ignoring generated files. and removed size/S 🤖 PR changes 10-29 lines, ignoring generated files. labels Oct 30, 2025
@intojhanurag
Copy link
Copy Markdown
Member Author

Hey @gauron99 , Can you check , why tests are failing ! If anything is on myside lmk !

@gauron99
Copy link
Copy Markdown
Contributor

gauron99 commented Nov 1, 2025

/retest

@intojhanurag
Copy link
Copy Markdown
Member Author

intojhanurag commented Nov 2, 2025

Hey @gauron99 , Now Is it good to go ?

@gauron99
Copy link
Copy Markdown
Contributor

gauron99 commented Nov 4, 2025

/lgtm
/approve

@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Nov 4, 2025
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Nov 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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 merged commit 3d1ee5e into knative:main Nov 4, 2025
52 of 56 checks passed
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. lgtm 🤖 PR is ready to be merged. ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. size/XS 🤖 PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

func invoke should handle/warn discrepency between function types.

2 participants