-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix databricks configure
to use DATABRICKS_CONFIG_FILE environment variable if exists as config file
#1325
base: main
Are you sure you want to change the base?
Fix databricks configure
to use DATABRICKS_CONFIG_FILE environment variable if exists as config file
#1325
Conversation
@kai-zhu-sonatype thanks for the contribution! could you please clarify what are you trying to achieve with this change? |
Thanks @andrewnester for your response. cfgPath := filepath.Join(tempHomeDir, ".databrickscfg-test")
t.Setenv("DATABRICKS_CONFIG_FILE", cfgPath) adding to pass ❯ DATABRICKS_CONFIG_FILE=/tmp/.databrickscfg-test DATABRICKS_HOST=https://test DATABRICKS_TOKEN=TEST databricks configure --profile jenkins --debug
10:36:05 INFO start pid=7725 version=0.216.0 args="databricks, configure, --profile, jenkins, --debug"tabricks configure --profile jenkins --debug
10:36:05 INFO Backing up in /home/ubuntu/.databrickscfg.bak pid=7725
10:36:05 INFO Overwriting /home/ubuntu/.databrickscfg pid=7725
10:36:05 INFO completed execution pid=7725 exit_code=0 after: ❯ DATABRICKS_CONFIG_FILE=/tmp/.databrickscfg-test DATABRICKS_HOST=https://test DATABRICKS_TOKEN=TEST ./cli configure --profile jenkins --debug
10:35:31 INFO start pid=7675 version=0.0.0-dev+b0529cdd16c7 args="./cli, configure, --profile, jenkins, --debug"ure --profile jenkins --debug
10:35:31 INFO Saving /tmp/.databrickscfg-test pid=7675
10:35:31 INFO completed execution pid=7675 exit_code=0 |
8d57f0c
to
4886b9b
Compare
4886b9b
to
1f2dcd8
Compare
databricks configure
to use DATABRICKS_CONFIG_FILE environment variable if exists as config file
databricks configure
to use DATABRICKS_CONFIG_FILE environment variable if exists as config filedatabricks configure
to use DATABRICKS_CONFIG_FILE environment variable if exists as config file
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1325 +/- ##
==========================================
+ Coverage 52.25% 54.06% +1.80%
==========================================
Files 317 327 +10
Lines 18004 14837 -3167
==========================================
- Hits 9408 8021 -1387
+ Misses 7903 6075 -1828
- Partials 693 741 +48 ☔ View full report in Codecov by Sentry. |
Hi @pietern, when you have time please have a look if this is the right way to fix |
@kai-zhu-sonatype Thanks for the contribution! Because of licensing reasons we're required to get a CLA signed before we can merge it. We don't have a smooth process for this setup quite yet, but I'll send an email to see if this is possible out of band. Thanks for your patience. |
Changes
added
ConfigFile: cfg.ConfigFile
fordatabrickscfg.SaveToProfile
incmd/configure/configure.go
to save the file in a specified path when the value is not emptyTests
TestConfigFileFromEnvNoInteractive
incmd/configure/configure_test.go
sets a different config file path byDATABRICKS_CONFIG_FILE
, after execution, the overwrite config file is generated, and the default path has no file.