-
Notifications
You must be signed in to change notification settings - Fork 71
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
Associate generated commands with command groups #475
Conversation
|
||
// Groups returns an ordered list of command groups. | ||
// The order matches the order used in the Databricks API explorer. | ||
func Groups() []cobra.Group { |
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.
can you propagate it from x-databricks-groups
from spec? otherwise, it'll get out of sync. Please also pull in descriptions from there:
...
"x-databricks-groups" : [ {
"x-databricks-package" : "workspace",
"name" : "Databricks Workspace",
"description" : "Manage workspace-level entities that include notebooks, Git checkouts, and secrets",
"tags" : [ "Git Credentials", "Repos", "Secret", "Workspace" ]
}, {
"x-databricks-package" : "compute",
"name" : "Compute",
"description" : "Use and configure compute for Databricks",
"tags" : [ "Cluster Policies", "Clusters", "Command Execution", "Global Init Scripts", "Instance Pools", "Instance Profiles", "ManagedLibraries", "Policy Families" ]
}, {
...
you'll have to add it to codegen and expose from there https://github.com/databricks/databricks-sdk-go/blob/main/openapi/model.go#L41-L46
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.
Discussed in person. This list of packages is incomplete so we need to hardcode it here. Once it is complete and we expose it in the OpenAPI code in the SDK then we can autogenerate these as well.
## Changes CLI: * Add workspace import-dir command ([#456](#456)). * Annotate generated commands with OpenAPI package name ([#466](#466)). * Associate generated commands with command groups ([#475](#475)). * Disable shell completions for generated commands ([#483](#483)). * Include [DEFAULT] section header when writing ~/.databrickscfg ([#464](#464)). * Pass through proxy related environment variables ([#465](#465)). * Restore flags to original values on test completion ([#470](#470)). * Update configure command ([#482](#482)). Dependencies: * Bump SDK to latest ([#473](#473)).
Changes
With this change related commands show up next to each other in help output.
The ordered list of groups is hard-coded until it can be derived from the specification.
Tests
Manually confirmed that the help output of the root command and the account command list commands by their groups.