Skip to content

Add bundle auto-deploy attempts - #7943

Open
atreyadbrx wants to merge 1 commit into
dabs-ad-d4-pr5-deletefrom
dabs-ad-d4-pr6-attempts
Open

atreyadbrx wants to merge 1 commit into
dabs-ad-d4-pr5-deletefrom
dabs-ad-d4-pr6-attempts

Conversation

@atreyadbrx

@atreyadbrx atreyadbrx commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • attempts lists the target's auto-deploy attempts, newest first, through ListAutoDeployAttempts. With an attempt ID, it shows that attempt through GetAutoDeployAttempt. It rejects an ID that is empty or contains /, since the ID becomes a segment of the attempt's name.
  • The fake queues an attempt when it creates a trigger, the way the service deploys the branch head right away.

Why

Users need to see whether their pushes deployed, and why a deploy failed.

Tests

acceptance/bundle/auto-deploy/attempts covers:

  • the list and one attempt from the fake
  • a failed attempt (stubbed, since the fake has no runner)
  • an unknown attempt ID, and an attempt's name passed instead of its ID
  • a target with no trigger

Stacked on #7942.

This pull request and its description were written by Isaac.

@atreyadbrx
atreyadbrx requested review from a team as code owners November 24, 2026 17:48
@atreyadbrx
atreyadbrx requested a review from pietern November 24, 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 8008385. Each finding was verified against the code.

No blocking issues found. 3 non-blocking comment(s) and 1 question(s) below.

This PR adds bundle auto-deploy attempts, which lists a target's auto-deploy attempts or shows one of them. It also adds the attempts list and get endpoints to the fake server, which queues an attempt when it creates a trigger. The main paths work. The issues I'd fix are an attempt ID that goes into the request path without any check, and a failed-attempt test that uses a [[Server]] stub for a route the fake now handles. There is also an open question about what happens to attempt history once a trigger is deleted.

Questions

  1. attempts always resolves the target's current trigger through findTrigger first. DeleteWebhookTrigger says a trigger's attempts survive its deletion, yet after auto-deploy delete the command fails with "has no auto-deploy trigger", and after delete plus create it only shows the new trigger's attempts. The fake also disagrees with itself here: get still works for a deleted trigger, but list returns 404. Should the command accept a trigger ID or a full attempt name so older history stays reachable, or should the help text say that history is no longer visible after delete? (non-blocking)

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]})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] args[0] is appended to the name as is, and EncodeMultiSegmentPathParameter in GetAutoDeployAttempt keeps / as a path separator. So attempts "" sends GET .../webhook-triggers/T/attempts/, which is the list route with a trailing slash. And pasting the name that -o json prints (webhook-triggers/T/attempts/A) requests .../attempts/webhook-triggers/T/attempts/A, so the user gets a 404 for a path they never typed. Could we reject an empty ID or one containing / before building the name? Or accept the full name as well?

@@ -0,0 +1,20 @@
# The fake has no runner to fail an attempt, so this one is stubbed.
[[Server]]
Pattern = "GET /api/2.0/git-webhooks/webhook-triggers/{trigger_id}/attempts/11111111-1111-4111-8111-111111111111"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] .agents/rules/testing.md says to reserve [[Server]] for routes the testserver doesn't model and for responses a stateful handler can't express. This PR adds a handler for this exact route, and a failed attempt is a state GitWebhookAttempts could hold. Because the pattern matches any {trigger_id} and the body names trigger aaaaaaaa-…, the "A failed attempt" case passes no matter which trigger the CLI looked up or put in the path. Could the test put a failed attempt into the fake for the real trigger instead?

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')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] .agents/rules/testing.md asks for the acceptance/bin/ helpers instead of inline jq pipelines, and prefers gron.py | grep field for single values. This line pulls .[0].attempt_id with jq -r. Can it use the helpers instead?

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: a3949bfcb | Workflow run

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

5 tests: regression=5 unreleased=0 coverage=0 failing=0
test branch main (4c4f104) latest (v1.28.0)
TestAccept/bundle/auto-deploy/attempts ✅ ❌ ❌
TestAccept/bundle/auto-deploy/create ✅ ❌ ❌
TestAccept/bundle/auto-deploy/delete ✅ ❌ ❌
TestAccept/bundle/auto-deploy/get ✅ ❌ ❌
TestAccept/bundle/auto-deploy/list ✅ ❌ ❌
TestAccept/bundle/auto-deploy/attempts: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌

main (4c4f104):

acceptance_test.go:1402: Diff:
        --- bundle/auto-deploy/attempts/output.txt
        +++ /tmp/TestAcceptbundleauto-deployattempts3613379753/002/output.txt
        @@ -2,46 +2,49 @@
         === A target without a trigger
         
         >>> musterr [CLI] bundle auto-deploy attempts
        -Error: target dev has no auto-deploy trigger that you can view. To create one, run: databricks bundle auto-deploy create -t dev
        +Declarative Automation Bundles let you express data/AI/analytics projects as code.
         
        -=== Creating the trigger queues its first attempt
        +Common workflows:
        +  databricks bundle init default-python      # Initialize new project
        +  databricks bundle deploy --target dev      # Deploy to development
        +  databricks bundle run my_job               # Run jobs/pipelines
        +  databricks bundle deploy --target prod     # Deploy to production
         
        ->>> [CLI] bundle auto-deploy attempts
        -Attempt ID                            Status  Commit  Created
        -[UUID][0]  QUEUED          [TIMESTAMP]
        +Import existing resources:
        +  databricks bundle generate job --existing-job-id 123 --key my_job # Generate job configuration
        +  databricks bundle deployment bind my_job 123                      # Link to an existing job
         
        ->>> [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]"
        -}
        +Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.html
         
        -=== A failed attempt
        +Usage:
        +  databricks bundle [command]
         
        ->>> [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
        +Available Commands:
        +  deploy             Deploy bundle
        +  deployment         Deployment related commands
        +  destroy            Destroy deployed bundle resources
        +  generate           Generate bundle configuration
        +  init               Initialize using a bundle template
        +  open               Open a resource in the browser
        +  plan               Show deployment plan
        +  run                Run a job, pipeline update or app
        +  schema             Generate JSON Schema for bundle configuration
        +  summary            Summarize resources deployed by this bundle
        +  sync               Synchronize bundle tree to the workspace
        +  validate           Validate configuration
         
        -=== An attempt that does not exist
        +Flags:
        +  -h, --help[=true|false]   help for bundle
        +      --var strings         set values for variables defined in bundle config. Example: --var="foo=bar"
         
        ->>> musterr [CLI] bundle auto-deploy attempts [UUID][3]
        -Error: Auto-deploy attempt 'webhook-triggers/[UUID][1]/attempts/[UUID][3]' does not exist
        +Global Flags:
        +      --debug[=true|false]   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)
         
        ->>> 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
        +Use "databricks bundle [command] --help" for more information about a command.
         
        ->>> musterr [CLI] bundle auto-deploy attempts ..
        -Error: ".." is not an attempt ID. Pass the attempt_id of an attempt, not its name
        +Unexpected success
        +
        +Exit code: 1

latest (v1.28.0): same output as main (4c4f104)

TestAccept/bundle/auto-deploy/create: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌

main (4c4f104):

acceptance_test.go:1402: Diff:
        --- bundle/auto-deploy/create/output.txt
        +++ /tmp/TestAcceptbundleauto-deploycreate4101835556/002/output.txt
        @@ -2,289 +2,48 @@
         === The current branch, as the caller
         
         >>> [CLI] bundle auto-deploy create
        -Pushes to branch main now deploy target dev as you.
        -Trigger ID: [UUID][0]
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/git-webhooks",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "dev"
        -      }
        -    }
        -  }
        -}
        +Declarative Automation Bundles let you express data/AI/analytics projects as code.
         
        -=== Updating the trigger keeps its ID
        +Common workflows:
        +  databricks bundle init default-python      # Initialize new project
        +  databricks bundle deploy --target dev      # Deploy to development
        +  databricks bundle run my_job               # Run jobs/pipelines
        +  databricks bundle deploy --target prod     # Deploy to production
         
        ->>> [CLI] bundle auto-deploy create --branch release --deploy-as [UUID][1]
        -Pushes to branch release now deploy target dev as [UUID][1].
        -Trigger ID: [UUID][0]
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/git-webhooks",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "release"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "dev",
        -        "deploy_as": {
        -          "service_principal_client_id": "[UUID][1]"
        -        }
        -      }
        -    }
        -  }
        -}
        +Import existing resources:
        +  databricks bundle generate job --existing-job-id 123 --key my_job # Generate job configuration
        +  databricks bundle deployment bind my_job 123                      # Link to an existing job
         
        -=== As yourself, in JSON
        +Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.html
         
        ->>> [CLI] bundle auto-deploy create -t prod --deploy-as [USERNAME] -o json
        -{
        -  "webhook_id": "[UUID][2]",
        -  "trigger_id": "[UUID][3]"
        -}
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/git-webhooks",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "prod",
        -        "deploy_as": {
        -          "user_email": "[USERNAME]"
        -        }
        -      }
        -    }
        -  }
        -}
        +Usage:
        +  databricks bundle [command]
         
        -=== As a service principal, on a production target that a user could not deploy
        +Available Commands:
        +  deploy             Deploy bundle
        +  deployment         Deployment related commands
        +  destroy            Destroy deployed bundle resources
        +  generate           Generate bundle configuration
        +  init               Initialize using a bundle template
        +  open               Open a resource in the browser
        +  plan               Show deployment plan
        +  run                Run a job, pipeline update or app
        +  schema             Generate JSON Schema for bundle configuration
        +  summary            Summarize resources deployed by this bundle
        +  sync               Synchronize bundle tree to the workspace
        +  validate           Validate configuration
         
        ->>> [CLI] bundle auto-deploy create -t prod --deploy-as [UUID][1]
        -Pushes to branch main now deploy target prod as [UUID][1].
        -Trigger ID: [UUID][3]
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/git-webhooks",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "prod",
        -        "deploy_as": {
        -          "service_principal_client_id": "[UUID][1]"
        -        }
        -      }
        -    }
        -  }
        -}
        +Flags:
        +  -h, --help[=true|false]   help for bundle
        +      --var strings         set values for variables defined in bundle config. Example: --var="foo=bar"
         
        -=== As another user
        +Global Flags:
        +      --debug[=true|false]   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)
         
        ->>> musterr [CLI] bundle auto-deploy create -t prod --deploy-as someone@example.com
        -Error: deploy_as.user_email must be your own email. To deploy as another identity, use a service principal you have the Service Principal User role on.
        +Use "databricks bundle [command] --help" for more information about a command.
        +File [OUTPUT_DIR]/out.requests.txt not found
         
        -Host:      [DATABRICKS_URL]
        -Auth type: Personal Access Token (pat)
        -
        -Next steps:
        -  - Verify you have the required permissions for this operation
        -  - Check your identity: databricks auth describe
        -  - Consider setting up a profile: databricks auth login --profile <name>
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/git-webhooks",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "prod",
        -        "deploy_as": {
        -          "user_email": "someone@example.com"
        -        }
        -      }
        -    }
        -  }
        -}
        -
        -=== A branch other than the target's git.branch
        -
        ->>> musterr [CLI] bundle auto-deploy create -t prod --branch release
        -Error: git.branch is main for target prod, so a deploy from release would fail. Omit --branch, or change git.branch
        -
        -=== A git.branch from a variable
        -
        ->>> [CLI] bundle auto-deploy create -t staging
        -Pushes to branch release now deploy target staging as you.
        -Trigger ID: [UUID][4]
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/git-webhooks",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "release"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "staging"
        -      }
        -    }
... (129 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.28.0): same output as main (4c4f104)

TestAccept/bundle/auto-deploy/delete: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌

main (4c4f104):

acceptance_test.go:1402: Diff:
        --- bundle/auto-deploy/delete/output.txt
        +++ /tmp/TestAcceptbundleauto-deploydelete2728533209/002/output.txt
        @@ -1,78 +1,3 @@
        +rm: cannot remove '[OUTPUT_DIR]/out.requests.txt': No such file or directory
         
        -=== Without a terminal, delete needs --auto-approve, and sends nothing first
        -
        ->>> musterr [CLI] bundle auto-deploy delete
        -Error: this deletes the auto-deploy trigger of the bundle target and the job that runs its deploys. To proceed, use --auto-approve.
        -
        -=== Deleting the target's trigger leaves the other target's
        -
        ->>> [CLI] bundle auto-deploy delete --auto-approve
        -Deleted the auto-deploy trigger of target dev.
        -{
        -  "method": "DELETE",
        -  "path": "/api/2.0/git-webhooks/trigger",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "dev"
        -      }
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle auto-deploy list
        -Target  Branch  Deploy as      Trigger ID
        -prod    main    you or a user  [UUID]
        -
        -=== A retried delete sends its body again
        -
        ->>> [CLI] bundle auto-deploy delete -t prod --auto-approve
        -Deleted the auto-deploy trigger of target prod.
        -{
        -  "method": "DELETE",
        -  "path": "/api/2.0/git-webhooks/trigger",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "prod"
        -      }
        -    }
        -  }
        -}
        -{
        -  "method": "DELETE",
        -  "path": "/api/2.0/git-webhooks/trigger",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "prod"
        -      }
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle auto-deploy list
        -Target  Branch  Deploy as  Trigger ID
        -
        -=== A target without a trigger
        -
        ->>> musterr [CLI] bundle auto-deploy delete --auto-approve
        -Error: target dev has no auto-deploy trigger that you can view, so there is nothing to delete
        +Exit code: 1
        
    acceptance_test.go:1180: 
        LOG.setup: Declarative Automation Bundles let you express data/AI/analytics projects as code.
        LOG.setup: 
        LOG.setup: Common workflows:
        LOG.setup:   databricks bundle init default-python      # Initialize new project
        LOG.setup:   databricks bundle deploy --target dev      # Deploy to development
        LOG.setup:   databricks bundle run my_job               # Run jobs/pipelines
        LOG.setup:   databricks bundle deploy --target prod     # Deploy to production
        LOG.setup: 
        LOG.setup: Import existing resources:
        LOG.setup:   databricks bundle generate job --existing-job-id 123 --key my_job # Generate job configuration
        LOG.setup:   databricks bundle deployment bind my_job 123                      # Link to an existing job
        LOG.setup: 
        LOG.setup: Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.html
        LOG.setup: 
        LOG.setup: Usage:
        LOG.setup:   databricks bundle [command]
        LOG.setup: 
        LOG.setup: Available Commands:
        LOG.setup:   deploy             Deploy bundle
        LOG.setup:   deployment         Deployment related commands
        LOG.setup:   destroy            Destroy deployed bundle resources
        LOG.setup:   generate           Generate bundle configuration
        LOG.setup:   init               Initialize using a bundle template
        LOG.setup:   open               Open a resource in the browser
        LOG.setup:   plan               Show deployment plan
        LOG.setup:   run                Run a job, pipeline update or app
        LOG.setup:   schema             Generate JSON Schema for bundle configuration
        LOG.setup:   summary            Summarize resources deployed by this bundle
        LOG.setup:   sync               Synchronize bundle tree to the workspace
        LOG.setup:   validate           Validate configuration
        LOG.setup: 
        LOG.setup: Flags:
        LOG.setup:   -h, --help[=true|false]   help for bundle
        LOG.setup:       --var strings         set values for variables defined in bundle config. Example: --var="foo=bar"
        LOG.setup: 
        LOG.setup: Global Flags:
        LOG.setup:       --debug[=true|false]   enable debug logging
        LOG.setup:   -o, --output type          output type: text or json (default text)
        LOG.setup:   -p, --profile string       ~/.databrickscfg profile
        LOG.setup:   -t, --target string        bundle target to use (if applicable)
        LOG.setup: 
        LOG.setup: Use "databricks bundle [command] --help" for more information about a command.
        LOG.setup: Declarative Automation Bundles let you express data/AI/analytics projects as code.
        LOG.setup: 
        LOG.setup: Common workflows:
        LOG.setup:   databricks bundle init default-python      # Initialize new project
        LOG.setup:   databricks bundle deploy --target dev      # Deploy to development
        LOG.setup:   databricks bundle run my_job               # Run jobs/pipelines
        LOG.setup:   databricks bundle deploy --target prod     # Deploy to production
        LOG.setup: 
        LOG.setup: Import existing resources:
        LOG.setup:   databricks bundle generate job --existing-job-id 123 --key my_job # Generate job configuration
        LOG.setup:   databricks bundle deployment bind my_job 123                      # Link to an existing job
        LOG.setup: 
        LOG.setup: Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.html
        LOG.setup: 
        LOG.setup: Usage:
        LOG.setup:   databricks bundle [command]
        LOG.setup: 
        LOG.setup: Available Commands:
        LOG.setup:   deploy             Deploy bundle
        LOG.setup:   deployment         Deployment related commands
        LOG.setup:   destroy            Destroy deployed bundle resources
        LOG.setup:   generate           Generate bundle configuration
        LOG.setup:   init               Initialize using a bundle template
        LOG.setup:   open               Open a resource in the browser
        LOG.setup:   plan               Show deployment plan
        LOG.setup:   run                Run a job, pipeline update or app
        LOG.setup:   schema             Generate JSON Schema for bundle configuration
        LOG.setup:   summary            Summarize resources deployed by this bundle
        LOG.setup:   sync               Synchronize bundle tree to the workspace
        LOG.setup:   validate           Validate configuration
        LOG.setup: 
        LOG.setup: Flags:
        LOG.setup:   -h, --help[=true|false]   help for bundle
        LOG.setup:       --var strings         set values for variables defined in bundle config. Example: --var="foo=bar"
        LOG.setup: 
        LOG.setup: Global Flags:
        LOG.setup:       --debug[=true|false]   enable debug logging
        LOG.setup:   -o, --output type          output type: text or json (default text)
        LOG.setup:   -p, --profile string       ~/.databrickscfg profile
        LOG.setup:   -t, --target string        bundle target to use (if applicable)
        LOG.setup: 
        LOG.setup: Use "databricks bundle [command] --help" for more information about a command.

latest (v1.28.0): same output as main (4c4f104)

TestAccept/bundle/auto-deploy/get: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌

main (4c4f104):

acceptance_test.go:1402: Diff:
        --- bundle/auto-deploy/get/output.txt
        +++ /tmp/TestAcceptbundleauto-deployget1911091513/002/output.txt
        @@ -2,84 +2,49 @@
         === A target without a trigger
         
         >>> musterr [CLI] bundle auto-deploy get
        -Error: target dev has no auto-deploy trigger that you can view. To create one, run: databricks bundle auto-deploy create -t dev
        +Declarative Automation Bundles let you express data/AI/analytics projects as code.
         
        -=== The target's trigger
        +Common workflows:
        +  databricks bundle init default-python      # Initialize new project
        +  databricks bundle deploy --target dev      # Deploy to development
        +  databricks bundle run my_job               # Run jobs/pipelines
        +  databricks bundle deploy --target prod     # Deploy to production
         
        ->>> [CLI] bundle auto-deploy get
        -Trigger ID: [UUID][0]
        -Repository: https://github.com/acme/repo
        -Bundle:     databricks.yml
        -Target:     dev
        -Branch:     main
        -Deploy as:  you or a user
        +Import existing resources:
        +  databricks bundle generate job --existing-job-id 123 --key my_job # Generate job configuration
        +  databricks bundle deployment bind my_job 123                      # Link to an existing job
         
        ->>> [CLI] bundle auto-deploy get -t prod
        -Trigger ID: [UUID][1]
        -Repository: https://github.com/acme/repo
        -Bundle:     databricks.yml
        -Target:     prod
        -Branch:     main
        -Deploy as:  [UUID][2]
        +Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.html
         
        ->>> [CLI] bundle auto-deploy get -t prod -o json
        -{
        -  "name": "webhook-triggers/[UUID][1]",
        -  "repo_url": "https://github.com/acme/repo",
        -  "git_provider": "GITHUB",
        -  "trigger_config": {
        -    "push_event": {
        -      "branch": "main"
        -    },
        -    "dabs_deploy": {
        -      "bundle_yml_repo_path": "databricks.yml",
        -      "deployment_mode": "prod",
        -      "deploy_as": {
        -        "service_principal_client_id": "[UUID][2]"
        -      }
        -    },
        -    "trigger_id": "[UUID][1]"
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\" AND trigger_config.dabs_deploy.deployment_mode = \"dev\""
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\" AND trigger_config.dabs_deploy.deployment_mode = \"prod\""
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\" AND trigger_config.dabs_deploy.deployment_mode = \"prod\"",
        -    "page_token": "1"
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\" AND trigger_config.dabs_deploy.deployment_mode = \"prod\""
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\" AND trigger_config.dabs_deploy.deployment_mode = \"prod\"",
        -    "page_token": "1"
        -  }
        -}
        +Usage:
        +  databricks bundle [command]
         
        -=== Another caller does not see the trigger
        +Available Commands:
        +  deploy             Deploy bundle
        +  deployment         Deployment related commands
        +  destroy            Destroy deployed bundle resources
        +  generate           Generate bundle configuration
        +  init               Initialize using a bundle template
        +  open               Open a resource in the browser
        +  plan               Show deployment plan
        +  run                Run a job, pipeline update or app
        +  schema             Generate JSON Schema for bundle configuration
        +  summary            Summarize resources deployed by this bundle
        +  sync               Synchronize bundle tree to the workspace
        +  validate           Validate configuration
         
        ->>> musterr as-test-sp [CLI] bundle auto-deploy get
        -Error: target dev has no auto-deploy trigger that you can view. To create one, run: databricks bundle auto-deploy create -t dev
        +Flags:
        +  -h, --help[=true|false]   help for bundle
        +      --var strings         set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +Global Flags:
        +      --debug[=true|false]   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)
        +
        +Use "databricks bundle [command] --help" for more information about a command.
        +
        +Unexpected success
        +
        +Exit code: 1

latest (v1.28.0): same output as main (4c4f104)

TestAccept/bundle/auto-deploy/list: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌

main (4c4f104):

acceptance_test.go:1402: Diff:
        --- bundle/auto-deploy/list/output.txt
        +++ /tmp/TestAcceptbundleauto-deploylist827147739/002/output.txt
        @@ -2,114 +2,48 @@
         === A bundle without triggers
         
         >>> [CLI] bundle auto-deploy list
        -Target  Branch  Deploy as  Trigger ID
        +Declarative Automation Bundles let you express data/AI/analytics projects as code.
         
        -=== Another bundle in the same repository, whose trigger is not this bundle's
        +Common workflows:
        +  databricks bundle init default-python      # Initialize new project
        +  databricks bundle deploy --target dev      # Deploy to development
        +  databricks bundle run my_job               # Run jobs/pipelines
        +  databricks bundle deploy --target prod     # Deploy to production
         
        ->>> withdir other [CLI] bundle auto-deploy create
        -Pushes to branch main now deploy target dev as you.
        -Trigger ID: [UUID][0]
        -{
        -  "method": "PUT",
        -  "path": "/api/2.0/git-webhooks",
        -  "body": {
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "other/databricks.yml",
        -        "deployment_mode": "dev"
        -      }
        -    }
        -  }
        -}
        +Import existing resources:
        +  databricks bundle generate job --existing-job-id 123 --key my_job # Generate job configuration
        +  databricks bundle deployment bind my_job 123                      # Link to an existing job
         
        -=== The triggers of this bundle's targets
        +Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.html
         
        ->>> [CLI] bundle auto-deploy list
        -Target  Branch  Deploy as      Trigger ID
        -dev     main    you or a user  [UUID][1]
        -prod    main    you or a user  [UUID][2]
        +Usage:
        +  databricks bundle [command]
         
        ->>> [CLI] bundle auto-deploy list -o json
        -[
        -  {
        -    "name": "webhook-triggers/[UUID][1]",
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "dev"
        -      },
        -      "trigger_id": "[UUID][1]"
        -    }
        -  },
        -  {
        -    "name": "webhook-triggers/[UUID][2]",
        -    "repo_url": "https://github.com/acme/repo",
        -    "git_provider": "GITHUB",
        -    "trigger_config": {
        -      "push_event": {
        -        "branch": "main"
        -      },
        -      "dabs_deploy": {
        -        "bundle_yml_repo_path": "databricks.yml",
        -        "deployment_mode": "prod"
        -      },
        -      "trigger_id": "[UUID][2]"
        -    }
        -  }
        -]
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\""
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\"",
        -    "page_token": "1"
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\"",
        -    "page_token": "2"
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\""
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\"",
        -    "page_token": "1"
        -  }
        -}
        -{
        -  "method": "GET",
        -  "path": "/api/2.0/git-webhooks/webhook-triggers",
        -  "q": {
        -    "filter": "repo_url = \"https://github.com/acme/repo\" AND trigger_config.dabs_deploy.bundle_yml_repo_path = \"databricks.yml\"",
        -    "page_token": "2"
        -  }
        -}
        +Available Commands:
        +  deploy             Deploy bundle
        +  deployment         Deployment related commands
        +  destroy            Destroy deployed bundle resources
        +  generate           Generate bundle configuration
        +  init               Initialize using a bundle template
        +  open               Open a resource in the browser
        +  plan               Show deployment plan
        +  run                Run a job, pipeline update or app
        +  schema             Generate JSON Schema for bundle configuration
        +  summary            Summarize resources deployed by this bundle
        +  sync               Synchronize bundle tree to the workspace
        +  validate           Validate configuration
        +
        +Flags:
        +  -h, --help[=true|false]   help for bundle
        +      --var strings         set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +Global Flags:
        +      --debug[=true|false]   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)
        +
        +Use "databricks bundle [command] --help" for more information about a command.
        +rm: cannot remove '[OUTPUT_DIR]/out.requests.txt': No such file or directory
        +
        +Exit code: 1
        
    acceptance_test.go:1180: 
        LOG.setup: Declarative Automation Bundles let you express data/AI/analytics projects as code.
        LOG.setup: 
        LOG.setup: Common workflows:
        LOG.setup:   databricks bundle init default-python      # Initialize new project
        LOG.setup:   databricks bundle deploy --target dev      # Deploy to development
        LOG.setup:   databricks bundle run my_job               # Run jobs/pipelines
        LOG.setup:   databricks bundle deploy --target prod     # Deploy to production
        LOG.setup: 
        LOG.setup: Import existing resources:
        LOG.setup:   databricks bundle generate job --existing-job-id 123 --key my_job # Generate job configuration
        LOG.setup:   databricks bundle deployment bind my_job 123                      # Link to an existing job
        LOG.setup: 
        LOG.setup: Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.html
        LOG.setup: 
        LOG.setup: Usage:
        LOG.setup:   databricks bundle [command]
        LOG.setup: 
        LOG.setup: Available Commands:
        LOG.setup:   deploy             Deploy bundle
        LOG.setup:   deployment         Deployment related commands
        LOG.setup:   destroy            Destroy deployed bundle resources
        LOG.setup:   generate           Generate bundle configuration
        LOG.setup:   init               Initialize using a bundle template
        LOG.setup:   open               Open a resource in the browser
        LOG.setup:   plan               Show deployment plan
        LOG.setup:   run                Run a job, pipeline update or app
        LOG.setup:   schema             Generate JSON Schema for bundle configuration
        LOG.setup:   summary            Summarize resources deployed by this bundle
        LOG.setup:   sync               Synchronize bundle tree to the workspace
        LOG.setup:   validate           Validate configuration
        LOG.setup: 
        LOG.setup: Flags:
        LOG.setup:   -h, --help[=true|false]   help for bundle
        LOG.setup:       --var strings         set values for variables defined in bundle config. Example: --var="foo=bar"
        LOG.setup: 
        LOG.setup: Global Flags:
        LOG.setup:       --debug[=true|false]   enable debug logging
        LOG.setup:   -o, --output type          output type: text or json (default text)
        LOG.setup:   -p, --profile string       ~/.databrickscfg profile
        LOG.setup:   -t, --target string        bundle target to use (if applicable)
... (45 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.28.0): same output as main (4c4f104)

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: a3949bf

Run: 46397339138

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 173 22 4:06
💚​ aws-windows-latest-4core-16gb 1 173 22 1:37
💚​ azure linux-2core-8gb 1 172 22 3:32
💚​ azure-windows-latest-4core-16gb 1 172 22 1:29
💚​ gcp linux-2core-8gb 1 173 22 3:33
💚​ gcp-windows-latest-4core-16gb 1 173 22 2:18
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
4:06 aws linux-2core-8gb TestAccept
3:27 gcp linux-2core-8gb TestAccept
3:21 azure linux-2core-8gb TestAccept

@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 8008385. Each finding was verified against the code.

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

This adds bundle auto-deploy attempts, which lists a target's attempts or shows one. It comes with the API methods, the models and fake-server support that queues an attempt when a trigger is created. The happy path works. The main gap is that attempts can't reach any attempt after delete, even though the delete help says past attempts are kept, and the fake's list and get routes behave differently for a deleted trigger. The remaining comments are about the test: the stubbed failure case, an inline jq, and no coverage of attempt paging.

return err
}
ctx := cmd.Context()
found, err := findTrigger(ctx, api, t)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] attempts finds the trigger through findTrigger before it lists or gets anything. After bundle auto-deploy delete, that lookup fails with "target dev has no auto-deploy trigger that you can view. To create one, run: … create". But delete's help (delete.go:19) says "The target's past attempts stay", and DeleteWebhookTrigger's doc says the same. Running create again makes a new trigger ID, so the old attempts stay out of reach. After a failed deploy and a delete, the user can't see why the deploy failed. Can attempts be looked up without a live trigger? If not, the delete help should say they can no longer be viewed from the CLI.

Comment thread libs/testserver/gitwebhooks.go Outdated
func (s *FakeWorkspace) GitWebhooksListAttempts(req Request, triggerID string) Response {
defer s.LockUnlock()()

if _, ok := s.GitWebhookTriggers[triggerID]; !ok {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] For a deleted trigger, GitWebhooksListAttempts returns 404 "Webhook trigger … does not exist". GitWebhooksGetAttempt (line 180) still serves that trigger's attempts from GitWebhookAttempts, which the comment says stay after delete. Which of these matches the service? The two routes should behave the same way, so tests against the fake don't encode an API contract that may not exist.

@@ -0,0 +1,20 @@
# The fake has no runner to fail an attempt, so this one is stubbed.
[[Server]]
Pattern = "GET /api/2.0/git-webhooks/webhook-triggers/{trigger_id}/attempts/11111111-1111-4111-8111-111111111111"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] The stub matches any {trigger_id} and returns trigger_id/name for aaaaaaaa-…, not the trigger this test created ([UUID][1]). The fake would never return that body for this request. testing.md asks to model API behavior in libs/testserver/ instead of [[Server]] stubs, and this route is now modelled there. Could the test seed a failed attempt into the fake (for example a helper that sets an attempt's status), so this case goes through the real handler?

Comment thread libs/testserver/gitwebhooks.go Outdated
// attempt stays queued.
if isNew {
attemptID := nextUUID()
s.GitWebhookAttempts[triggerID] = []gitwebhooks.AutoDeployAttempt{{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] Each trigger only ever gets the one attempt queued on create, and a re-upsert queues nothing. So ListAutoDeployAttempts never follows a next_page_token, even with page size 1. The "newest first" order in the help is never checked either. Can the fake queue a second attempt (for example on a push), so the golden shows two rows across two pages, in order?

title "A target without a trigger"
trace musterr $CLI bundle auto-deploy attempts

$CLI bundle auto-deploy create >> LOG.setup 2>&1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] testing.md asks for the acceptance/bin/ helpers instead of inline jq, and recommends gron.py | grep field for single values. Can attempt_id be read with gron.py here instead of jq -r '.[0].attempt_id'?

`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 <no-reply@databricks.com>
Signed-off-by: atreyadbrx <atreya.misra@databricks.com>
@atreyadbrx
atreyadbrx force-pushed the dabs-ad-d4-pr5-delete branch from ac844d0 to c3e275a Compare November 30, 2026 10:07
@atreyadbrx
atreyadbrx force-pushed the dabs-ad-d4-pr6-attempts branch from 367e7fb to a3949bf Compare November 30, 2026 10:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants