Skip to content

aitools: store the consent to install AI tools automatically - #8112

Merged
anton-107 merged 2 commits into
mainfrom
aitools-store-auto-install-consent
Nov 27, 2026
Merged

anton-107 merged 2 commits into
mainfrom
aitools-store-auto-install-consent

Conversation

@anton-107

Copy link
Copy Markdown
Contributor

Changes

The auto-install state file (~/.databricks/aitools/auto-install.json) now records the user's consent alongside the opt-out, as a new consented field. The two values together give one answer per machine: unknown, given or opted out (autoinstall.Consent).

 State
   opted_out
+  consented        # never set together with opted_out

-SetOptedOut(ctx, bool) error
+SetConsent(ctx, Consent) (previous Consent, err error)
+GiveConsentIfUnknown(ctx) (previous Consent, err error)
-Decline(ctx) error
+Decline(ctx) (previous Consent, err error)

Writers of the consent:

Action Stores
databricks aitools auto-install enable consent; replaces an opt-out, as before
databricks aitools auto-install disable, a global uninstall, a "no" to a prompt opt-out, as before
a global-scope databricks aitools install that set at least one agent up consent, unless the user answered before
a "yes" to the skills prompt of databricks apps init consent, unless the user answered before
a run of the auto-install hook that finds global install state written by the CLI consent, unless the user answered before

GiveConsentIfUnknown is for actions that imply consent without asking for it, so it never replaces an earlier opt-out. For the same reason it fails on a state file it can't parse instead of replacing it, because that file may hold an opt-out. SetConsent keeps replacing an unreadable file, as SetOptedOut did, because it records an explicit choice.

The hook infers consent only from install state in the global skills directory. These cases don't count: skills without install state (they may be the user's own copies), a project-scope installation, install state that records only MCP servers, and runs in CI, with the environment opt-out set, or on a development build.

Decide doesn't change. Auto-install runs, skips and prompts exactly as it did before.

Why

Before this change the state could hold only an opt-out. A machine whose user ran auto-install enable, answered "yes", or installed the tools globally looked the same as one whose user had never answered, and enable just cleared the opt-out without writing anything. Storing the answer explicitly lets the CLI tell these machines apart.

The file stays readable by older CLI versions. A consent is a separate field that they ignore, and an opt-out is still opted_out: true, so they read it as before. If the file has both fields set, which only a hand edit can cause, it reads as opted out.

Note for reviewers: changed expectations in existing tests

  • TestAutoInstallFinishesAMixedInstallRefusedTheSkills (cmd/aitools/autoinstall_run_test.go) now expects Consented: true in the state after the second and third runs. The first run leaves CLI-written install state in the global skills directory, and later runs now read that as consent. Only the expected State values changed. The outcomes and the install assertions are the same as before.
  • TestAutoInstallRetriesAnAgentThatGotNoSkills changed the same way, for the same reason.
  • The acceptance outputs under acceptance/cmd/aitools/auto-install/ (enable-disable, skipped, upgrade) now show "consented": true where the CLI stores it.
  • Callers of the old API (SetOptedOut, and Decline, which now also returns the previous answer) were updated, including cmd/apps/init_test.go.

Tests

  • libs/aitools/autoinstall: Consent() covers all combinations of the two fields. Also tested: SetConsent transitions and the previous answer it returns, GiveConsentIfUnknown (unknown, given, opt-out kept, unreadable file left as is), state files as earlier versions write them, and an older reader decoding the new file. Decide has a new case: the environment opt-out wins over a stored consent.
  • cmd/aitools: TestAutoInstallStoresTheConsentOfAnExistingInstall covers each case in which the hook does or doesn't infer consent. In every case nothing else in the state changes and no telemetry is sent. TestInstallStoresTheConsent checks that a global install stores consent, an opt-out is kept, a project install stores nothing, and an install that set no agent up stores nothing.
  • libs/aitools/agents: a "yes" at the apps init prompt stores consent and keeps an earlier opt-out.
  • Acceptance: enable-disable adds the project, global and opt-out-kept install cases, and upgrade shows that the consent is stored on the run after the first auto-install.
  • go test ./libs/aitools/... ./cmd/aitools/... and go test ./acceptance -run TestAccept/cmd/aitools/auto-install pass locally.

## Changes

The auto-install state file (`~/.databricks/aitools/auto-install.json`) now records the user's consent alongside the opt-out, as a new `consented` field. The two values together give one answer per machine: unknown, given or opted out (`autoinstall.Consent`).

```diff
 State
   opted_out
+  consented        # never set together with opted_out

-SetOptedOut(ctx, bool) error
+SetConsent(ctx, Consent) (previous Consent, err error)
+GiveConsentIfUnknown(ctx) (previous Consent, err error)
-Decline(ctx) error
+Decline(ctx) (previous Consent, err error)
```

Writers of the consent:

| Action | Stores |
|---|---|
| `databricks aitools auto-install enable` | consent; replaces an opt-out, as before |
| `databricks aitools auto-install disable`, a global uninstall, a "no" to a prompt | opt-out, as before |
| a global-scope `databricks aitools install` that set at least one agent up | consent, unless the user answered before |
| a "yes" to the skills prompt of `databricks apps init` | consent, unless the user answered before |
| a run of the auto-install hook that finds global install state written by the CLI | consent, unless the user answered before |

`GiveConsentIfUnknown` is for actions that imply consent without asking for it, so it never replaces an earlier opt-out. For the same reason it fails on a state file it can't parse instead of replacing it, because that file may hold an opt-out. `SetConsent` keeps replacing an unreadable file, as `SetOptedOut` did, because it records an explicit choice.

The hook infers consent only from install state in the global skills directory. These cases don't count: skills without install state (they may be the user's own copies), a project-scope installation, install state that records only MCP servers, and runs in CI, with the environment opt-out set, or on a development build.

`Decide` doesn't change. Auto-install runs, skips and prompts exactly as it did before.

## Why

Before this change the state could hold only an opt-out. A machine whose user ran `auto-install enable`, answered "yes", or installed the tools globally looked the same as one whose user had never answered, and `enable` just cleared the opt-out without writing anything. Storing the answer explicitly lets the CLI tell these machines apart.

The file stays readable by older CLI versions. A consent is a separate field that they ignore, and an opt-out is still `opted_out: true`, so they read it as before. If the file has both fields set, which only a hand edit can cause, it reads as opted out.

### Note for reviewers: changed expectations in existing tests

- `TestAutoInstallFinishesAMixedInstallRefusedTheSkills` (`cmd/aitools/autoinstall_run_test.go`) now expects `Consented: true` in the state after the second and third runs. The first run leaves CLI-written install state in the global skills directory, and later runs now read that as consent. Only the expected `State` values changed. The outcomes and the install assertions are the same as before.
- `TestAutoInstallRetriesAnAgentThatGotNoSkills` changed the same way, for the same reason.
- The acceptance outputs under `acceptance/cmd/aitools/auto-install/` (`enable-disable`, `skipped`, `upgrade`) now show `"consented": true` where the CLI stores it.
- Callers of the old API (`SetOptedOut`, and `Decline`, which now also returns the previous answer) were updated, including `cmd/apps/init_test.go`.

## Tests

- `libs/aitools/autoinstall`: `Consent()` covers all combinations of the two fields. Also tested: `SetConsent` transitions and the previous answer it returns, `GiveConsentIfUnknown` (unknown, given, opt-out kept, unreadable file left as is), state files as earlier versions write them, and an older reader decoding the new file. `Decide` has a new case: the environment opt-out wins over a stored consent.
- `cmd/aitools`: `TestAutoInstallStoresTheConsentOfAnExistingInstall` covers each case in which the hook does or doesn't infer consent. In every case nothing else in the state changes and no telemetry is sent. `TestInstallStoresTheConsent` checks that a global install stores consent, an opt-out is kept, a project install stores nothing, and an install that set no agent up stores nothing.
- `libs/aitools/agents`: a "yes" at the `apps init` prompt stores consent and keeps an earlier opt-out.
- Acceptance: `enable-disable` adds the project, global and opt-out-kept install cases, and `upgrade` shows that the consent is stored on the run after the first auto-install.
- `go test ./libs/aitools/... ./cmd/aitools/...` and `go test ./acceptance -run TestAccept/cmd/aitools/auto-install` pass locally.

Co-authored-by: Isaac <no-reply@databricks.com>
@anton-107
anton-107 requested review from a team and lennartkats-db as code owners November 27, 2026 11:31
@github-actions github-actions Bot added the aitools AI tools (databricks aitools) related changes label Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: 6175820aa | Workflow run

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

6 tests: regression=6 unreleased=0 coverage=0 failing=0
test branch main (b7f1abc) latest (v1.28.0)
TestAccept/cmd/aitools/auto-install/enable-disable ✅ ❌ ❌
TestAccept/cmd/aitools/auto-install/first-run ✅ ❌ ❌
TestAccept/cmd/aitools/auto-install/no-terminal ✅ ❌ ❌
TestAccept/cmd/aitools/auto-install/retries ✅ ❌ ❌
TestAccept/cmd/aitools/auto-install/skipped ✅ ❌ ❌
TestAccept/cmd/aitools/auto-install/upgrade ✅ ❌ ❌
TestAccept/cmd/aitools/auto-install/enable-disable: branch ✅ | main (b7f1abc) ❌ | latest (v1.28.0) ❌

main (b7f1abc):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:35601" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:35601" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/enable-disable/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installenable-disable1311697705/002/output.txt
        @@ -20,9 +20,7 @@
         Automatic installation of Databricks AI tools is enabled.
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === enable says when the environment still turns it off
         
        @@ -48,9 +46,7 @@
         Exit code: 1
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === a global uninstall of a mistyped skill leaves it on
         
        @@ -60,9 +56,7 @@
         Exit code: 1
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === a global uninstall turns it off
         
        @@ -80,9 +74,7 @@
         Uninstalled 1 skill.
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === a project install stores no consent
         
        @@ -92,9 +84,7 @@
         === a global install stores the consent
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +(no auto-install state)
         
         === a global install keeps an opt-out
         
        
    acceptance_test.go:1180: LOG.enable-reset-1: Automatic installation of Databricks AI tools is enabled.
    acceptance_test.go:1180: LOG.enable-reset-2: Automatic installation of Databricks AI tools is enabled.
    acceptance_test.go:1180: 
        LOG.install-global: Installing Databricks skills for Cursor...
        LOG.install-global: Using skills version test-ref
        LOG.install-global: Fetching skills manifest...
        LOG.install-global: Installed 1 skill in /tmp/TestAcceptcmdaitoolsauto-installenable-disable1311697705/001/home/.databricks/aitools/skills.

latest (v1.28.0):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:39285" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:39285" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/enable-disable/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installenable-disable4194912685/002/output.txt
        @@ -20,9 +20,7 @@
         Automatic installation of Databricks AI tools is enabled.
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === enable says when the environment still turns it off
         
        @@ -48,9 +46,7 @@
         Exit code: 1
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === a global uninstall of a mistyped skill leaves it on
         
        @@ -60,9 +56,7 @@
         Exit code: 1
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === a global uninstall turns it off
         
        @@ -80,9 +74,7 @@
         Uninstalled 1 skill.
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +{}
         
         === a project install stores no consent
         
        @@ -92,9 +84,7 @@
         === a global install stores the consent
         
         >>> auto_install_state
        -{
        -  "consented": true
        -}
        +(no auto-install state)
         
         === a global install keeps an opt-out
         
        
    acceptance_test.go:1180: LOG.enable-reset-1: Automatic installation of Databricks AI tools is enabled.
    acceptance_test.go:1180: LOG.enable-reset-2: Automatic installation of Databricks AI tools is enabled.
    acceptance_test.go:1180: 
        LOG.install-global: Installing Databricks skills for Cursor...
        LOG.install-global: Using skills version test-ref
        LOG.install-global: Fetching skills manifest...
        LOG.install-global: Installed 1 skill in /tmp/TestAcceptcmdaitoolsauto-installenable-disable4194912685/001/home/.databricks/aitools/skills.
TestAccept/cmd/aitools/auto-install/first-run: branch ✅ | main (b7f1abc) ❌ | latest (v1.28.0) ❌

main (b7f1abc):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:44829" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:44829" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/first-run/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installfirst-run269046199/002/output.txt
        @@ -14,7 +14,6 @@
         >>> auto_install_state
         {
           "last_version": "1.30.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -57,7 +56,7 @@
         my own skill
         
         >>> settled_version
        -{"last_version":"1.30.0","installed_without_consent":true}
        +{"last_version":"1.30.0"}
         
         === first run with the user's own skill under another name in an agent's skills directory: installs

latest (v1.28.0):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:41151" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:41151" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/first-run/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installfirst-run1293788256/002/output.txt
        @@ -14,7 +14,6 @@
         >>> auto_install_state
         {
           "last_version": "1.30.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -42,22 +41,26 @@
         === first run with a skill placed by hand in an agent's skills directory: kept, nothing printed, not retried for this version
         
         >>> [CLI] jobs list
        +Installed Databricks AI tools for Cursor. Disable: databricks aitools auto-install disable
         
         >>> auto_install_outcome
        -KEPT
        +INSTALLED
         
         >>> cursor_skills
         databricks-test
         
         >>> hand_placed_files
        -NOTES.md
         SKILL.md
         
         >>> cat [TEST_TMP_DIR]/hand-placed-home/.cursor/skills/databricks-test/SKILL.md
        -my own skill
        +---
        +name: databricks-test
        +---
         
        +# Test skill
        +
         >>> settled_version
        -{"last_version":"1.30.0","installed_without_consent":true}
        +{"last_version":"1.30.0"}
         
         === first run with the user's own skill under another name in an agent's skills directory: installs
TestAccept/cmd/aitools/auto-install/no-terminal: branch ✅ | main (b7f1abc) ❌ | latest (v1.28.0) ❌

main (b7f1abc):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:33297" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:33297" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:686
        	Error:      	Not equal: 
        	            	expected: "\n=== no terminal and no coding agent: cannot ask, so nothing is installed or reported, and the version is not settled\n\n>>> [CLI] jobs list\n\n>>> print_telemetry\n\n>>> cursor_skills\n(no skills)\n\n>>> auto_install_state\n{\"id\": \"treatment-machine\"}\n\n=== the version is still due: a coding agent's call installs without asking\n\n>>> AGENT=test-agent [CLI] jobs list\nInstalled Databricks AI tools for Cursor. Disable: databricks aitools auto-install disable\n\n>>> print_telemetry\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_install_event\":{\"agents\":[\"CURSOR\"],\"scope\":\"GLOBAL\",\"error_category\":\"TYPE_UNSPECIFIED\",\"trigger\":\"AUTO_FIRST_RUN\"}}\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_auto_install_event\":{\"outcome\":\"INSTALLED\",\"holdout_arm\":\"TREATMENT\",\"interactive\":false}}\n\n>>> cursor_skills\ndatabricks-test\n\n>>> auto_install_state\n{\n  \"last_version\": \"1.30.0\",\n  \"installed_without_consent\": true,\n  \"id\": \"treatment-machine\"\n}\n"
        	            	actual  : "\n=== no terminal and no coding agent: cannot ask, so nothing is installed or reported, and the version is not settled\n\n>>> [CLI] jobs list\n\n>>> print_telemetry\n\n>>> cursor_skills\n(no skills)\n\n>>> auto_install_state\n{\"id\": \"treatment-machine\"}\n\n=== the version is still due: a coding agent's call installs without asking\n\n>>> AGENT=test-agent [CLI] jobs list\nInstalled Databricks AI tools for Cursor. Disable: databricks aitools auto-install disable\n\n>>> print_telemetry\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_install_event\":{\"agents\":[\"CURSOR\"],\"scope\":\"GLOBAL\",\"error_category\":\"TYPE_UNSPECIFIED\",\"trigger\":\"AUTO_FIRST_RUN\"}}\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_auto_install_event\":{\"outcome\":\"INSTALLED\",\"holdout_arm\":\"TREATMENT\",\"interactive\":false}}\n\n>>> cursor_skills\ndatabricks-test\n\n>>> auto_install_state\n{\n  \"last_version\": \"1.30.0\",\n  \"id\": \"treatment-machine\"\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -28,3 +28,2 @@
        	            	   "last_version": "1.30.0",
        	            	-  "installed_without_consent": true,
        	            	   "id": "treatment-machine"
        	Test:       	TestAccept/cmd/aitools/auto-install/no-terminal
        	Messages:   	cmd/aitools/auto-install/no-terminal/output.txt vs /tmp/TestAcceptcmdaitoolsauto-installno-terminal3020941354/002/output.txt

latest (v1.28.0):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:44331" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:44331" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:686
        	Error:      	Not equal: 
        	            	expected: "\n=== no terminal and no coding agent: cannot ask, so nothing is installed or reported, and the version is not settled\n\n>>> [CLI] jobs list\n\n>>> print_telemetry\n\n>>> cursor_skills\n(no skills)\n\n>>> auto_install_state\n{\"id\": \"treatment-machine\"}\n\n=== the version is still due: a coding agent's call installs without asking\n\n>>> AGENT=test-agent [CLI] jobs list\nInstalled Databricks AI tools for Cursor. Disable: databricks aitools auto-install disable\n\n>>> print_telemetry\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_install_event\":{\"agents\":[\"CURSOR\"],\"scope\":\"GLOBAL\",\"error_category\":\"TYPE_UNSPECIFIED\",\"trigger\":\"AUTO_FIRST_RUN\"}}\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_auto_install_event\":{\"outcome\":\"INSTALLED\",\"holdout_arm\":\"TREATMENT\",\"interactive\":false}}\n\n>>> cursor_skills\ndatabricks-test\n\n>>> auto_install_state\n{\n  \"last_version\": \"1.30.0\",\n  \"installed_without_consent\": true,\n  \"id\": \"treatment-machine\"\n}\n"
        	            	actual  : "\n=== no terminal and no coding agent: cannot ask, so nothing is installed or reported, and the version is not settled\n\n>>> [CLI] jobs list\n\n>>> print_telemetry\n\n>>> cursor_skills\n(no skills)\n\n>>> auto_install_state\n{\"id\": \"treatment-machine\"}\n\n=== the version is still due: a coding agent's call installs without asking\n\n>>> AGENT=test-agent [CLI] jobs list\nInstalled Databricks AI tools for Cursor. Disable: databricks aitools auto-install disable\n\n>>> print_telemetry\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_install_event\":{\"agents\":[\"CURSOR\"],\"scope\":\"GLOBAL\",\"error_category\":\"TYPE_UNSPECIFIED\",\"trigger\":\"AUTO_FIRST_RUN\"}}\n{\"command\":\"jobs_list\",\"exit_code\":0,\"aitools_auto_install_event\":{\"outcome\":\"INSTALLED\",\"holdout_arm\":\"TREATMENT\",\"interactive\":false}}\n\n>>> cursor_skills\ndatabricks-test\n\n>>> auto_install_state\n{\n  \"last_version\": \"1.30.0\",\n  \"id\": \"treatment-machine\"\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -28,3 +28,2 @@
        	            	   "last_version": "1.30.0",
        	            	-  "installed_without_consent": true,
        	            	   "id": "treatment-machine"
        	Test:       	TestAccept/cmd/aitools/auto-install/no-terminal
        	Messages:   	cmd/aitools/auto-install/no-terminal/output.txt vs /tmp/TestAcceptcmdaitoolsauto-installno-terminal3510677737/002/output.txt
TestAccept/cmd/aitools/auto-install/retries: branch ✅ | main (b7f1abc) ❌ | latest (v1.28.0) ❌

main (b7f1abc):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:35305" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:35305" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/retries/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installretries3221796469/002/output.txt
        @@ -15,7 +15,6 @@
           "attempts": 1,
           "last_attempt": "[LAST_ATTEMPT]",
           "installing": true,
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -52,6 +51,5 @@
         >>> auto_install_state
         {
           "last_version": "1.31.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }

latest (v1.28.0):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:35517" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:35517" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/retries/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installretries371448086/002/output.txt
        @@ -15,7 +15,6 @@
           "attempts": 1,
           "last_attempt": "[LAST_ATTEMPT]",
           "installing": true,
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -52,6 +51,5 @@
         >>> auto_install_state
         {
           "last_version": "1.31.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
TestAccept/cmd/aitools/auto-install/skipped: branch ✅ | main (b7f1abc) ❌ | latest (v1.28.0) ❌

main (b7f1abc):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:34929" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:34929" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/skipped/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installskipped4024627311/002/output.txt
        @@ -53,7 +53,6 @@
         >>> auto_install_state
         {
           "last_version": "1.32.0",
        -  "consented": true,
           "id": "treatment-machine"
         }
         
        @@ -69,7 +68,6 @@
         >>> auto_install_state
         {
           "last_version": "1.33.0",
        -  "consented": true,
           "id": "treatment-machine"
         }
         
        
    acceptance_test.go:1180: 
        LOG.complete: jobs	The Jobs API allows you to create, edit, and delete jobs.
        LOG.complete: :4
        LOG.complete: Completion ended with directive: ShellCompDirectiveNoFileComp
    acceptance_test.go:1180: 
        LOG.completion: # bash completion V2 for databricks                           -*- shell-script -*-
        LOG.completion: 
        LOG.completion: __databricks_debug()
        LOG.completion: {
        LOG.completion:     if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
        LOG.completion:         echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
        LOG.completion:     fi
        LOG.completion: }
        LOG.completion: 
        LOG.completion: # Macs have bash3 for which the bash-completion package doesn't include
        LOG.completion: # _init_completion. This is a minimal version of that function.
        LOG.completion: __databricks_init_completion()
        LOG.completion: {
        LOG.completion:     COMPREPLY=()
        LOG.completion:     _get_comp_words_by_ref "$@" cur prev words cword
        LOG.completion: }
        LOG.completion: 
        LOG.completion: # This function calls the databricks program to obtain the completion
        LOG.completion: # results and the directive.  It fills the 'out' and 'directive' vars.
        LOG.completion: __databricks_get_completion_results() {
        LOG.completion:     local requestComp lastParam lastChar args
        LOG.completion: 
        LOG.completion:     # Prepare the command to request completions for the program.
        LOG.completion:     # Calling ${words[0]} instead of directly databricks allows handling aliases
        LOG.completion:     args=("${words[@]:1}")
        LOG.completion:     requestComp="${words[0]} __complete ${args[*]}"
        LOG.completion: 
        LOG.completion:     lastParam=${words[$((${#words[@]}-1))]}
        LOG.completion:     lastChar=${lastParam:$((${#lastParam}-1)):1}
        LOG.completion:     __databricks_debug "lastParam ${lastParam}, lastChar ${lastChar}"
        LOG.completion: 
        LOG.completion:     if [[ -z ${cur} && ${lastChar} != = ]]; then
        LOG.completion:         # If the last parameter is complete (there is a space following it)
        LOG.completion:         # We add an extra empty parameter so we can indicate this to the go method.
        LOG.completion:         __databricks_debug "Adding extra empty parameter"
        LOG.completion:         requestComp="${requestComp} ''"
        LOG.completion:     fi
        LOG.completion: 
        LOG.completion:     # When completing a flag with an = (e.g., databricks -n=<TAB>)
        LOG.completion:     # bash focuses on the part after the =, so we need to remove
        LOG.completion:     # the flag part from $cur
        LOG.completion:     if [[ ${cur} == -*=* ]]; then
        LOG.completion:         cur="${cur#*=}"
        LOG.completion:     fi
        LOG.completion: 
        LOG.completion:     __databricks_debug "Calling ${requestComp}"
        LOG.completion:     # Use eval to handle any environment variables and such
        LOG.completion:     out=$(eval "${requestComp}" 2>/dev/null)
        LOG.completion: 
        LOG.completion:     # Extract the directive integer at the very end of the output following a colon (:)
        LOG.completion:     directive=${out##*:}
        LOG.completion:     # Remove the directive
        LOG.completion:     out=${out%:*}
        LOG.completion:     if [[ ${directive} == "${out}" ]]; then
        LOG.completion:         # There is not directive specified
        LOG.completion:         directive=0
        LOG.completion:     fi
        LOG.completion:     __databricks_debug "The completion directive is: ${directive}"
        LOG.completion:     __databricks_debug "The completions are: ${out}"
        LOG.completion: }
        LOG.completion: 
        LOG.completion: __databricks_process_completion_results() {
        LOG.completion:     local shellCompDirectiveError=1
        LOG.completion:     local shellCompDirectiveNoSpace=2
        LOG.completion:     local shellCompDirectiveNoFileComp=4
        LOG.completion:     local shellCompDirectiveFilterFileExt=8
        LOG.completion:     local shellCompDirectiveFilterDirs=16
        LOG.completion:     local shellCompDirectiveKeepOrder=32
        LOG.completion: 
        LOG.completion:     if (((directive & shellCompDirectiveError) != 0)); then
        LOG.completion:         # Error code.  No completion.
        LOG.completion:         __databricks_debug "Received error from custom completion go code"
        LOG.completion:         return
        LOG.completion:     else
        LOG.completion:         if (((directive & shellCompDirectiveNoSpace) != 0)); then
        LOG.completion:             if [[ $(type -t compopt) == builtin ]]; then
        LOG.completion:                 __databricks_debug "Activating no space"
        LOG.completion:                 compopt -o nospace
        LOG.completion:             else
        LOG.completion:                 __databricks_debug "No space directive not supported in this version of bash"
        LOG.completion:             fi
        LOG.completion:         fi
        LOG.completion:         if (((directive & shellCompDirectiveKeepOrder) != 0)); then
        LOG.completion:             if [[ $(type -t compopt) == builtin ]]; then
        LOG.completion:                 # no sort isn't supported for bash less than < 4.4
        LOG.completion:                 if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then
        LOG.completion:                     __databricks_debug "No sort directive not supported in this version of bash"
        LOG.completion:                 else
        LOG.completion:                     __databricks_debug "Activating keep order"
        LOG.completion:                     compopt -o nosort
        LOG.completion:                 fi
        LOG.completion:             else
        LOG.completion:                 __databricks_debug "No sort directive not supported in this version of bash"
        LOG.completion:             fi
        LOG.completion:         fi
        LOG.completion:         if (((directive & shellCompDirectiveNoFileComp) != 0)); then
        LOG.completion:             if [[ $(type -t compopt) == builtin ]]; then
        LOG.completion:                 __databricks_debug "Activating no file completion"
        LOG.completion:                 compopt +o default
        LOG.completion:             else
        LOG.completion: ... (326 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
    acceptance_test.go:1180: 
        LOG.help: The Jobs API allows you to create, edit, and delete jobs.
        LOG.help: 
        LOG.help:   You can use a Databricks job to run a data processing or data analysis task in
        LOG.help:   a Databricks cluster with scalable resources. Your job can consist of a single
        LOG.help:   task or can be a large, multi-task workflow with complex dependencies.
        LOG.help:   Databricks manages the task orchestration, cluster management, monitoring, and
        LOG.help:   error reporting for all of your jobs. You can run your jobs immediately or
        LOG.help:   periodically through an easy-to-use scheduling system. You can implement job
        LOG.help:   tasks using notebooks, JARS, Spark Declarative Pipelines, or Python, Scala,
        LOG.help:   Spark submit, and Java applications.
        LOG.help: 
        LOG.help:   You should never hard code secrets or store them in plain text. Use the
        LOG.help:   [Secrets CLI] to manage secrets in the [Databricks CLI]. Use the [Secrets
        LOG.help:   utility] to reference secrets in notebooks and jobs.
        LOG.help: 
        LOG.help:   [Databricks CLI]: https://docs.databricks.com/dev-tools/cli/index.html
        LOG.help:   [Secrets CLI]: https://docs.databricks.com/dev-tools/cli/secrets-cli.html
        LOG.help:   [Secrets utility]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-secrets
        LOG.help: 
        LOG.help: Usage:
        LOG.help:   databricks jobs [flags]
        LOG.help:   databricks jobs [command]
        LOG.help: 
        LOG.help: Main Commands
        LOG.help:   cancel-all-runs       Cancel all runs of a job.
        LOG.help:   cancel-run            Cancel a run.
        LOG.help:   create                Create a new job.
        LOG.help:   delete                Delete a job.
        LOG.help:   delete-run            Delete a job run.
        LOG.help:   export-run            Export and retrieve a job run.
        LOG.help:   get                   Get a single job.
        LOG.help:   get-run               Get a single job run.
        LOG.help:   get-run-output        Get the output for a single run.
        LOG.help:   list                  List jobs.
        LOG.help:   list-runs             List job runs.
        LOG.help:   repair-run            Repair a job run.
        LOG.help:   reset                 Update all job settings (reset).
        LOG.help:   run-now               Trigger a new job run.
        LOG.help:   submit                Create and trigger a one-time run.
        LOG.help:   update                Update job settings partially.
        LOG.help: 
        LOG.help: Permission Commands
        LOG.help:   get-permission-levels Get job permission levels.
        LOG.help:   get-permissions       Get job permissions.
        LOG.help:   set-permissions       Set job permissions.
        LOG.help:   update-permissions    Update job permissions.
        LOG.help: 
        LOG.help: Flags:
        LOG.help:   -h, --help[=true|false]   help for jobs
        LOG.help: 
        LOG.help: Global Flags:
        LOG.help:       --debug[=true|false]   enable debug logging
        LOG.help:   -o, --output type          output type: text or json (default text)
        LOG.help:   -p, --profile string       ~/.databrickscfg profile
        LOG.help:   -t, --target string        bundle target to use (if applicable)
        LOG.help: 
        LOG.help: Use "databricks jobs [command] --help" for more information about a command.
FAIL

latest (v1.28.0):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:44741" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:44741" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/skipped/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installskipped2911996747/002/output.txt
        @@ -53,7 +53,6 @@
         >>> auto_install_state
         {
           "last_version": "1.32.0",
        -  "consented": true,
           "id": "treatment-machine"
         }
         
        @@ -69,7 +68,6 @@
         >>> auto_install_state
         {
           "last_version": "1.33.0",
        -  "consented": true,
           "id": "treatment-machine"
         }
         
        
    acceptance_test.go:1180: 
        LOG.complete: jobs	The Jobs API allows you to create, edit, and delete jobs.
        LOG.complete: :4
        LOG.complete: Completion ended with directive: ShellCompDirectiveNoFileComp
    acceptance_test.go:1180: 
        LOG.completion: # bash completion V2 for databricks                           -*- shell-script -*-
        LOG.completion: 
        LOG.completion: __databricks_debug()
        LOG.completion: {
        LOG.completion:     if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
        LOG.completion:         echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
        LOG.completion:     fi
        LOG.completion: }
        LOG.completion: 
        LOG.completion: # Macs have bash3 for which the bash-completion package doesn't include
        LOG.completion: # _init_completion. This is a minimal version of that function.
        LOG.completion: __databricks_init_completion()
        LOG.completion: {
        LOG.completion:     COMPREPLY=()
        LOG.completion:     _get_comp_words_by_ref "$@" cur prev words cword
        LOG.completion: }
        LOG.completion: 
        LOG.completion: # This function calls the databricks program to obtain the completion
        LOG.completion: # results and the directive.  It fills the 'out' and 'directive' vars.
        LOG.completion: __databricks_get_completion_results() {
        LOG.completion:     local requestComp lastParam lastChar args
        LOG.completion: 
        LOG.completion:     # Prepare the command to request completions for the program.
        LOG.completion:     # Calling ${words[0]} instead of directly databricks allows handling aliases
        LOG.completion:     args=("${words[@]:1}")
        LOG.completion:     requestComp="${words[0]} __complete ${args[*]}"
        LOG.completion: 
        LOG.completion:     lastParam=${words[$((${#words[@]}-1))]}
        LOG.completion:     lastChar=${lastParam:$((${#lastParam}-1)):1}
        LOG.completion:     __databricks_debug "lastParam ${lastParam}, lastChar ${lastChar}"
        LOG.completion: 
        LOG.completion:     if [[ -z ${cur} && ${lastChar} != = ]]; then
        LOG.completion:         # If the last parameter is complete (there is a space following it)
        LOG.completion:         # We add an extra empty parameter so we can indicate this to the go method.
        LOG.completion:         __databricks_debug "Adding extra empty parameter"
        LOG.completion:         requestComp="${requestComp} ''"
        LOG.completion:     fi
        LOG.completion: 
        LOG.completion:     # When completing a flag with an = (e.g., databricks -n=<TAB>)
        LOG.completion:     # bash focuses on the part after the =, so we need to remove
        LOG.completion:     # the flag part from $cur
        LOG.completion:     if [[ ${cur} == -*=* ]]; then
        LOG.completion:         cur="${cur#*=}"
        LOG.completion:     fi
        LOG.completion: 
        LOG.completion:     __databricks_debug "Calling ${requestComp}"
        LOG.completion:     # Use eval to handle any environment variables and such
        LOG.completion:     out=$(eval "${requestComp}" 2>/dev/null)
        LOG.completion: 
        LOG.completion:     # Extract the directive integer at the very end of the output following a colon (:)
        LOG.completion:     directive=${out##*:}
        LOG.completion:     # Remove the directive
        LOG.completion:     out=${out%:*}
        LOG.completion:     if [[ ${directive} == "${out}" ]]; then
        LOG.completion:         # There is not directive specified
        LOG.completion:         directive=0
        LOG.completion:     fi
        LOG.completion:     __databricks_debug "The completion directive is: ${directive}"
        LOG.completion:     __databricks_debug "The completions are: ${out}"
        LOG.completion: }
        LOG.completion: 
        LOG.completion: __databricks_process_completion_results() {
        LOG.completion:     local shellCompDirectiveError=1
        LOG.completion:     local shellCompDirectiveNoSpace=2
        LOG.completion:     local shellCompDirectiveNoFileComp=4
        LOG.completion:     local shellCompDirectiveFilterFileExt=8
        LOG.completion:     local shellCompDirectiveFilterDirs=16
        LOG.completion:     local shellCompDirectiveKeepOrder=32
        LOG.completion: 
        LOG.completion:     if (((directive & shellCompDirectiveError) != 0)); then
        LOG.completion:         # Error code.  No completion.
        LOG.completion:         __databricks_debug "Received error from custom completion go code"
        LOG.completion:         return
        LOG.completion:     else
        LOG.completion:         if (((directive & shellCompDirectiveNoSpace) != 0)); then
        LOG.completion:             if [[ $(type -t compopt) == builtin ]]; then
        LOG.completion:                 __databricks_debug "Activating no space"
        LOG.completion:                 compopt -o nospace
        LOG.completion:             else
        LOG.completion:                 __databricks_debug "No space directive not supported in this version of bash"
        LOG.completion:             fi
        LOG.completion:         fi
        LOG.completion:         if (((directive & shellCompDirectiveKeepOrder) != 0)); then
        LOG.completion:             if [[ $(type -t compopt) == builtin ]]; then
        LOG.completion:                 # no sort isn't supported for bash less than < 4.4
        LOG.completion:                 if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then
        LOG.completion:                     __databricks_debug "No sort directive not supported in this version of bash"
        LOG.completion:                 else
        LOG.completion:                     __databricks_debug "Activating keep order"
        LOG.completion:                     compopt -o nosort
        LOG.completion:                 fi
        LOG.completion:             else
        LOG.completion:                 __databricks_debug "No sort directive not supported in this version of bash"
        LOG.completion:             fi
        LOG.completion:         fi
        LOG.completion:         if (((directive & shellCompDirectiveNoFileComp) != 0)); then
        LOG.completion:             if [[ $(type -t compopt) == builtin ]]; then
        LOG.completion:                 __databricks_debug "Activating no file completion"
        LOG.completion:                 compopt +o default
        LOG.completion:             else
        LOG.completion: ... (326 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
    acceptance_test.go:1180: 
        LOG.help: The Jobs API allows you to create, edit, and delete jobs.
        LOG.help: 
        LOG.help:   You can use a Databricks job to run a data processing or data analysis task in
        LOG.help:   a Databricks cluster with scalable resources. Your job can consist of a single
        LOG.help:   task or can be a large, multi-task workflow with complex dependencies.
        LOG.help:   Databricks manages the task orchestration, cluster management, monitoring, and
        LOG.help:   error reporting for all of your jobs. You can run your jobs immediately or
        LOG.help:   periodically through an easy-to-use scheduling system. You can implement job
        LOG.help:   tasks using notebooks, JARS, Spark Declarative Pipelines, or Python, Scala,
        LOG.help:   Spark submit, and Java applications.
        LOG.help: 
        LOG.help:   You should never hard code secrets or store them in plain text. Use the
        LOG.help:   [Secrets CLI] to manage secrets in the [Databricks CLI]. Use the [Secrets
        LOG.help:   utility] to reference secrets in notebooks and jobs.
        LOG.help: 
        LOG.help:   [Databricks CLI]: https://docs.databricks.com/dev-tools/cli/index.html
        LOG.help:   [Secrets CLI]: https://docs.databricks.com/dev-tools/cli/secrets-cli.html
        LOG.help:   [Secrets utility]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-secrets
        LOG.help: 
        LOG.help: Usage:
        LOG.help:   databricks jobs [flags]
        LOG.help:   databricks jobs [command]
        LOG.help: 
        LOG.help: Main Commands
        LOG.help:   cancel-all-runs       Cancel all runs of a job.
        LOG.help:   cancel-run            Cancel a run.
        LOG.help:   create                Create a new job.
        LOG.help:   delete                Delete a job.
        LOG.help:   delete-run            Delete a job run.
        LOG.help:   export-run            Export and retrieve a job run.
        LOG.help:   get                   Get a single job.
        LOG.help:   get-run               Get a single job run.
        LOG.help:   get-run-output        Get the output for a single run.
        LOG.help:   list                  List jobs.
        LOG.help:   list-runs             List job runs.
        LOG.help:   repair-run            Repair a job run.
        LOG.help:   reset                 Update all job settings (reset).
        LOG.help:   run-now               Trigger a new job run.
        LOG.help:   submit                Create and trigger a one-time run.
        LOG.help:   update                Update job settings partially.
        LOG.help: 
        LOG.help: Permission Commands
        LOG.help:   get-permission-levels Get job permission levels.
        LOG.help:   get-permissions       Get job permissions.
        LOG.help:   set-permissions       Set job permissions.
        LOG.help:   update-permissions    Update job permissions.
        LOG.help: 
        LOG.help: Flags:
        LOG.help:   -h, --help[=true|false]   help for jobs
        LOG.help: 
        LOG.help: Global Flags:
        LOG.help:       --debug[=true|false]   enable debug logging
        LOG.help:   -o, --output type          output type: text or json (default text)
        LOG.help:   -p, --profile string       ~/.databrickscfg profile
        LOG.help:   -t, --target string        bundle target to use (if applicable)
        LOG.help: 
        LOG.help: Use "databricks jobs [command] --help" for more information about a command.
FAIL
TestAccept/cmd/aitools/auto-install/upgrade: branch ✅ | main (b7f1abc) ❌ | latest (v1.28.0) ❌

main (b7f1abc):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:42487" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:42487" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/upgrade/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installupgrade3720387887/002/output.txt
        @@ -16,7 +16,6 @@
         >>> auto_install_state
         {
           "last_version": "1.30.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -47,7 +46,6 @@
         >>> auto_install_state
         {
           "last_version": "1.31.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -64,7 +62,6 @@
         >>> auto_install_state
         {
           "last_version": "1.32.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -77,7 +74,6 @@
         >>> auto_install_state
         {
           "last_version": "1.32.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -104,6 +100,5 @@
         >>> auto_install_state
         {
           "last_version": "1.33.0",
        -  "consented": true,
           "id": "treatment-machine"
         }

latest (v1.28.0):

acceptance_test.go:1270: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:32791" ("[DATABRICKS_HOST]")
    acceptance_test.go:1270: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:32791" ("[DATABRICKS_HOST]")
    acceptance_test.go:1402: Diff:
        --- cmd/aitools/auto-install/upgrade/output.txt
        +++ /tmp/TestAcceptcmdaitoolsauto-installupgrade2804254426/002/output.txt
        @@ -16,7 +16,6 @@
         >>> auto_install_state
         {
           "last_version": "1.30.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -47,7 +46,6 @@
         >>> auto_install_state
         {
           "last_version": "1.31.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -64,7 +62,6 @@
         >>> auto_install_state
         {
           "last_version": "1.32.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -77,7 +74,6 @@
         >>> auto_install_state
         {
           "last_version": "1.32.0",
        -  "installed_without_consent": true,
           "id": "treatment-machine"
         }
         
        @@ -104,6 +100,5 @@
         >>> auto_install_state
         {
           "last_version": "1.33.0",
        -  "consented": true,
           "id": "treatment-machine"
         }

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

Not ready yet: 1 blocking issue(s), tagged [blocking].

This PR adds a consented field to the auto-install state, alongside the opt-out. enable, global installs, the apps init "yes" and the auto-install hook now write it. The blocking problem is that the hook also counts install state written by auto-install's own silent install as consent. After one unprompted run under a coding agent, the next run stores consented: true for a user who was never asked, and that wrong value stays in the file. Also below: the auto-install prompt's own "yes" stores nothing, a dead assignment, and an extra file read on every command.

if existing == nil {
return
}
previous, err := autoinstall.GiveConsentIfUnknown(ctx)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[blocking] Here consentExistingInstall treats any CLI-written global .state.json as consent, including state written by auto-install itself. Under a coding agent, autoInstallAsks() is false, so auto-install runs without asking. The upgrade golden shows the result: the 1.30.0 run installs without asking and stores no consent, and the 1.31.0 run stores "consented": true. TestAutoInstallRetriesAnAgentThatGotNoSkills and TestAutoInstallFinishesAMixedInstallRefusedTheSkills show the same for state left by an unfinished first install. That contradicts the State.Consented doc ("the user agreed"), and once written, the value can't be told apart from a real answer. Can we skip install state that auto-install wrote? For example, infer consent only when no auto-install run has happened yet (in.State.LastVersion == ""), or record when the install state came from an explicit install.

// "no" to the skills prompt of `databricks apps init`.
OptedOut bool `json:"opted_out,omitempty"`

// Consented records that the user agreed to installing the tools and

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 auto-install prompt is the one question that asks about auto-install directly, but its "yes" (autoInstallRun.ask in cmd/aitools/autoinstall_run.go) only calls Accept, while its "no" now goes through Decline and stores the opt-out. A "yes" followed by a failed or refused install leaves consent unknown, while the apps init "yes" stores it before installing. Should the "yes" branch call GiveConsentIfUnknown too, and should this doc list it as a writer?

log.Debugf(ctx, "auto-install: skipped: %v", err)
return nil
}
consentExistingInstall(ctx, &in)

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] This now runs before the !reason.Due() return. On a settled machine (ReasonAlreadyRan) whose consent is unknown, every command also resolves GlobalSkillsDir and reads the global .state.json, which the base skipped. Machines that never installed globally stay unknown forever, so they pay this on every command. Can this move after the Due() check, or is inferring consent on runs that do nothing worth the cost?

// An opt-out stored since the state was read stays, and the run finds it
// when it reads the state again under the run lock.
if previous != autoinstall.ConsentOptedOut {
in.State.Consented = true

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] Nothing reads this. Decide doesn't look at Consented, and in.State is reloaded under the run lock (line 219) before the run acts on it. Drop the assignment, along with "in.State gets the stored consent" in the doc comment, unless something is meant to read it.

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 6175820

Run: 46001040971

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 176 23 4:27
💚​ aws-windows-latest-4core-16gb 1 176 23 3:11
💚​ azure linux-2core-8gb 1 175 23 4:26
💚​ azure-windows-latest-4core-16gb 1 175 23 7:27
💚​ gcp linux-2core-8gb 1 176 23 4:36
💚​ gcp-windows-latest-4core-16gb 1 176 23 3:28
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 6 slowest tests (at least 2 minutes):
duration env testname
7:25 azure-windows-latest-4core-16gb TestAccept
4:13 gcp linux-2core-8gb TestAccept
3:44 aws linux-2core-8gb TestAccept
3:37 azure linux-2core-8gb TestAccept
3:23 gcp-windows-latest-4core-16gb TestAccept
3:09 aws-windows-latest-4core-16gb TestAccept

Comment thread cmd/aitools/autoinstall_run.go Resolved
Comment thread libs/aitools/autoinstall/state.go Resolved
Auto-install marks a first install it starts before the user answered, and
the consent inference skips install state it wrote that way or left
unfinished. A "yes" at the install prompt now stores the consent too.

Co-authored-by: Isaac <no-reply@databricks.com>
@anton-107
anton-107 requested a review from rclarey November 27, 2026 12:41
if in.CI || in.EnvOptOut || in.State.Consent() != autoinstall.ConsentUnknown {
return
}
if in.State.Installing || in.State.InstalledWithoutConsent {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[non-blocking] CLI 1.27 and 1.28 ship auto-install but never write installed_without_consent, so if the gate is ever turned on for a range that includes them, the install state their coding-agent runs leave is read here as the user's consent on the next upgrade. Either skip the inference when LastVersion predates the flag, or make sure the gate is only ever turned on from the version that records it.

// An opt-out stored since the state was read stays, and the run finds it
// when it reads the state again under the run lock.
if previous != autoinstall.ConsentOptedOut {
in.State.Consented = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[non-blocking] I agree with #8112 (comment). Nothing reads in.State.Consented between this assignment and the reload under the run lock, so the assignment, the previous-answer branch around it and the "in.State gets the stored consent" sentence in the doc comment are dead.

@anton-107
anton-107 added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 9a1f833 Nov 27, 2026
28 checks passed
@anton-107
anton-107 deleted the aitools-store-auto-install-consent branch November 27, 2026 13:32

@simonfaltum simonfaltum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed 6175820aa74eab1ff48d3367cc9a6b7c46cf7875. This merged before I posted, so these are follow-up findings.

Two scenarios can still record consented: true without a user agreeing:

  • Concurrent automatic installation: the new inline comment describes a stale-state race that bypasses the provenance markers.
  • Legacy automatic installation: already raised by @rclarey in #8112 (comment). A successful unprompted install from a CLI without installed_without_consent is indistinguishable from a manual install here. This matters if auto-install is enabled for those older versions, or an older writer drops the marker.

Both scenarios reproduced in temporary tests: consent should have stayed unknown, but the stored value was ConsentGiven. The concurrency reproduction also cleared InstalledWithoutConsent while Installing remained true.

The existing non-blocking observations about the extra install-state read and unused assignment remain covered by #8112 (comment) and #8112 (comment). The prompt's “yes” now saving consent is fixed.

Validation: the autoinstall and agents library tests passed. The command suite had an unrelated picker-layout failure that also reproduced in isolation. Four of five review sources completed; the independent Codex review was unavailable.

if existing == nil {
return
}
previous, err := autoinstall.GiveConsentIfUnknown(ctx)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[blocking] Recheck provenance atomically before inferring consent. The checks above use state loaded before the run lock. Process A can read an unknown state with neither marker set; process B can then start an unprompted install, set Installing and InstalledWithoutConsent, and save global install state. A now finds that install state and calls GiveConsentIfUnknown, which reloads the file but checks only Consent(): it writes Consented=true and clears InstalledWithoutConsent, even though nobody agreed.

I reproduced this interleaving with a temporary test; the resulting state was Consented:true, Installing:true, InstalledWithoutConsent:false.

Please recheck both provenance markers under the state lock in an inference-specific update, or acquire the run lock and reload before inferring. Explicit installation and prompt writers should still be able to clear the marker.

home := t.TempDir()
ctx := env.WithUserHomeDir(t.Context(), home)
path := filepath.Join(home, ".databricks", "aitools", stateFileName)
readOlder := func() olderState {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nit] .agents/rules/style-guide-go.md asks for a regular named function instead of an inline closure used only to name a repeated operation. Could readOlder be a test helper taking testing.T and the state path?

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

Labels

aitools AI tools (databricks aitools) related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants