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

cli: Output message on success writing config entry #7806

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

crhino
Copy link
Contributor

@crhino crhino commented May 7, 2020

This helps users feel like an action occurred, rather than no output leading them to wonder if it worked or not.

This also converts the formatting output of config entries from "proxy-defaults" / "global" to proxy-defaults/global as a slightly more readable form.

@crhino crhino requested a review from a team May 7, 2020 15:49
Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

I went hunting through the cli to see if there was prior art here.

consul services register service.hcl
Registered service: service-name
consul intention create foo bar
Created: foo => bar (allow)

consul intention match -source foo
foo => bar (allow)

There's not much but it looks like we do have a couple patterns:

  1. We use <action>: <resource identifier>, e.g. Config entry written: <identifier>
  2. We don't use "successfully"
  3. We don't use quotes in our identifier, e.g. <name>/<kind>
  4. Our docs use Configuration but the cli help uses just config so I think we're okay using config.

So to follow that pattern I think something more like:

Config entry written: global (proxy-defaults)

Also, can we add output to the delete as well?

@crhino
Copy link
Contributor Author

crhino commented May 7, 2020

👍 Good call out, I will take some time and review the CLI output of all our commands to make sure we are consistent here.

Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

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

LGTM

@hanshasselberg
Copy link
Member

Maybe add backport 1.8.x label?

This provides a user with a better experience, knowing that the command
worked appropriately. The output of the write/delete CLI commands are
not going to be used in a bash script, in fact previously a success
provided no ouput, so we do not have to worry about spurious text being
injected into bash pipelines.
@crhino
Copy link
Contributor Author

crhino commented Jun 29, 2020

Finally made a few changes to the output based on previous comments, re-requesting review.

Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

New format looks good!

@crhino crhino merged commit ea683eb into master Jun 29, 2020
@crhino crhino deleted the cli/config-write-output branch June 29, 2020 20:47
@hashicorp-ci
Copy link
Contributor

🍒✅ Cherry pick of commit ea683eb onto release/1.8.x succeeded!

hashicorp-ci pushed a commit that referenced this pull request Jun 29, 2020
This provides a user with a better experience, knowing that the command
worked appropriately. The output of the write/delete CLI commands are
not going to be used in a bash script, in fact previously a success
provided no ouput, so we do not have to worry about spurious text being
injected into bash pipelines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants