Skip to content

Switch auth logout from --force to --auto-approve#4755

Merged
mihaimitrea-db merged 1 commit intomainfrom
mihaimitrea-db/auth-logout-flag-fix
Apr 10, 2026
Merged

Switch auth logout from --force to --auto-approve#4755
mihaimitrea-db merged 1 commit intomainfrom
mihaimitrea-db/auth-logout-flag-fix

Conversation

@mihaimitrea-db
Copy link
Copy Markdown
Contributor

@mihaimitrea-db mihaimitrea-db commented Mar 16, 2026

Changes

  • Replace the logout-specific --force flag with --auto-approve, matching the pattern used by bundle deploy, bundle destroy, and other commands.
  • Register --auto-approve directly on the auth logout command instead of relying on an unregistered global --yes flag.
  • Stop registering a local --profile flag on auth logout — read the value from the shared flag already available on the command tree.
  • Update the logout help text, non-interactive error message, and unit/acceptance tests to reflect the --auto-approve behavior.

Why

The --force flag was specific to auth logout. Switching to --auto-approve aligns with the rest of the CLI's confirmation-skip pattern (bundle deploy --auto-approve, bundle destroy --auto-approve, etc.).

auth logout was defining its own --profile flag, overriding the global one. Removing it and defaulting to the root behavior keeps UX aligned with other commands and removes a duplicate flag definition that can drift over time.

Tests

  • go test ./cmd/auth -run TestLogout -count=1
  • go test ./acceptance -run TestAccept/cmd/auth/logout -test.v

@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

eng-dev-ecosystem-bot commented Mar 16, 2026

Commit: aef434e

Run: 23143756901

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 8 9 268 785 6:30
💚​ aws windows 8 9 270 783 5:33
🔄​ aws-ucws linux 2 7 9 364 700 8:17
🔄​ aws-ucws windows 2 7 9 366 698 7:14
💚​ azure linux 2 11 271 783 5:53
💚​ azure windows 2 11 273 781 5:37
💚​ azure-ucws linux 2 11 370 696 8:19
🔄​ azure-ucws windows 2 1 11 371 694 6:47
💚​ gcp linux 2 11 267 786 6:14
💚​ gcp windows 2 11 269 784 5:40
18 interesting tests: 9 SKIP, 6 RECOVERED, 3 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🔄​ TestAccept 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/ssh/connect-serverless-gpu 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s ✅​p 🔄​f 🙈​s 🙈​s
🔄​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 20 slowest tests (at least 2 minutes):
duration env testname
3:42 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:34 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:24 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:23 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:21 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:12 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:05 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:53 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:51 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:49 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:49 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:45 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:44 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:42 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:37 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:10 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:10 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:06 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@mihaimitrea-db mihaimitrea-db self-assigned this Mar 16, 2026
@mihaimitrea-db mihaimitrea-db changed the title Prepare auth logout for global profile and yes flags Add --auto-approve flag to auth logout and fix stale account_id token cleanup Apr 10, 2026
@mihaimitrea-db mihaimitrea-db changed the title Add --auto-approve flag to auth logout and fix stale account_id token cleanup Switch auth logout from --force to --auto-approve Apr 10, 2026
@mihaimitrea-db mihaimitrea-db force-pushed the mihaimitrea-db/auth-logout-flag-fix branch from 6bc1680 to 6a93a4b Compare April 10, 2026 11:40
@mihaimitrea-db mihaimitrea-db marked this pull request as ready for review April 10, 2026 11:41
Replace the logout-specific --force flag with --auto-approve, matching
the pattern used by bundle deploy, bundle destroy, and other commands.
@mihaimitrea-db mihaimitrea-db force-pushed the mihaimitrea-db/auth-logout-flag-fix branch from 6a93a4b to 54b8f14 Compare April 10, 2026 11:56
@mihaimitrea-db mihaimitrea-db added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 9093081 Apr 10, 2026
21 checks passed
@mihaimitrea-db mihaimitrea-db deleted the mihaimitrea-db/auth-logout-flag-fix branch April 10, 2026 12:39
github-merge-queue bot pushed a commit that referenced this pull request Apr 10, 2026
## Changes

- Add a traceability comment block at the top of `cmd/auth/logout.go`
linking to the three original PRs (#4613, #4616, #4647). These PRs were
inadvertently squashed into a single commit `cb3c326` titled after #4647
only.
- The comment reflects the `--force` → `--auto-approve` rename from
#4755.
- Add a `NEXT_CHANGELOG.md` entry for `auth logout` under the CLI
section.
- Remove `Hidden: true` from the logout command so it appears in
`databricks auth -h` and tab completion.
- Improve the command's long description to:
- Document that token cleanup only applies to profiles created by
`databricks auth login`
- Note that logging out of one profile does not affect others sharing
the same cached token
- Condense the numbered items (drop the redundant `--auto-approve` item
since it's already mentioned in items 1 and 2; fold `--delete` into a
single item)

## Why

The `auth logout` feature was implemented across three stacked PRs
(#4613, #4616, #4647) that were squashed into one commit on merge. The
commit title only references the last PR ("Extract shared SelectProfile
helper"), so `auth logout` itself has no changelog entry and no
git-blame traceability.

This followup restores that context, unhides the command for users, and
adds the missing changelog entry.

## Tests

No functional changes; existing unit and acceptance tests for `auth
logout` continue to pass.

---------

Co-authored-by: simon <simon.faltum@databricks.com>
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.

3 participants