Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reword missing API error to mention client update #1497

Merged
merged 4 commits into from
Nov 1, 2021

Conversation

dsimansk
Copy link
Contributor

Description

Add a mention of client update to common missing API error message. In case of older client with newer backend with removed API, it might confusing why there's a failure.

Changes

  • Reword missing API error to mention client update

Reference

Fixes #

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 29, 2021
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@dsimansk: 1 warning.

In response to this:

Description

Add a mention of client update to common missing API error message. In case of older client with newer backend with removed API, it might confusing why there's a failure.

Changes

  • Reword missing API error to mention client update

Reference

Fixes #

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/test-infra repository.

)

func newInvalidCRD(apiGroup string) *KNError {
func NewInvalidCRD(apiGroup string) *KNError {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported function NewInvalidCRD should have comment or be unexported. More info.

@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 29, 2021
parts := strings.Split(apiGroup, ".")
name := parts[0]
msg := fmt.Sprintf("no Knative %s API found on the backend, please verify the installation", name)
msg := fmt.Sprintf("no Knative %s API found on the backend, please verify the installation or "+
"update the 'kn' client to latest version", firstCharToUpper(name))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be better to call it matching version?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder whether 'no Knative API' found is appropriate as there could be a Knative API available but too new. So maybe rephrase to "no or newer Knative %s API found on the backend, please verify the installation or update this client"

I just would say update, as it's kind of clear that it should be moved to a matching client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rhuss addressed in latest update.

@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #1497 (3b6c668) into main (d8d0ee1) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1497      +/-   ##
==========================================
+ Coverage   79.32%   79.33%   +0.01%     
==========================================
  Files         162      162              
  Lines        8501     8509       +8     
==========================================
+ Hits         6743     6751       +8     
  Misses       1076     1076              
  Partials      682      682              
Impacted Files Coverage Δ
pkg/errors/errors.go 100.00% <100.00%> (ø)
pkg/errors/factory.go 96.87% <100.00%> (ø)
pkg/kn/commands/channel/list_types.go 64.70% <100.00%> (ø)
pkg/kn/commands/container/add.go 94.73% <100.00%> (ø)
pkg/kn/commands/source/list_types.go 56.86% <100.00%> (ø)
pkg/kn/flags/podspec.go 76.92% <100.00%> (+0.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db3bcbc...3b6c668. Read the comment docs.

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Loogs good, one minor suggestion wrt/ wording.

parts := strings.Split(apiGroup, ".")
name := parts[0]
msg := fmt.Sprintf("no Knative %s API found on the backend, please verify the installation", name)
msg := fmt.Sprintf("no Knative %s API found on the backend, please verify the installation or "+
"update the 'kn' client to latest version", firstCharToUpper(name))
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder whether 'no Knative API' found is appropriate as there could be a Knative API available but too new. So maybe rephrase to "no or newer Knative %s API found on the backend, please verify the installation or update this client"

I just would say update, as it's kind of clear that it should be moved to a matching client.

@@ -37,3 +40,11 @@ func newNoRouteToHost(errString string) *KNError {
func newNoKubeConfig(errString string) *KNError {
return NewKNError("no kubeconfig has been provided, please use a valid configuration to connect to the cluster")
}

func firstCharToUpper(s string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Actually, I would use this function, too, before emitting an error message to the console, so that error messages that start with a lowercase letter (golang convention) will be upcased. There should be a single exit-point for errors to do the massaging of the error message to print. But that's of course another story ;-)

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, rhuss

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-robot knative-prow-robot merged commit 5197287 into knative:main Nov 1, 2021
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. 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.

3 participants