Skip to content

Conversation

RayyanSeliya
Copy link
Contributor

Changes

  • 🧹 Update error message shown when func describe is 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.

Copy link

knative-prow bot commented Sep 6, 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.

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 6, 2025
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.72%. Comparing base (231345e) to head (b0f7bf6).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3027      +/-   ##
==========================================
- Coverage   58.60%   57.72%   -0.89%     
==========================================
  Files         133      133              
  Lines       17094    17104      +10     
==========================================
- Hits        10018     9873     -145     
- Misses       6146     6306     +160     
+ Partials      930      925       -5     
Flag Coverage Δ
e2e-tests 40.67% <0.00%> (+1.26%) ⬆️
integration-tests ?
unit-tests 46.32% <100.00%> (+0.03%) ⬆️

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.

@lkingland lkingland added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Sep 8, 2025
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
Thanks for the improved error message.

@knative-prow knative-prow bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 8, 2025
@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 16, 2025
@lkingland
Copy link
Member

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")
	}
}

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.

You'll need to update the test which spot-checks this output I believe.

@knative-prow knative-prow bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 24, 2025
@RayyanSeliya
Copy link
Contributor Author

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 !

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

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

knative-prow bot commented Oct 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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 8, 2025
@lkingland
Copy link
Member

/retest

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cryptic error message from func describe when no function is found in current directory

2 participants