Skip to content

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

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

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

Conversation

@mihaimitrea-db

@mihaimitrea-dbmihaimitrea-db commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Collaborator

Commit: aef434e

Run: 23143756901

Env🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
💚​aws linux892687856:30
💚​aws windows892707835:33
🔄​aws-ucws linux2793647008:17
🔄​aws-ucws windows2793666987:14
💚​azure linux2112717835:53
💚​azure windows2112737815:37
💚​azure-ucws linux2113706968:19
🔄​azure-ucws windows21113716946:47
💚​gcp linux2112677866:14
💚​gcp windows2112697845:40
18 interesting tests: 9 SKIP, 6 RECOVERED, 3 flaky
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp 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):
durationenvtestname
3:42gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:34azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:24aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:23azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:21azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:12gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:05gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:53aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:51aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:49aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:49azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:45aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:44aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:42aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:37aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:10azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:10azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:06azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@mihaimitrea-dbmihaimitrea-db self-assigned this Mar 16, 2026
@mihaimitrea-dbmihaimitrea-db changed the title Prepare auth logout for global profile and yes flagsAdd --auto-approve flag to auth logout and fix stale account_id token cleanupApr 10, 2026
@mihaimitrea-dbmihaimitrea-db changed the title Add --auto-approve flag to auth logout and fix stale account_id token cleanupSwitch auth logout from --force to --auto-approveApr 10, 2026
@mihaimitrea-db
mihaimitrea-dbforce-pushed the mihaimitrea-db/auth-logout-flag-fix branch from 6bc1680 to 6a93a4bCompareApril 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-dbforce-pushed the mihaimitrea-db/auth-logout-flag-fix branch from 6a93a4b to 54b8f14CompareApril 10, 2026 11:56
@mihaimitrea-db
mihaimitrea-db added this pull request to the merge queueApr 10, 2026
Merged via the queue into main with commit 9093081Apr 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-queueBot 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>
denik pushed a commit that referenced this pull request May 20, 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`
denik pushed a commit that referenced this pull request May 20, 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 `48eb749` 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 freeto 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

@mihaimitrea-db@eng-dev-ecosystem-bot@simonfaltum