Skip to content

Commit eaed3e9

Browse files
authored
Fixed regression in CLI commands to require query parameters as well even with --json flag (#3377)
## Changes The regression was introduced in 0.261.0 CLI version in this PR #3289 We incorrectly did not require query parameters to be passed as positional arguments when --json flag was provided. This resulted in panic in CLI commands CLI commands regenerated with a fixed genkit ## Why Fixes #3373 ## Tests Added regression acceptance test <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
1 parent acb3e08 commit eaed3e9

File tree

8 files changed

+55
-13
lines changed

8 files changed

+55
-13
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Local = true
2+
Cloud = false
3+
4+
[EnvMatrix]
5+
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
>>> errcode [CLI] database update-database-instance test-db --json {"stopped": true}
3+
Error: accepts 2 arg(s), received 1
4+
5+
Usage:
6+
databricks database update-database-instance NAME UPDATE_MASK [flags]
7+
8+
Flags:
9+
--capacity string The sku of the instance.
10+
--enable-readable-secondaries Whether to enable secondaries to serve read-only traffic.
11+
-h, --help help for update-database-instance
12+
--json JSON either inline JSON string or @path/to/file.json with request body (default JSON (0 bytes))
13+
--node-count int The number of nodes in the instance, composed of 1 primary and 0 or more secondaries.
14+
--retention-window-in-days int The retention window for the instance.
15+
--stopped Whether the instance is stopped.
16+
17+
Global Flags:
18+
--debug enable debug logging
19+
-o, --output type output type: text or json (default text)
20+
-p, --profile string ~/.databrickscfg profile
21+
-t, --target string bundle target to use (if applicable)
22+
23+
24+
Exit code: 1
25+
26+
>>> [CLI] database update-database-instance test-db * --json {"stopped": true}
27+
{
28+
"name":"test-db",
29+
"stopped":true
30+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trace errcode $CLI database update-database-instance test-db --json '{"stopped": true}'
2+
3+
trace $CLI database update-database-instance test-db "*" --json '{"stopped": true}'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Local = true
2+
Cloud = false
3+
4+
[[Server]]
5+
Pattern = "PATCH /api/2.0/database/instances/test-db"
6+
Response.Body = '''
7+
{
8+
"name": "test-db",
9+
"stopped": true
10+
}
11+
'''

cmd/workspace/database/database.go

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/workspace/external-lineage/external-lineage.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/workspace/external-metadata/external-metadata.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/workspace/feature-store/feature-store.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)