From daeddd82d5e7d398d94306dbbf92d0b026d1593b Mon Sep 17 00:00:00 2001 From: atreyadbrx Date: Tue, 24 Nov 2026 17:16:53 +0000 Subject: [PATCH] Add bundle auto-deploy attempts `attempts` lists the auto-deploy attempts of the bundle target, newest first, or shows one attempt when given its ID. It finds the target's trigger, then calls ListAutoDeployAttempts or GetAutoDeployAttempt. The fake queues an attempt when a trigger is created, as the service deploys the branch's head right away. It has no runner, so the test stubs a failed attempt to cover how one renders. Co-authored-by: Isaac Signed-off-by: atreyadbrx --- .../auto-deploy/attempts/databricks.yml | 9 ++ .../bundle/auto-deploy/attempts/out.test.toml | 2 + .../bundle/auto-deploy/attempts/output.txt | 47 +++++++ acceptance/bundle/auto-deploy/attempts/script | 22 ++++ .../bundle/auto-deploy/attempts/test.toml | 21 +++ cmd/bundle/autodeploy/attempts.go | 71 ++++++++++ cmd/bundle/autodeploy/autodeploy.go | 1 + libs/gitwebhooks/api.go | 33 +++++ libs/gitwebhooks/model.go | 55 ++++++++ libs/testserver/gitwebhooks.go | 121 ++++++++++++++---- libs/testserver/handlers.go | 6 + 11 files changed, 363 insertions(+), 25 deletions(-) create mode 100644 acceptance/bundle/auto-deploy/attempts/databricks.yml create mode 100644 acceptance/bundle/auto-deploy/attempts/out.test.toml create mode 100644 acceptance/bundle/auto-deploy/attempts/output.txt create mode 100644 acceptance/bundle/auto-deploy/attempts/script create mode 100644 acceptance/bundle/auto-deploy/attempts/test.toml create mode 100644 cmd/bundle/autodeploy/attempts.go diff --git a/acceptance/bundle/auto-deploy/attempts/databricks.yml b/acceptance/bundle/auto-deploy/attempts/databricks.yml new file mode 100644 index 00000000000..caa4824bc21 --- /dev/null +++ b/acceptance/bundle/auto-deploy/attempts/databricks.yml @@ -0,0 +1,9 @@ +bundle: + name: auto-deploy + +targets: + dev: + default: true + prod: + git: + branch: main diff --git a/acceptance/bundle/auto-deploy/attempts/out.test.toml b/acceptance/bundle/auto-deploy/attempts/out.test.toml new file mode 100644 index 00000000000..2ab253adc73 --- /dev/null +++ b/acceptance/bundle/auto-deploy/attempts/out.test.toml @@ -0,0 +1,2 @@ +Cloud = false +EnvMatrix.DMS = [] diff --git a/acceptance/bundle/auto-deploy/attempts/output.txt b/acceptance/bundle/auto-deploy/attempts/output.txt new file mode 100644 index 00000000000..4bda5b44244 --- /dev/null +++ b/acceptance/bundle/auto-deploy/attempts/output.txt @@ -0,0 +1,47 @@ + +=== A target without a trigger + +>>> musterr [CLI] bundle auto-deploy attempts +Error: target dev has no auto-deploy trigger that you can view. Only a trigger's creator and workspace admins can view it. To create one, run: databricks bundle auto-deploy create -t dev + +=== Creating the trigger queues its first attempt + +>>> [CLI] bundle auto-deploy attempts +Attempt ID Status Commit Created +[UUID][0] QUEUED [TIMESTAMP] + +>>> [CLI] bundle auto-deploy attempts [UUID][0] +Attempt ID: [UUID][0] +Status: QUEUED +Created: [TIMESTAMP] +{ + "method": "GET", + "path": "/api/2.0/git-webhooks/webhook-triggers/[UUID][1]/attempts" +} +{ + "method": "GET", + "path": "/api/2.0/git-webhooks/webhook-triggers/[UUID][1]/attempts/[UUID][0]" +} + +=== A failed attempt + +>>> [CLI] bundle auto-deploy attempts [UUID][2] +Attempt ID: [UUID][2] +Status: FAILED +Commit: 0123456789abcdef0123456789abcdef01234567 +Created: [TIMESTAMP] +Completed: [TIMESTAMP] +Stage: RUN_BUNDLE_DEPLOY +Run ID: 7012345678901234 +Error: cannot create job: invalid cluster spec + +=== An attempt that does not exist + +>>> musterr [CLI] bundle auto-deploy attempts [UUID][3] +Error: Auto-deploy attempt 'webhook-triggers/[UUID][1]/attempts/[UUID][3]' does not exist + +>>> musterr [CLI] bundle auto-deploy attempts webhook-triggers/x/attempts/y +Error: "webhook-triggers/x/attempts/y" is not an attempt ID. Pass the attempt_id of an attempt, not its name + +>>> musterr [CLI] bundle auto-deploy attempts .. +Error: ".." is not an attempt ID. Pass the attempt_id of an attempt, not its name diff --git a/acceptance/bundle/auto-deploy/attempts/script b/acceptance/bundle/auto-deploy/attempts/script new file mode 100644 index 00000000000..14356032eea --- /dev/null +++ b/acceptance/bundle/auto-deploy/attempts/script @@ -0,0 +1,22 @@ +git-repo-init +git remote add origin https://github.com/acme/repo + +title "A target without a trigger" +trace musterr $CLI bundle auto-deploy attempts + +$CLI bundle auto-deploy create >> LOG.setup 2>&1 +attempt_id=$($CLI bundle auto-deploy attempts -o json | jq -r '.[0].attempt_id') +rm "$OUT_REQUESTS" + +title "Creating the trigger queues its first attempt" +trace $CLI bundle auto-deploy attempts +trace $CLI bundle auto-deploy attempts $attempt_id +print_requests.py --get //attempts + +title "A failed attempt" +trace $CLI bundle auto-deploy attempts 11111111-1111-4111-8111-111111111111 + +title "An attempt that does not exist" +trace musterr $CLI bundle auto-deploy attempts 22222222-2222-4222-8222-222222222222 +trace musterr $CLI bundle auto-deploy attempts webhook-triggers/x/attempts/y +trace musterr $CLI bundle auto-deploy attempts .. diff --git a/acceptance/bundle/auto-deploy/attempts/test.toml b/acceptance/bundle/auto-deploy/attempts/test.toml new file mode 100644 index 00000000000..8b70bf645eb --- /dev/null +++ b/acceptance/bundle/auto-deploy/attempts/test.toml @@ -0,0 +1,21 @@ +# The fake has no runner, so no attempt of it ever fails. This stub covers how a failed attempt +# renders. It answers for any trigger, as it only checks the output. +[[Server]] +Pattern = "GET /api/2.0/git-webhooks/webhook-triggers/{trigger_id}/attempts/11111111-1111-4111-8111-111111111111" +Response.Body = ''' +{ + "name": "webhook-triggers/aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa/attempts/11111111-1111-4111-8111-111111111111", + "trigger_id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa", + "attempt_id": "11111111-1111-4111-8111-111111111111", + "attempt_status": "ATTEMPT_STATUS_FAILED", + "error_message": "cannot create job: invalid cluster spec", + "resolved_commit_sha": "0123456789abcdef0123456789abcdef01234567", + "create_time": "2026-11-24T10:00:00Z", + "complete_time": "2026-11-24T10:02:00Z", + "dabs_result": { + "stage": "STAGE_RUN_BUNDLE_DEPLOY", + "run_id": 7012345678901234, + "job_id": 7012345678900000 + } +} +''' diff --git a/cmd/bundle/autodeploy/attempts.go b/cmd/bundle/autodeploy/attempts.go new file mode 100644 index 00000000000..d64ef42ee8d --- /dev/null +++ b/cmd/bundle/autodeploy/attempts.go @@ -0,0 +1,71 @@ +package autodeploy + +import ( + "fmt" + "strings" + + "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/cmdio" + "github.com/databricks/cli/libs/gitwebhooks" + "github.com/spf13/cobra" +) + +// Every status gets a color, so all of them carry the same escape bytes, which the list's column +// alignment counts as width. +const attemptStatusTemplate = `{{$s := replace .AttemptStatus "ATTEMPT_STATUS_" ""}}{{if eq $s "SUCCEEDED"}}{{green "%s" $s}}{{else if eq $s "FAILED"}}{{red "%s" $s}}{{else}}{{blue "%s" $s}}{{end}}` + +const attemptTemplate = `Attempt ID: {{.AttemptID}} +Status: ` + attemptStatusTemplate + ` +{{with .ResolvedCommitSha}}Commit: {{.}} +{{end}}Created: {{.CreateTime}} +{{with .CompleteTime}}Completed: {{.}} +{{end}}{{with .DabsResult}}{{with .Stage}}Stage: {{replace . "STAGE_" ""}} +{{end}}{{with .DeploymentVersion}}Version: {{.}} +{{end}}{{with .RunID}}Run ID: {{.}} +{{end}}{{end}}{{with .ErrorMessage}}Error: {{.}} +{{end}}` + +func newAttemptsCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "attempts [ATTEMPT_ID]", + Short: "List the auto-deploy attempts of this bundle target, or show one", + Long: `List the auto-deploy attempts of this bundle target, newest first, or show one. + +An attempt is one deploy of the target for one commit: the first deploy when +the trigger is created, or the deploy for a push to its branch.`, + Args: root.MaximumNArgs(1), + Annotations: map[string]string{ + "headerTemplate": `{{header "Attempt ID"}} {{header "Status"}} {{header "Commit"}} {{header "Created"}}`, + "template": cmdio.Heredoc(` + {{range .}}{{.AttemptID}} ` + attemptStatusTemplate + ` {{printf "%.12s" .ResolvedCommitSha}} {{.CreateTime}} + {{end}}`), + }, + } + + cmd.RunE = func(cmd *cobra.Command, args []string) error { + t, api, err := loadTrigger(cmd) + if err != nil { + return err + } + ctx := cmd.Context() + // The ID becomes a path segment of the attempt's name, where . and .. would change the path. + if len(args) == 1 && (args[0] == "" || args[0] == "." || args[0] == ".." || strings.Contains(args[0], "/")) { + return fmt.Errorf("%q is not an attempt ID. Pass the attempt_id of an attempt, not its name", args[0]) + } + found, err := findTrigger(ctx, api, t) + if err != nil { + return err + } + + if len(args) == 0 { + return cmdio.RenderIterator(ctx, api.ListAutoDeployAttempts(ctx, gitwebhooks.ListAutoDeployAttemptsRequest{Parent: found.Name})) + } + attempt, err := api.GetAutoDeployAttempt(ctx, gitwebhooks.GetAutoDeployAttemptRequest{Name: found.Name + "/attempts/" + args[0]}) + if err != nil { + return err + } + return cmdio.RenderWithTemplate(ctx, attempt, "", attemptTemplate) + } + + return cmd +} diff --git a/cmd/bundle/autodeploy/autodeploy.go b/cmd/bundle/autodeploy/autodeploy.go index 41f9741ef1b..836e90c277a 100644 --- a/cmd/bundle/autodeploy/autodeploy.go +++ b/cmd/bundle/autodeploy/autodeploy.go @@ -26,5 +26,6 @@ Example: cmd.AddCommand(newGetCommand()) cmd.AddCommand(newListCommand()) cmd.AddCommand(newDeleteCommand()) + cmd.AddCommand(newAttemptsCommand()) return cmd } diff --git a/libs/gitwebhooks/api.go b/libs/gitwebhooks/api.go index f94d7f688a2..146a4687978 100644 --- a/libs/gitwebhooks/api.go +++ b/libs/gitwebhooks/api.go @@ -15,6 +15,7 @@ import ( "github.com/databricks/cli/libs/auth" "github.com/databricks/databricks-sdk-go" databricksclient "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/httpclient" "github.com/databricks/databricks-sdk-go/listing" ) @@ -90,3 +91,35 @@ func withJSONBody(body []byte) func(*http.Request) error { return nil } } + +// ListAutoDeployAttempts lists the attempts of a trigger, newest first. +func (a *API) ListAutoDeployAttempts(ctx context.Context, req ListAutoDeployAttemptsRequest) listing.Iterator[AutoDeployAttempt] { + return listing.NewIterator( + &req, + a.listAutoDeployAttemptsPage, + func(resp *ListAutoDeployAttemptsResponse) []AutoDeployAttempt { + return resp.AutoDeployAttempts + }, + func(resp *ListAutoDeployAttemptsResponse) *ListAutoDeployAttemptsRequest { + if resp.NextPageToken == "" { + return nil + } + req.PageToken = resp.NextPageToken + return &req + }, + ) +} + +func (a *API) listAutoDeployAttemptsPage(ctx context.Context, req ListAutoDeployAttemptsRequest) (*ListAutoDeployAttemptsResponse, error) { + var resp ListAutoDeployAttemptsResponse + path := basePath + "/" + httpclient.EncodeMultiSegmentPathParameter(req.Parent) + "/attempts" + err := a.client.Do(ctx, http.MethodGet, path, auth.WorkspaceIDHeaders(a.client.Config), nil, req, &resp) + return &resp, err +} + +func (a *API) GetAutoDeployAttempt(ctx context.Context, req GetAutoDeployAttemptRequest) (*AutoDeployAttempt, error) { + var resp AutoDeployAttempt + path := basePath + "/" + httpclient.EncodeMultiSegmentPathParameter(req.Name) + err := a.client.Do(ctx, http.MethodGet, path, auth.WorkspaceIDHeaders(a.client.Config), nil, nil, &resp) + return &resp, err +} diff --git a/libs/gitwebhooks/model.go b/libs/gitwebhooks/model.go index 23f7bafe476..a33711f9f5d 100644 --- a/libs/gitwebhooks/model.go +++ b/libs/gitwebhooks/model.go @@ -87,3 +87,58 @@ type DeleteWebhookTrigger struct { GitProvider GitProvider `json:"git_provider"` TriggerConfig *DeploymentTriggerConfig `json:"trigger_config"` } + +// AutoDeployAttempt is one auto-deploy run of a trigger for one commit. +type AutoDeployAttempt struct { + // Name has the format webhook-triggers/{trigger_id}/attempts/{attempt_id}. + Name string `json:"name,omitempty"` + TriggerID string `json:"trigger_id,omitempty"` + AttemptID string `json:"attempt_id,omitempty"` + + // AttemptStatus is one of ATTEMPT_STATUS_QUEUED, _RUNNING, _SUCCEEDED, _FAILED, _SUPERSEDED and + // _UNKNOWN. A push supersedes the trigger's older attempts that have not started. + AttemptStatus string `json:"attempt_status,omitempty"` + + // ErrorMessage is set only for a failed attempt. + ErrorMessage string `json:"error_message,omitempty"` + ResolvedCommitSha string `json:"resolved_commit_sha,omitempty"` + + // CreateTime and CompleteTime are RFC 3339 timestamps. + CreateTime string `json:"create_time,omitempty"` + CompleteTime string `json:"complete_time,omitempty"` + + DeployAs *DeployAsIdentity `json:"deploy_as,omitempty"` + RepoURL string `json:"repo_url,omitempty"` + GitProvider GitProvider `json:"git_provider,omitempty"` + TriggerConfig *DeploymentTriggerConfig `json:"trigger_config,omitempty"` + DabsResult *DabsAttemptResult `json:"dabs_result,omitempty"` +} + +type DabsAttemptResult struct { + // Stage is the last stage the attempt reached, such as STAGE_RUN_BUNDLE_DEPLOY. For a failed + // attempt, it is the stage that failed. + Stage string `json:"stage,omitempty"` + + // DeploymentVersion has the format deployments/{deployment_id}/versions/{version_id}. + DeploymentVersion string `json:"deployment_version,omitempty"` + + // RunID and JobID are the runner job run and the runner job that the attempt ran in. + RunID int64 `json:"run_id,omitempty"` + JobID int64 `json:"job_id,omitempty"` +} + +type ListAutoDeployAttemptsRequest struct { + // Parent has the format webhook-triggers/{trigger_id}. + Parent string `json:"-" url:"-"` + PageToken string `json:"-" url:"page_token,omitempty"` +} + +type ListAutoDeployAttemptsResponse struct { + AutoDeployAttempts []AutoDeployAttempt `json:"auto_deploy_attempts,omitempty"` + NextPageToken string `json:"next_page_token,omitempty"` +} + +type GetAutoDeployAttemptRequest struct { + // Name has the format webhook-triggers/{trigger_id}/attempts/{attempt_id}. + Name string `json:"-" url:"-"` +} diff --git a/libs/testserver/gitwebhooks.go b/libs/testserver/gitwebhooks.go index 9de75ce0842..ea4aaa8b5e7 100644 --- a/libs/testserver/gitwebhooks.go +++ b/libs/testserver/gitwebhooks.go @@ -21,9 +21,13 @@ type fakeWebhookTrigger struct { // creator is the user name of the caller that created the trigger. An update keeps it. creator string + + // attempts are the trigger's auto-deploy attempts, newest first. The service keeps them after + // a delete, but then only workspace admins can read them, and the fake's caller is not one. + attempts []gitwebhooks.AutoDeployAttempt } -// gitWebhooksPageSize is small so that a list of two triggers already takes two pages. +// gitWebhooksPageSize is small so that a list of two items already takes two pages. const gitWebhooksPageSize = 1 func gitWebhooksBadRequest(message string) Response { @@ -78,28 +82,48 @@ func (s *FakeWorkspace) GitWebhooksUpsert(req Request) Response { if webhookID == "" { webhookID = nextUUID() } - if triggerID == "" { + isNew := triggerID == "" + if isNew { triggerID = nextUUID() } // The service lets only a trigger's creator or a workspace admin change it, and the fake's // callers are not admins. creator := s.MeUser(req.Token).UserName - if existing, ok := s.GitWebhookTriggers[triggerID]; ok && existing.creator != creator { + existing, ok := s.GitWebhookTriggers[triggerID] + if ok && existing.creator != creator { return gitWebhooksError(403, "PERMISSION_DENIED", "Only the trigger's creator or a workspace admin can change or delete it") } + var attempts []gitwebhooks.AutoDeployAttempt + if ok { + attempts = existing.attempts + } stored.TriggerID = triggerID - s.GitWebhookTriggers[triggerID] = &fakeWebhookTrigger{ - webhookID: webhookID, - creator: creator, - trigger: gitwebhooks.WebhookTrigger{ - Name: "webhook-triggers/" + triggerID, - RepoURL: request.RepoURL, - GitProvider: request.GitProvider, + trigger := gitwebhooks.WebhookTrigger{ + Name: "webhook-triggers/" + triggerID, + RepoURL: request.RepoURL, + GitProvider: request.GitProvider, + TriggerConfig: &stored, + } + // A new trigger deploys the branch's head right away. The fake has no runner, so the + // attempt stays queued. + if isNew { + attemptID := nextUUID() + attempts = []gitwebhooks.AutoDeployAttempt{{ + Name: trigger.Name + "/attempts/" + attemptID, + TriggerID: triggerID, + AttemptID: attemptID, + AttemptStatus: "ATTEMPT_STATUS_QUEUED", + CreateTime: nextTimestamp(), + RepoURL: trigger.RepoURL, + GitProvider: trigger.GitProvider, TriggerConfig: &stored, - }, + // The service names the runner job of every DABs attempt, from when it is queued. + DabsResult: &gitwebhooks.DabsAttemptResult{JobID: nextID()}, + }} } + s.GitWebhookTriggers[triggerID] = &fakeWebhookTrigger{webhookID: webhookID, trigger: trigger, creator: creator, attempts: attempts} return Response{Body: gitwebhooks.UpsertWebhookTriggerResponse{WebhookID: webhookID, TriggerID: triggerID}} } @@ -150,13 +174,6 @@ func (s *FakeWorkspace) GitWebhooksList(req Request) Response { if err != nil { return gitWebhooksError(400, "INVALID_PARAMETER_VALUE", err.Error()) } - offset := 0 - if token := query.Get("page_token"); token != "" { - offset, err = strconv.Atoi(token) - if err != nil || offset < 0 { - return gitWebhooksError(400, "INVALID_PARAMETER_VALUE", "invalid page_token") - } - } caller := s.MeUser(req.Token).UserName defer s.LockUnlock()() @@ -164,21 +181,75 @@ func (s *FakeWorkspace) GitWebhooksList(req Request) Response { all := slices.SortedFunc(maps.Values(s.GitWebhookTriggers), func(a, b *fakeWebhookTrigger) int { return strings.Compare(a.trigger.Name, b.trigger.Name) }) - offset = min(offset, len(all)) - end := min(offset+gitWebhooksPageSize, len(all)) + page, next, err := gitWebhooksPage(all, query.Get("page_token")) + if err != nil { + return gitWebhooksError(400, "INVALID_PARAMETER_VALUE", err.Error()) + } - var resp gitwebhooks.ListWebhookTriggersResponse - for _, t := range all[offset:end] { + resp := gitwebhooks.ListWebhookTriggersResponse{NextPageToken: next} + for _, t := range page { if t.creator == caller && gitWebhookTriggerMatches(t.trigger, terms) { resp.WebhookTriggers = append(resp.WebhookTriggers, t.trigger) } } - if end < len(all) { - resp.NextPageToken = strconv.Itoa(end) - } return Response{Body: resp} } +// GitWebhooksListAttempts lists the attempts of a trigger, newest first. +func (s *FakeWorkspace) GitWebhooksListAttempts(req Request, triggerID string) Response { + defer s.LockUnlock()() + + t, ok := s.GitWebhookTriggers[triggerID] + if !ok { + return gitWebhookTriggerNotFound(triggerID) + } + page, next, err := gitWebhooksPage(t.attempts, req.URL.Query().Get("page_token")) + if err != nil { + return gitWebhooksError(400, "INVALID_PARAMETER_VALUE", err.Error()) + } + return Response{Body: gitwebhooks.ListAutoDeployAttemptsResponse{AutoDeployAttempts: page, NextPageToken: next}} +} + +// GitWebhooksGetAttempt returns an attempt of a trigger. +func (s *FakeWorkspace) GitWebhooksGetAttempt(triggerID, attemptID string) Response { + defer s.LockUnlock()() + + t, ok := s.GitWebhookTriggers[triggerID] + if !ok { + return gitWebhookTriggerNotFound(triggerID) + } + for _, attempt := range t.attempts { + if attempt.AttemptID == attemptID { + return Response{Body: attempt} + } + } + return gitWebhooksError(404, "NOT_FOUND", fmt.Sprintf("Auto-deploy attempt 'webhook-triggers/%s/attempts/%s' does not exist", triggerID, attemptID)) +} + +func gitWebhookTriggerNotFound(triggerID string) Response { + return gitWebhooksError(404, "NOT_FOUND", fmt.Sprintf("Webhook trigger 'webhook-triggers/%s' does not exist", triggerID)) +} + +// gitWebhooksPage returns the page of items that starts at the offset in token, and the token of +// the next page. +func gitWebhooksPage[T any](items []T, token string) ([]T, string, error) { + offset := 0 + if token != "" { + var err error + offset, err = strconv.Atoi(token) + if err != nil || offset < 0 { + return nil, "", fmt.Errorf("invalid page_token: %s", token) + } + } + offset = min(offset, len(items)) + end := min(offset+gitWebhooksPageSize, len(items)) + next := "" + if end < len(items) { + next = strconv.Itoa(end) + } + return items[offset:end], next, nil +} + // parseGitWebhooksFilter parses the subset of AIP-160 that the service supports: `field = value` // terms joined by AND, each field at most once, with values in double quotes. func parseGitWebhooksFilter(filter string) (map[string]string, error) { diff --git a/libs/testserver/handlers.go b/libs/testserver/handlers.go index 44d0a78dbd4..8f249662c1f 100644 --- a/libs/testserver/handlers.go +++ b/libs/testserver/handlers.go @@ -582,6 +582,12 @@ func AddDefaultHandlers(server *Server) { server.Handle("DELETE", "/api/2.0/git-webhooks/trigger", func(req Request) any { return req.Workspace.GitWebhooksDelete(req) }) + server.Handle("GET", "/api/2.0/git-webhooks/webhook-triggers/{trigger_id}/attempts", func(req Request) any { + return req.Workspace.GitWebhooksListAttempts(req, req.Vars["trigger_id"]) + }) + server.Handle("GET", "/api/2.0/git-webhooks/webhook-triggers/{trigger_id}/attempts/{attempt_id}", func(req Request) any { + return req.Workspace.GitWebhooksGetAttempt(req.Vars["trigger_id"], req.Vars["attempt_id"]) + }) server.Handle("POST", "/api/2.2/jobs/delete", func(req Request) any { var request jobs.DeleteJob