From 171d9faa3b6260d32b382048e30d3954d129cabb Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Mon, 14 Jul 2025 21:01:22 +0200 Subject: [PATCH 1/3] Make 'auth login' UX consistent with 'bundle init' --- cmd/auth/login.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cmd/auth/login.go b/cmd/auth/login.go index 46f279489a..e90b6c402c 100644 --- a/cmd/auth/login.go +++ b/cmd/auth/login.go @@ -25,10 +25,15 @@ func promptForProfile(ctx context.Context, defaultValue string) (string, error) } prompt := cmdio.Prompt(ctx) - prompt.Label = "Databricks profile name" - prompt.Default = defaultValue + prompt.Label = "Databricks profile name [" + defaultValue + "]" prompt.AllowEdit = true - return prompt.Run() + result, err := prompt.Run() + if result == "" { + // Manually return the default value. We could use the prompt.Default + // field, but be inconsistent with other prompts in the CLI. + return defaultValue, err + } + return result, err } const ( @@ -100,7 +105,11 @@ depends on the existing profiles you have set in your configuration file // If the user has not specified a profile name, prompt for one. if profileName == "" { var err error - profileName, err = promptForProfile(ctx, getProfileName(authArguments)) + profileName = getProfileName(authArguments) + if profileName == "" { + profileName = "DEFAULT" + } + profileName, err = promptForProfile(ctx, profileName) if err != nil { return err } From 7fa484b01110ad756125ea377a4e15d2e09d0fe9 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Mon, 14 Jul 2025 21:11:09 +0200 Subject: [PATCH 2/3] Update CHANGELOG --- NEXT_CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index f789869b3e..8e557fca82 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -7,6 +7,7 @@ ### Dependency updates ### CLI +* Show "DEFAULT" as the default profile for `databricks auth login` [#3251](https://github.com/databricks/cli/pull/3251) ### Bundles From b6caf5817b94272cc5be749ed43e41c62c90ad01 Mon Sep 17 00:00:00 2001 From: "Lennart Kats (databricks)" Date: Mon, 14 Jul 2025 21:52:51 +0200 Subject: [PATCH 3/3] Update NEXT_CHANGELOG.md Fix PR number --- NEXT_CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 8e557fca82..b3cd4fd337 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -7,7 +7,7 @@ ### Dependency updates ### CLI -* Show "DEFAULT" as the default profile for `databricks auth login` [#3251](https://github.com/databricks/cli/pull/3251) +* Show "DEFAULT" as the default profile for `databricks auth login` [#3252](https://github.com/databricks/cli/pull/3252) ### Bundles