Associate generated commands with command groups#475
Merged
Conversation
nfx
requested changes
Jun 15, 2023
|
|
||
| // Groups returns an ordered list of command groups. | ||
| // The order matches the order used in the Databricks API explorer. | ||
| func Groups() []cobra.Group { |
Collaborator
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
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.
nfx
approved these changes
Jun 15, 2023
Merged
pietern
added a commit
that referenced
this pull request
Jun 15, 2023
## 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)).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.