Skip to content

acc: correct Badness for {bundle/deploy/lock,cmd/api/{json,methods,response-text}} - #8196

Merged
denik merged 3 commits into
mainfrom
badness-2026-11-30
Nov 30, 2026
Merged

denik merged 3 commits into
mainfrom
badness-2026-11-30

Conversation

@denik

@denik denik commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Adds missing Badness notes to four acceptance tests (test.toml only; no output changes).

bundle/deploy/lock: deploy syncs over or deletes its own lock

Added in 4404b7f63 (#8059). The test puts state_path inside file_path, and its output records that deploy then uploads a local state/deploy.lock over the lock it holds, or deletes the lock when that file is removed locally, and the release fails:

=== the deploy uploads a local state/deploy.lock over its own lock: releasing fails because the lock is not ours
Files: 1 uploaded, 0 deleted
Error: unlock called when lock is not held: deploy lock acquired by someone-else at [TIMESTAMP] +0000 UTC.

=== the deploy deletes state/deploy.lock, its own lock, removed locally: releasing fails because the lock is gone
Files: 0 uploaded, 1 deleted
Error: unlock called when lock is not held: no active lock on target dir: file does not exist: .../files/state/deploy.lock

The PR that added the test says the output "does not claim that this behavior is desirable". The note says what is wrong and what would be right: sync should not upload or delete the deploy lock, or validate should reject a state_path inside file_path.

cmd/api/{json,methods,response-text}: behaviors #8192 records before changing them

Added in 3d6d09a97 (#8192), whose description lists these as current behaviors "that later PRs will change on purpose". None of the new tests had a note.

cmd/api/json: nested --json values on a GET use Go's %v, a path with a query string gets ? inside a value, and @- is not stdin:

=== --json @file on a GET is serialized into the query string, arrays and objects with Go's %v
    "nested": "map[k:true]",
    "tags": "[x y]"
=== --json @- is not stdin; it is read as a file named '-'
=== --json on a GET whose path already has a query string
>>> [CLI] api get /api/2.0/test/echo?a=1 --json {"b": 2}
    "a": "1?b=2"

cmd/api/methods: all 12 recorded requests send Content-Type: application/json, including the 8 without a body (for example get without --json).

cmd/api/response-text: a valid non-JSON body is reported as an SDK bug:

=== A CSV body is an error
Error: failed to unmarshal response body: invalid character 'a' looking for beginning of value. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue ...

Why

Badness marks expected output that records behavior which should change, so readers and fix work can find it.

Tests

go test ./acceptance -run 'TestAccept/<test>$' passes locally for each of the four tests (testserver; both DMS variants for bundle/deploy/lock). Badness does not affect how the test runs.

Gaps and risks

  • Risk: low. Four test.toml lines; Badness is documentation only.
  • The @- part of the cmd/api/json note is my addition: acceptance: capture more behavior of databricks api before changing it #8192 records it but does not list it among the behaviors to change.
  • Not flagged: cmd/api/flags "An unknown method prints the help and succeeds" (databricks api options exits 0). It looks like general command-group behavior rather than something specific to api.
  • Not flagged, judged out of scope: the doubled error when another deployer holds the lock ("Error: Failed to acquire deployment lock: ..." followed by "Error: deploy lock acquired by ..."). It predates this test and appears in seven tests, none of which has a note.
  • The suggested right behavior (excluding the lock from sync vs. rejecting the layout) is a judgment; reviewers may prefer one.

🤖 AI agent (opus5.5, isaac_claude)

This pull request and its description were written by Isaac.

@github-actions github-actions Bot added DABs DABs related issues test-only-fix PRs that update failing of flaky tests without changing CLI code. labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: dbf24b228 | Workflow run

Selected 4 changed tests (limit=20, 0 not selected)

5 tests: regression=0 unreleased=0 coverage=5 failing=0
test branch main (73673ac) latest (v1.28.0)
TestAccept/bundle/deploy/lock/DMS= ✅ ✅ ✅
TestAccept/bundle/deploy/lock/DMS=true ✅ ✅ ✅
TestAccept/cmd/api/json ✅ ✅ ✅
TestAccept/cmd/api/methods ✅ ✅ ✅
TestAccept/cmd/api/response-text ✅ ✅ ✅

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: dbf24b2

Run: 46488851378

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 91 9 2:49
💚​ aws-windows-latest-4core-16gb 1 91 9 4:08
💚​ azure linux-2core-8gb 1 91 9 3:06
💚​ azure-windows-latest-4core-16gb 1 91 9 3:57
💚​ gcp linux-2core-8gb 1 91 9 2:22
💚​ gcp-windows-latest-4core-16gb 1 91 9 3:30
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:18 aws-windows-latest-4core-16gb TestAccept
3:15 azure-windows-latest-4core-16gb TestAccept
2:45 gcp-windows-latest-4core-16gb TestAccept

denik and others added 2 commits November 30, 2026 12:37
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the badness-2026-11-30 branch from 384dc59 to 4ae7849 Compare November 30, 2026 12:39
@denik denik changed the title acc: correct Badness for bundle/deploy/lock acc: correct Badness for {bundle/deploy/lock,cmd/api/{json,methods,response-text}} Nov 30, 2026
@denik
denik marked this pull request as ready for review November 30, 2026 17:48
@denik
denik requested review from a team as code owners November 30, 2026 17:48

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review at 4ae7849. Each finding was verified against the code.

No blocking issues found. 2 non-blocking comment(s) below.

This PR adds Badness notes to four acceptance tests: bundle/deploy/lock and cmd/api/{json,methods,response-text}. It changes no recorded output. I checked each note against its script and output.txt, and they match what the tests record. I have two wording fixes: the lock note leaves out what happens to the remote lock afterwards, and the json note puts the @- case under "On a GET" even though it happens on any method.

Comment thread acceptance/bundle/deploy/lock/test.toml Resolved
Comment thread acceptance/cmd/api/json/test.toml Resolved
Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik requested a review from andrewnester November 30, 2026 18:51
@denik
denik added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 78efce1 Nov 30, 2026
27 checks passed
@denik
denik deleted the badness-2026-11-30 branch November 30, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues factory-generated test-only-fix PRs that update failing of flaky tests without changing CLI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants