-
Notifications
You must be signed in to change notification settings - Fork 0
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 Unification: audit-log, completion, connector, connector-catalog, environment, feedback, ksql, prompt, schema-registry, shell, update, version #931
Conversation
* unify config command * unified config file, IsCloud and IsOnPrem * consolidate ccloud hostnames var * finish config unification and test * add golden files * check for test url second * add back missing return * support all cpdev platforms * trim trailing slash from platform names, and use contains * revert trim trailing slash * fix error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM up to a few small questions!
defaultFormat := `({{color "blue" "ccloud"}}|{{color "red" "%E"}}:{{color "cyan" "%K"}})` | ||
if cliName == "confluent" { | ||
defaultFormat := `({{color "blue" "confluent"}}|{{color "red" "%E"}}:{{color "cyan" "%K"}})` | ||
if cfg.IsOnPrem() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will bash completion instructions work now -- do we need to update those? We used to require e.g. "save ccloud completions to [something like] ~/ccloud-completions.sh" or "save confluent ones to ~/confluent-completions.sh". Is there going to be a filename conflict now? Or, another problem, are we going to only generate one file that (1) only works for the logged-out set of commands or (2) only works for one env but not the other or (3) completes for all commands even when only logged in to cloud or on prem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment scared me- I thought I was going to have to write my own completion script generator or something... Luckily, completion "just works" in the unified CLI!
Our completion instructions (and reminder to re-run the completion command on update) seem to be CLI-agnostic too.
cliCmd := pcmd.NewAuthenticatedStateFlagCommand( | ||
&cobra.Command{ | ||
Use: "cluster", | ||
Short: "Manage Schema Registry cluster.", | ||
Short: "Manage Schema Registry clusters.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this singular for a reason? iirc there was something like, each customer can only have one SR cluster, or only one SR cluster per environment? Can you check on that before we change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... this looked like a typo, since the on-prem description uses the plural and it's grammar isn't right... Maybe this should be:
Short: "Manage Schema Registry clusters.", | |
Short: "Manage a Schema Registry cluster.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know -- that is why I'm asking if you could check whether it's still the case that customers basically only have one SR cluster, or not. E.g. maybe this should be "Manage the Schema Registry cluster for the current environment."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad... after some investigation it looks like each environment has at most one schema registry cluster. I'll change this to "Manage the Schema Registry cluster for the current environment." as suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was too long, so I kept the short description as is and added a long description.
Checklist
[CRUCIAL] Is the change for CP or CCloud functionalities that are already live in prod?
Did you add/update any commands that accept secrets as args/flags?
secretCommandFlags
and/orsecretCommandArgs
in internal/pkg/analytics/analytics.goWhat
Unify several trivial commands. These commands don't have any overlapping flags or subcommands between cloud on on-prem.
cliName
forcfg
in branch statements. We usecfg.IsCloud()
orcfg.IsOnPrem()
to change functionality.pversion.CLIName
in place ofcliName
in strings.Test & Review
Minor changes to golden files.
Open questions / Follow ups
prompt
looks like it works fine forconfluent
. Let's re-enable it onmaster
?