Skip to content

Show migration hints for retired sandbox key commands - #8180

Open
HsingTang wants to merge 7 commits into
mainfrom
HsingTang/sandbox-retirement-migration-hints
Open

HsingTang wants to merge 7 commits into
mainfrom
HsingTang/sandbox-retirement-migration-hints

Conversation

@HsingTang

@HsingTang HsingTang commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Retired sandbox register and sandbox ssh-key invocations now return migration errors, including when passed legacy flags. Hidden handlers direct users to sandbox ssh/ssh-setup for connections and the documented generic API commands for deliberate legacy key revocation. They perform no authentication, API calls, or SSH file changes and stay out of normal help and completion.

Why

After the registration commands were removed, old scripts received generic unknown-command or unknown-flag errors without instructions for migrating.

Tests

All 31 sandbox acceptance cases and the sandbox/command unit tests pass, including legacy arguments, nonzero exits, a fresh home without credentials, unchanged existing SSH files, no HTTP requests, and hidden help/completion. Supported SSH help is unchanged. Scoped formatting/lint, whitespace, and changelog checks pass. Local Isaac review completed; its help and completion observations were fixed and tested.

Ready for review; merging is on hold.

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: 5c8ba1f85 | Workflow run

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

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (0e854af) latest (v1.28.0)
TestAccept/cmd/sandbox/retired-key-commands ✅ ❌ ❌
TestAccept/cmd/sandbox/retired-key-commands: branch ✅ | main (0e854af) ❌ | latest (v1.28.0) ❌

main (0e854af):

acceptance_test.go:1406: Diff:
        --- cmd/sandbox/retired-key-commands/output.txt
        +++ /tmp/TestAcceptcmdsandboxretired-key-commands267774934/002/output.txt
        @@ -2,172 +2,105 @@
         === Retired commands reject requests without touching existing SSH files
         
         >>> musterr [CLI] sandbox register
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +Error: unknown command "register" for "databricks sandbox"
         
        ->>> musterr [CLI] sandbox register --name test-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +Usage:
        +  databricks sandbox [flags]
        +  databricks sandbox [command]
         
        ->>> musterr [CLI] sandbox register --name=test-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +Available Commands:
        +  config      Configure a Sandbox's name and auto-stop policy
        +  create      Create a new Sandbox environment
        +  default     Set the default Sandbox for SSH
        +  delete      Delete a Sandbox environment
        +  forward     Forward local ports to apps in a Sandbox environment
        +  fs          Filesystem related commands
        +  list        List your Sandbox environments
        +  ssh         SSH into a Sandbox environment
        +  ssh-setup   Configure native SSH tools for a sandbox
        +  start       Start a stopped Sandbox environment
        +  status      Show Sandbox environment status
        +  stop        Stop a running Sandbox environment
         
        ->>> musterr [CLI] sandbox register --help
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +Flags:
        +  -h, --help[=true|false]   help for sandbox
         
        ->>> musterr [CLI] sandbox register old-argument --unknown
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +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] sandbox ssh-key
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        +Use "databricks sandbox [command] --help" for more information about a command.
         
        ->>> musterr [CLI] sandbox ssh-key list
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
         
        ->>> musterr [CLI] sandbox ssh-key list --json
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        +>>> musterr [CLI] sandbox register --name test-machine
        +Error: unknown flag: --name
         
        ->>> musterr [CLI] sandbox ssh-key list --help
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        +Usage:
        +  databricks sandbox [flags]
        +  databricks sandbox [command]
         
        ->>> musterr [CLI] sandbox ssh-key delete legacy-key-hash
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        +Available Commands:
        +  config      Configure a Sandbox's name and auto-stop policy
        +  create      Create a new Sandbox environment
        +  default     Set the default Sandbox for SSH
        +  delete      Delete a Sandbox environment
        +  forward     Forward local ports to apps in a Sandbox environment
        +  fs          Filesystem related commands
        +  list        List your Sandbox environments
        +  ssh         SSH into a Sandbox environment
        +  ssh-setup   Configure native SSH tools for a sandbox
        +  start       Start a stopped Sandbox environment
        +  status      Show Sandbox environment status
        +  stop        Stop a running Sandbox environment
         
        ->>> musterr [CLI] sandbox ssh-key delete legacy-key-hash --profile missing-profile --unknown
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        +Flags:
        +  -h, --help[=true|false]   help for sandbox
         
        ->>> cmp legacy-ssh/config [TEST_TMP_DIR]/.ssh/config
        +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)
         
        ->>> cmp legacy-ssh/databricks-sandbox [TEST_TMP_DIR]/.ssh/databricks-sandbox
        +Use "databricks sandbox [command] --help" for more information about a command.
         
        ->>> cmp legacy-ssh/sandbox_ed25519 [TEST_TMP_DIR]/.ssh/sandbox_ed25519
         
        ->>> cmp legacy-ssh/sandbox_ed25519.pub [TEST_TMP_DIR]/.ssh/sandbox_ed25519.pub
        +>>> musterr [CLI] sandbox register --name=test-machine
        +Error: unknown flag: --name
         
        ->>> test ! -s [OUTPUT_DIR]/out.requests.txt
        +Usage:
        +  databricks sandbox [flags]
        +  databricks sandbox [command]
         
        -=== Retired commands leave a fresh SSH directory absent
        +Available Commands:
        +  config      Configure a Sandbox's name and auto-stop policy
        +  create      Create a new Sandbox environment
        +  default     Set the default Sandbox for SSH
        +  delete      Delete a Sandbox environment
        +  forward     Forward local ports to apps in a Sandbox environment
        +  fs          Filesystem related commands
        +  list        List your Sandbox environments
        +  ssh         SSH into a Sandbox environment
        +  ssh-setup   Configure native SSH tools for a sandbox
        +  start       Start a stopped Sandbox environment
        +  status      Show Sandbox environment status
        +  stop        Stop a running Sandbox environment
         
        ->>> musterr [CLI] sandbox register
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +Flags:
        +  -h, --help[=true|false]   help for sandbox
         
        ->>> musterr [CLI] sandbox register --name fresh-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +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] sandbox register --name=fresh-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +Use "databricks sandbox [command] --help" for more information about a command.
         
        ->>> musterr [CLI] sandbox register --help
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
         
        ->>> musterr [CLI] sandbox register old-argument --unknown
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key list
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
... (201 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.28.0):

server.go:281: No handler for URL: /api/2.0/lakebox/ssh-keys
        Body: [77 bytes] {"public_key":"synthetic legacy public key fixture\n","name":"runnervm0j63q"}
        
        For acceptance tests, add this to test.toml:
        [[Server]]
        Pattern = "POST /api/2.0/lakebox/ssh-keys"
        Response.Body = '<response body here>'
        # Response.StatusCode = <response code if not 200>
    server.go:281: No handler for URL: /api/2.0/lakebox/ssh-keys
        Body: [76 bytes] {"public_key":"synthetic legacy public key fixture\n","name":"test-machine"}
        
        For acceptance tests, add this to test.toml:
        [[Server]]
        Pattern = "POST /api/2.0/lakebox/ssh-keys"
        Response.Body = '<response body here>'
        # Response.StatusCode = <response code if not 200>
    server.go:281: No handler for URL: /api/2.0/lakebox/ssh-keys
        Body: [76 bytes] {"public_key":"synthetic legacy public key fixture\n","name":"test-machine"}
        
        For acceptance tests, add this to test.toml:
        [[Server]]
        Pattern = "POST /api/2.0/lakebox/ssh-keys"
        Response.Body = '<response body here>'
        # Response.StatusCode = <response code if not 200>
    acceptance_test.go:1406: Diff:
        --- cmd/sandbox/retired-key-commands/output.txt
        +++ /tmp/TestAcceptcmdsandboxretired-key-commands3177665482/002/output.txt
        @@ -2,291 +2,45 @@
         === Retired commands reject requests without touching existing SSH files
         
         >>> musterr [CLI] sandbox register
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +  key        [TEST_TMP_DIR]/.ssh/sandbox_ed25519
        +  ✗ Failed to register key
        +Error: failed to register key: No stub found for pattern: POST /api/2.0/lakebox/ssh-keys
         
         >>> musterr [CLI] sandbox register --name test-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +  key        [TEST_TMP_DIR]/.ssh/sandbox_ed25519
        +  ✗ Failed to register key
        +Error: failed to register key: No stub found for pattern: POST /api/2.0/lakebox/ssh-keys
         
         >>> musterr [CLI] sandbox register --name=test-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +  key        [TEST_TMP_DIR]/.ssh/sandbox_ed25519
        +  ✗ Failed to register key
        +Error: failed to register key: No stub found for pattern: POST /api/2.0/lakebox/ssh-keys
         
         >>> musterr [CLI] sandbox register --help
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +Generate a dedicated SSH key for sandbox and register it with the service.
         
        ->>> musterr [CLI] sandbox register old-argument --unknown
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        +This command:
        +1. Generates an Ed25519 SSH key at ~/.ssh/sandbox_ed25519 (if it doesn't exist)
        +2. Registers the public key with the sandbox service, labeled with --name
        +   (defaults to this machine's hostname so 'ssh-key list' is meaningful
        +   across multiple machines)
        +3. Optionally adds a 'Host sandbox-gw' alias to ~/.ssh/config (prompted
        +   the first time) so editor Remote-SSH ("Open in VS Code / Cursor"
        +   from the workspace UI) and plain 'ssh <id>@sandbox-gw' both work
         
        ->>> musterr [CLI] sandbox ssh-key
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        +After registration, 'databricks sandbox ssh' will use this key automatically.
        +Run this once per machine.
         
        ->>> musterr [CLI] sandbox ssh-key list
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key list --json
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key list --help
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key delete legacy-key-hash
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key delete legacy-key-hash --profile missing-profile --unknown
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> cmp legacy-ssh/config [TEST_TMP_DIR]/.ssh/config
        -
        ->>> cmp legacy-ssh/databricks-sandbox [TEST_TMP_DIR]/.ssh/databricks-sandbox
        -
        ->>> cmp legacy-ssh/sandbox_ed25519 [TEST_TMP_DIR]/.ssh/sandbox_ed25519
        -
        ->>> cmp legacy-ssh/sandbox_ed25519.pub [TEST_TMP_DIR]/.ssh/sandbox_ed25519.pub
        -
        ->>> test ! -s [OUTPUT_DIR]/out.requests.txt
        -
        -=== Retired commands leave a fresh SSH directory absent
        -
        ->>> musterr [CLI] sandbox register
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        -
        ->>> musterr [CLI] sandbox register --name fresh-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        -
        ->>> musterr [CLI] sandbox register --name=fresh-machine
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        -
        ->>> musterr [CLI] sandbox register --help
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        -
        ->>> musterr [CLI] sandbox register old-argument --unknown
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
        -To connect, use: databricks sandbox ssh <sandbox>
        -For native SSH or editor setup, use: databricks sandbox ssh-setup <sandbox> --name ALIAS --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key list
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key list --json
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key list --help
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key delete legacy-key-hash
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        ->>> musterr [CLI] sandbox ssh-key delete legacy-key-hash --profile missing-profile --unknown
        -Error: sandbox ssh-key list/delete have been retired; these commands no longer manage the legacy gateway key registry.
        -While the legacy registry remains available, list existing keys using the original workspace profile:
        -  databricks api get /api/2.0/lakebox/ssh-keys --profile PROFILE
        -To deliberately revoke a selected existing key, replace KEY_HASH with its keyHash and use:
        -  databricks api delete /api/2.0/lakebox/ssh-keys/KEY_HASH --profile PROFILE
        -
        -=== Retired commands return the standard error exit status
        -
        ->>> musterr [CLI] sandbox register
        -Error: sandbox register command has been retired, and is no longer required for sandbox SSH connection.
... (215 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

Comment thread cmd/sandbox/retired.go Resolved
@HsingTang
HsingTang requested a review from pietern November 29, 2026 22:07
@HsingTang
HsingTang marked this pull request as ready for review November 29, 2026 22:17
@HsingTang
HsingTang requested review from a team as code owners November 29, 2026 22:17

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

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

This PR adds hidden sandbox register and sandbox ssh-key stubs. They return migration errors for the old invocations, including the old flags, and stay out of help and completion. The behavior is correct and the acceptance test covers it well. What's left is test cleanup: the new unit test file mostly repeats the acceptance script, one assertion in it can never fail, and one completion call in the script is missing trace.

Comment thread cmd/sandbox/retired_test.go Resolved
Comment thread cmd/sandbox/retired_test.go Resolved
@denik

denik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Heads-up: #7975 removed the errcode acceptance helper, so the errcode calls this PR adds will fail with errcode: command not found once it's tested against current main.

To fix: use musterr CMD for a command that must fail, and run commands expected to succeed without a wrapper. When the exact exit code is what the test checks, print it after musterr with printf '\nExit code: %s\n' "$MUSTERR_EXIT_CODE". cmd || true is only for best-effort cleanup. Details are in .agents/rules/testing.md.

@HsingTang

Copy link
Copy Markdown
Contributor Author

Fixed in f2d4396. Both exit-status checks now use musterr followed by printf '\nExit code: %s\n' "$MUSTERR_EXIT_CODE", retaining the exact exit-1 goldens. Validated with current main's unmodified acceptance/script.prepare: all 31 local sandbox acceptance cases passed (0 skipped), affected unit tests passed, and scoped lint/format checks passed.

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