From 055e528173cf639d8f0a10e77fa45a096fdfc06a Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Mon, 22 May 2023 16:40:50 +0200 Subject: [PATCH] Rename: bricks -> databricks (#393) ## Changes related to https://github.com/databricks/databricks-vscode/pull/721 ## Rename env vars `BRICKS_CLI_PATH` -> `DATABRICKS_CLI_PATH` `BRICKS_OUTPUT_FORMAT` -> `DATABRICKS_OUTPUT_FORMAT` `BRICKS_LOG_FILE` -> `DATABRICKS_LOG_FILE` `BRICKS_LOG_LEVEL` -> `DATABRICKS_LOG_LEVEL` `BRICKS_LOG_FORMAT` -> `DATABRICKS_LOG_FORMAT` `BRICKS_PROGRESS_FORMAT` -> `DATABRICKS_CLI_PROGRESS_FORMAT` `BRICKS_UPSTREAM` -> `DATABRICKS_CLI_UPSTREAM` `BRICKS_UPSTREAM_VERSION` -> `DATABRICKS_CLI_UPSTREAM_VERSION` --- README.md | 2 +- bundle/config/workspace.go | 4 ++-- bundle/internal/tf/schema/config.go | 2 +- cmd/root/io.go | 4 ++-- cmd/root/logger.go | 12 ++++++------ cmd/root/progress_logger.go | 4 ++-- cmd/root/user_agent_upstream.go | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e1a4664f..aec2b2d2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This project is in private preview. Documentation about the full REST API coverage is avaialbe in the [docs folder](docs/commands.md). -Documentation is available at https://docs.databricks.com/dev-tools/cli/bricks-cli.html. +Documentation is available at https://docs.databricks.com/dev-tools/cli/databricks-cli.html. ## Installation diff --git a/bundle/config/workspace.go b/bundle/config/workspace.go index 73ee738a..8a1205b3 100644 --- a/bundle/config/workspace.go +++ b/bundle/config/workspace.go @@ -97,9 +97,9 @@ func (w *Workspace) Client() (*databricks.WorkspaceClient, error) { func init() { arg0 := os.Args[0] - // Configure BRICKS_CLI_PATH only if our caller intends to use this specific version of this binary. + // Configure DATABRICKS_CLI_PATH only if our caller intends to use this specific version of this binary. // Otherwise, if it is equal to its basename, processes can find it in $PATH. if arg0 != filepath.Base(arg0) { - os.Setenv("BRICKS_CLI_PATH", arg0) + os.Setenv("DATABRICKS_CLI_PATH", arg0) } } diff --git a/bundle/internal/tf/schema/config.go b/bundle/internal/tf/schema/config.go index 8ce214ea..0b75206d 100644 --- a/bundle/internal/tf/schema/config.go +++ b/bundle/internal/tf/schema/config.go @@ -12,7 +12,7 @@ type Config struct { AzureTenantId string `json:"azure_tenant_id,omitempty"` AzureUseMsi bool `json:"azure_use_msi,omitempty"` AzureWorkspaceResourceId string `json:"azure_workspace_resource_id,omitempty"` - BricksCliPath string `json:"bricks_cli_path,omitempty"` + DatabricksCliPath string `json:"databricks_cli_path,omitempty"` ClientId string `json:"client_id,omitempty"` ClientSecret string `json:"client_secret,omitempty"` ConfigFile string `json:"config_file,omitempty"` diff --git a/cmd/root/io.go b/cmd/root/io.go index a6899c28..93830c80 100644 --- a/cmd/root/io.go +++ b/cmd/root/io.go @@ -8,14 +8,14 @@ import ( "github.com/spf13/cobra" ) -const envBricksOutputFormat = "BRICKS_OUTPUT_FORMAT" +const envOutputFormat = "DATABRICKS_OUTPUT_FORMAT" var outputType flags.Output = flags.OutputText func init() { // Configure defaults from environment, if applicable. // If the provided value is invalid it is ignored. - if v, ok := os.LookupEnv(envBricksOutputFormat); ok { + if v, ok := os.LookupEnv(envOutputFormat); ok { outputType.Set(v) } diff --git a/cmd/root/logger.go b/cmd/root/logger.go index 83cd7eb5..37a05337 100644 --- a/cmd/root/logger.go +++ b/cmd/root/logger.go @@ -11,9 +11,9 @@ import ( ) const ( - envBricksLogFile = "BRICKS_LOG_FILE" - envBricksLogLevel = "BRICKS_LOG_LEVEL" - envBricksLogFormat = "BRICKS_LOG_FORMAT" + envLogFile = "DATABRICKS_LOG_FILE" + envLogLevel = "DATABRICKS_LOG_LEVEL" + envLogFormat = "DATABRICKS_LOG_FORMAT" ) func initializeLogger(ctx context.Context) (context.Context, error) { @@ -52,13 +52,13 @@ var logOutput = flags.OutputText func init() { // Configure defaults from environment, if applicable. // If the provided value is invalid it is ignored. - if v, ok := os.LookupEnv(envBricksLogFile); ok { + if v, ok := os.LookupEnv(envLogFile); ok { logFile.Set(v) } - if v, ok := os.LookupEnv(envBricksLogLevel); ok { + if v, ok := os.LookupEnv(envLogLevel); ok { logLevel.Set(v) } - if v, ok := os.LookupEnv(envBricksLogFormat); ok { + if v, ok := os.LookupEnv(envLogFormat); ok { logOutput.Set(v) } diff --git a/cmd/root/progress_logger.go b/cmd/root/progress_logger.go index 28612ec8..fbd90ebb 100644 --- a/cmd/root/progress_logger.go +++ b/cmd/root/progress_logger.go @@ -10,7 +10,7 @@ import ( "golang.org/x/term" ) -const envBricksProgressFormat = "BRICKS_PROGRESS_FORMAT" +const envProgressFormat = "DATABRICKS_CLI_PROGRESS_FORMAT" func resolveModeDefault(format flags.ProgressLogFormat) flags.ProgressLogFormat { if (logLevel.String() == "disabled" || logFile.String() != "stderr") && @@ -40,7 +40,7 @@ var progressFormat = flags.NewProgressLogFormat() func init() { // Configure defaults from environment, if applicable. // If the provided value is invalid it is ignored. - if v, ok := os.LookupEnv(envBricksProgressFormat); ok { + if v, ok := os.LookupEnv(envProgressFormat); ok { progressFormat.Set(v) } RootCmd.PersistentFlags().Var(&progressFormat, "progress-format", "format for progress logs (append, inplace, json)") diff --git a/cmd/root/user_agent_upstream.go b/cmd/root/user_agent_upstream.go index b8412546..3e173bda 100644 --- a/cmd/root/user_agent_upstream.go +++ b/cmd/root/user_agent_upstream.go @@ -8,8 +8,8 @@ import ( ) // Environment variables that caller can set to convey what is upstream to this CLI. -const upstreamEnvVar = "BRICKS_UPSTREAM" -const upstreamVersionEnvVar = "BRICKS_UPSTREAM_VERSION" +const upstreamEnvVar = "DATABRICKS_CLI_UPSTREAM" +const upstreamVersionEnvVar = "DATABRICKS_CLI_UPSTREAM_VERSION" // Keys in the user agent. const upstreamKey = "upstream"