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

feat!: change describe command to info #474

Merged

Conversation

lance
Copy link
Member

@lance lance commented Aug 11, 2021

Changes

  • 🧹 Change the describe command to info

/kind enhancement

Fixes: #337
The describe command conflicts sematically with kubectl describe.

Release Note

The `describe` command has been renamed to `info` to reduce conflict with the `kubectl` and `kn` commands of the same name. The behavior is otherwise identical.

Docs

Documentation changes are included in this PR.

The describe command conflicts sematically with kubectl describe.
This commit changes the command name to `info`.

Fixes: knative#337

Signed-off-by: Lance Ball <lball@redhat.com>
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Aug 11, 2021
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance

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 added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 11, 2021
@@ -31,7 +31,7 @@ func NewDescriber(namespaceOverride string) (describer *Describer, err error) {
// restricts to label-syntax, which is thus escaped. Therefore as a knative (kube) implementation
// detal proper full names have to be escaped on the way in and unescaped on the way out. ex:
// www.example-site.com -> www-example--site-com
func (d *Describer) Describe(ctx context.Context, name string) (description fn.Description, err error) {
func (d *Describer) Describe(ctx context.Context, name string) (description fn.Info, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

func (d *Describer) Describe(ctx context.Context, name string) (description fn.Info, err error) {

Shouldn't this be changed as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that and decided not to change it for a couple of reasons. I meant to put this in the PR description, but just forgot.

  • Infoer is a terrible name! 🤣
  • The Describer in the knative package is responsible for the verb "describe" which the client uses to surface the noun "info" and they don't need to necessarily evolve 1:1 😎

But now by the light of morning, those reasons seem pretty weak. Do you have any suggestions for naming? I don't particularly like this.

type Infoer struct {
  // ...
}

func (i *Infoer) Info(ctx context.Context, name string) (description fn.Info, err error)

What do you think of this?

type Info struct {
  // ...
}

func (i *Info) Fetch(ctx context.Context, name string) (description fn.Info, err error)

Copy link
Member

Choose a reason for hiding this comment

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

Hm, seems like a tradeoff either way. I agree that Describer seems a lot nicer than Infoer, and that it's fine if the CLI and client library aren't exactly mapped, if it means the client library is closer to what we think is "correct". I could go either way on it, but leaving it Describe fits for me: run the info command to get a description.

Copy link
Member

@lkingland lkingland Aug 12, 2021

Choose a reason for hiding this comment

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

Hm, seems like a tradeoff either way. I agree that Describer seems a lot nicer than Infoer, and that it's fine if the CLI and client library aren't exactly mapped, if it means the client library is closer to what we think is "correct". I could go either way on it, but leaving it Describer making a Description still fits I think: "run the info command to get more information, including a description from the describer" seems like a well-formed sentence, which is a good litmus test. Not to mention, there is the possibility that info may display more than just the description from the describer in the future...

Copy link
Member Author

Choose a reason for hiding this comment

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

Not to mention, there is the possibility that info may display more than just the description from the describer in the future...

Thanks for mentioning this. I avoided saying it because it's easy to fall down the flexibility hole.

@lkingland
Copy link
Member

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2021
@knative-prow-robot knative-prow-robot merged commit 10a0757 into knative:main Aug 16, 2021
@github-actions github-actions bot mentioned this pull request Aug 16, 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. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change 'func describe' command name
4 participants