Improve error message when `func describe` is run outside function directory
Changes
- :broom: Update error message shown when
func describeis run outside a function directory. - Made the message more user-friendly and easier for beginners to understand.
- Replaced cryptic technical error with clear, actionable guidance.
- Provides context-specific information about function description workflow.
/kind enhancement
Fixes #3026
Release Note
Improve error message when `func describe` is run outside function directory
to be more beginner-friendly and provide clear guidance on creating functions
before describing them.
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.
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 Report
:x: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 60.19%. Comparing base (b2b8009) to head (27ab161).
:warning: Report is 9 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| cmd/describe.go | 94.44% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #3027 +/- ##
==========================================
+ Coverage 59.39% 60.19% +0.79%
==========================================
Files 134 134
Lines 13500 13517 +17
==========================================
+ Hits 8018 8136 +118
+ Misses 4539 4409 -130
- Partials 943 972 +29
| Flag | Coverage Δ | |
|---|---|---|
| e2e-tests | 41.63% <0.00%> (+1.40%) |
:arrow_up: |
| integration-tests | 54.74% <94.44%> (+1.72%) |
:arrow_up: |
| unit-tests | 46.77% <94.44%> (+0.05%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
This one is failing on TestDescribe_Default in cmd/describe_test.go which checks:
// TestDescribe_Default ensures that running describe when there is no
// function in the given directory fails correctly.
func TestDescribe_Default(t *testing.T) {
_ = FromTempDirectory(t)
describer := mock.NewDescriber()
cmd := NewDescribeCmd(NewTestClient(fn.WithDescriber(describer)))
cmd.SetArgs([]string{})
err := cmd.Execute()
if err == nil {
t.Fatal("describing a nonexistent function should error")
}
if !strings.Contains(err.Error(), "function not found at this path and no name provided") {
t.Fatalf("Unexpected error text returned: %v", err)
}
if describer.DescribeInvoked {
t.Fatal("Describer incorrectly invoked")
}
}
hey @lkingland dont know why the test are failing i think its an infrastructure /network issue i have updated the test to check our new description !
/retest
/retest
Hey @gauron99 it's ready now !
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: gauron99, lkingland, RayyanSeliya
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [gauron99,lkingland]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment