-
Notifications
You must be signed in to change notification settings - Fork 68
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
Generate acceptance tests for help output for all CLI commands #2260
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
{ | ||
"formatter": "go run golang.org/x/tools/cmd/goimports@latest -w $FILENAMES && go fmt ./...", | ||
"formatter": "go run golang.org/x/tools/cmd/goimports@latest -w cmd && go fmt ./...", | ||
"services": { | ||
".codegen/service.go.tmpl": "cmd/{{if .IsAccounts}}account{{else}}workspace{{end}}/{{(.TrimPrefix \"account\").KebabName}}/{{(.TrimPrefix \"account\").KebabName}}.go" | ||
".codegen/service.go.tmpl": "cmd/{{if .IsAccounts}}account{{else}}workspace{{end}}/{{(.TrimPrefix \"account\").KebabName}}/{{(.TrimPrefix \"account\").KebabName}}.go", | ||
".codegen/cmd_script.tmpl": "acceptance/help/cmd/{{if .IsAccounts}}account{{else}}workspace{{end}}/{{(.TrimPrefix \"account\").KebabName}}/{{(.TrimPrefix \"account\").KebabName}}/script" | ||
}, | ||
"batch": { | ||
".codegen/cmds-workspace.go.tmpl": "cmd/workspace/cmd.go", | ||
".codegen/cmds-account.go.tmpl": "cmd/account/cmd.go" | ||
}, | ||
"toolchain": { | ||
"required": ["go"], | ||
"required": [ | ||
"go" | ||
], | ||
"post_generate": [ | ||
"go test ./acceptance -v -update -run 'TestAccept/help/cmd' ", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespace + quotes are not needed. |
||
"go test -timeout 240s -run TestConsistentDatabricksSdkVersion github.com/databricks/cli/internal/build", | ||
"make schema", | ||
"echo 'bundle/internal/tf/schema/\\*.go linguist-generated=true' >> ./.gitattributes", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. | ||
{{- $isAccount := .IsAccounts }} | ||
{{- $cmdGrp := (.TrimPrefix "account").KebabName }} | ||
{{- range .Methods}} | ||
trace $CLI {{if $isAccount }}account {{end}}{{$cmdGrp}} {{.KebabName}} --help | ||
{{- end}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
>>> $CLI account access-control get-assignable-roles-for-resource --help | ||
Get assignable roles for a resource. | ||
|
||
Gets all the roles that can be granted on an account level resource. A role is | ||
grantable if the rule set on the resource can contain an access rule of the | ||
role. | ||
|
||
Arguments: | ||
RESOURCE: The resource name for which assignable roles will be listed. | ||
|
||
Usage: | ||
databricks account access-control get-assignable-roles-for-resource RESOURCE [flags] | ||
|
||
Flags: | ||
-h, --help help for get-assignable-roles-for-resource | ||
|
||
Global Flags: | ||
--debug enable debug logging | ||
-o, --output type output type: text or json (default text) | ||
-p, --profile string ~/.databrickscfg profile | ||
-t, --target string bundle target to use (if applicable) | ||
|
||
>>> $CLI account access-control get-rule-set --help | ||
Get a rule set. | ||
|
||
Get a rule set by its name. A rule set is always attached to a resource and | ||
contains a list of access rules on the said resource. Currently only a default | ||
rule set for each resource is supported. | ||
|
||
Arguments: | ||
NAME: The ruleset name associated with the request. | ||
ETAG: Etag used for versioning. The response is at least as fresh as the eTag | ||
provided. Etag is used for optimistic concurrency control as a way to help | ||
prevent simultaneous updates of a rule set from overwriting each other. It | ||
is strongly suggested that systems make use of the etag in the read -> | ||
modify -> write pattern to perform rule set updates in order to avoid race | ||
conditions that is get an etag from a GET rule set request, and pass it | ||
with the PUT update request to identify the rule set version you are | ||
updating. | ||
|
||
Usage: | ||
databricks account access-control get-rule-set NAME ETAG [flags] | ||
|
||
Flags: | ||
-h, --help help for get-rule-set | ||
|
||
Global Flags: | ||
--debug enable debug logging | ||
-o, --output type output type: text or json (default text) | ||
-p, --profile string ~/.databrickscfg profile | ||
-t, --target string bundle target to use (if applicable) | ||
|
||
>>> $CLI account access-control update-rule-set --help | ||
Update a rule set. | ||
|
||
Replace the rules of a rule set. First, use get to read the current version of | ||
the rule set before modifying it. This pattern helps prevent conflicts between | ||
concurrent updates. | ||
|
||
Usage: | ||
databricks account access-control update-rule-set [flags] | ||
|
||
Flags: | ||
-h, --help help for update-rule-set | ||
--json JSON either inline JSON string or @path/to/file.json with request body (default JSON (0 bytes)) | ||
|
||
Global Flags: | ||
--debug enable debug logging | ||
-o, --output type output type: text or json (default text) | ||
-p, --profile string ~/.databrickscfg profile | ||
-t, --target string bundle target to use (if applicable) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
>>> $CLI account billable-usage download --help | ||
Return billable usage logs. | ||
|
||
Returns billable usage logs in CSV format for the specified account and date | ||
range. For the data schema, see [CSV file schema]. Note that this method might | ||
take multiple minutes to complete. | ||
|
||
**Warning**: Depending on the queried date range, the number of workspaces in | ||
the account, the size of the response and the internet speed of the caller, | ||
this API may hit a timeout after a few minutes. If you experience this, try to | ||
mitigate by calling the API with narrower date ranges. | ||
|
||
[CSV file schema]: https://docs.databricks.com/administration-guide/account-settings/usage-analysis.html#schema | ||
|
||
Arguments: | ||
START_MONTH: Format: YYYY-MM. First month to return billable usage logs for. This | ||
field is required. | ||
END_MONTH: Format: YYYY-MM. Last month to return billable usage logs for. This | ||
field is required. | ||
|
||
Usage: | ||
databricks account billable-usage download START_MONTH END_MONTH [flags] | ||
|
||
Flags: | ||
-h, --help help for download | ||
--personal-data Specify whether to include personally identifiable information in the billable usage logs, for example the email addresses of cluster creators. | ||
|
||
Global Flags: | ||
--debug enable debug logging | ||
-o, --output type output type: text or json (default text) | ||
-p, --profile string ~/.databrickscfg profile | ||
-t, --target string bundle target to use (if applicable) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 repeats the
KebabName
twice. Intentional or can we use 1x?