Repository navigation
Add bundle auto-deploy delete - #7942
atreyadbrx wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Automated review at 3c86b40. Each finding was verified against the code.
No blocking issues found. 3 non-blocking comment(s) below.
This PR adds bundle auto-deploy delete. The command looks up the target's trigger, asks for confirmation unless --auto-approve is passed, and sends the DELETE with a JSON body through a request visitor so the body survives retries. The fake server and the acceptance test are extended to match. The command and the body-on-DELETE handling look correct. What's left is a gap in the retry test and two wording fixes.
Comments outside the changed lines
- [nit]
cmd/bundle/autodeploy/autodeploy.go: Theauto-deploycommand'sLongtext still starts with "Set up and inspect auto-deploy for a bundle target." Now thatdeleteis registered, could it read "Set up, inspect and stop auto-deploy for a bundle target."?
| title "A retried delete sends its body again" | ||
| fault.py --body-contains deployment_mode "DELETE /api/2.0/git-webhooks/trigger" 503 0 1 TEMPORARILY_UNAVAILABLE | ||
| trace $CLI bundle auto-deploy delete -t prod --auto-approve | ||
| print_requests.py //git-webhooks |
There was a problem hiding this comment.
[nice to have] After the retried delete -t prod, the test only prints the requests. It never shows that prod's trigger is gone. If the retry returned a 2xx without the fake deleting anything, this golden would still be produced. The last section runs against dev, which an earlier section already deleted. Can we add trace $CLI bundle auto-deploy list here, or point the "target without a trigger" section at -t prod, so the output shows the state after the retry?
| NextPageToken string `json:"next_page_token,omitempty"` | ||
| } | ||
|
|
||
| // DeleteWebhookTrigger matches the trigger to delete on its target. The service also requires |
There was a problem hiding this comment.
[nit] "Matches the trigger to delete on its target" doesn't say that the match also uses repo_url and bundle_yml_repo_path, which GitWebhooksDelete in the fake checks too. "The trigger config's repo event" is vague: the required field is push_event. How about: "The service deletes the trigger with the same repo_url, bundle_yml_repo_path and deployment_mode. It ignores push_event but rejects a request without it."
|
Commit: Regression test reportSelected 4 changed tests (limit=20, 0 not selected) 4 tests: regression=4 unreleased=0 coverage=0 failing=0
TestAccept/bundle/auto-deploy/create: branch ✅ | main (9d5a537) ❌ | latest (v1.28.0) ❌main (9d5a537): latest (v1.28.0): same output as main (9d5a537) TestAccept/bundle/auto-deploy/delete: branch ✅ | main (9d5a537) ❌ | latest (v1.28.0) ❌main (9d5a537): latest (v1.28.0): same output as main (9d5a537) TestAccept/bundle/auto-deploy/get: branch ✅ | main (9d5a537) ❌ | latest (v1.28.0) ❌main (9d5a537): latest (v1.28.0): same output as main (9d5a537) TestAccept/bundle/auto-deploy/list: branch ✅ | main (9d5a537) ❌ | latest (v1.28.0) ❌main (9d5a537): latest (v1.28.0): same output as main (9d5a537) |
✅ Integration test reportCommit: 4210154
Top 6 slowest tests (at least 2 minutes):
|
`delete` deletes the trigger of the bundle target and its runner job, after a confirmation prompt or with --auto-approve. The target's attempts stay. DeleteWebhookTrigger takes its fields in the body of a DELETE, but the SDK sends a DELETE's fields in the query string. The client sets the body with a request visitor, which the SDK runs on every attempt, so a retry sends the body again. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: atreyadbrx <atreya.misra@databricks.com>
bbaf04d to
eb8b631
Compare
3c86b40 to
4210154
Compare
Changes
deletedeletes the target's trigger and its runner job, after a prompt or with--auto-approve. The service keeps the trigger's attempts but shows them only to workspace admins, so the help saysattemptscan no longer show them.DeleteWebhookTriggeris aDELETEwith a JSON body, but the SDK always sends aDELETE's fields as query parameters. The client sends the body with a request visitor, which the SDK runs on every attempt.Why
Users need a way to stop auto-deploying a target. The service matches the trigger to delete by its target, and it also requires the trigger's
push_event, so the CLI sends both from the trigger it looked up. The visitor also setsGetBody, so the transport can replay the request the way it does for SDK-built bodies.Tests
acceptance/bundle/auto-deploy/deletecovers:--auto-approve(error)--auto-approve, with the recorded request showing the bodylistno longer shows the triggerStacked on #7941.
This pull request and its description were written by Isaac.