Skip to content

Commit 077dc42

Browse files
pavloKozlovIsaac
andcommitted
Drop changes the built-in template migration doesn't need
The host is no longer quoted. A URL with ?w= is a valid plain YAML value, and the quotes were only needed for test outputs, which no longer have ?w=. Welcome messages keep their "workspace_host:" label. The ?w= targets in strict_profile_match/host and the extra-workspace-input test are removed: the profiles test and the input tests in templates-machinery cover the same cases. Template outputs are now the same as before for auth without a workspace ID. Co-authored-by: Isaac <no-reply@databricks.com>
1 parent dd5123a commit 077dc42

42 files changed

Lines changed: 64 additions & 107 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎acceptance/bundle/strict_profile_match/host/databricks.yml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ targets:
1818
custom_host:
1919
workspace:
2020
host: $CUSTOM_HOST/?o=$WORKSPACE_ID
21-
classic_with_w:
22-
workspace:
23-
host: $CLASSIC_HOST?w=$WORKSPACE_ID
24-
custom_host_with_w:
25-
workspace:
26-
host: $CUSTOM_HOST?w=$WORKSPACE_ID
2721
custom_host_workspace_id_field:
2822
workspace:
2923
host: $CUSTOM_HOST

‎acceptance/bundle/strict_profile_match/host/output.txt‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ profile=workspace_custom_host host=[CUSTOM_HOST] workspace_id=[WORKSPACE_ID]
1515
>>> errcode [CLI] bundle run -t custom_host_workspace_id_field show_auth
1616
profile=workspace_custom_host host=[CUSTOM_HOST] workspace_id=[WORKSPACE_ID]
1717

18-
=== Target classic_with_w matches one profile
19-
>>> errcode [CLI] bundle run -t classic_with_w show_auth
20-
profile=workspace_classic_id host=[DATABRICKS_URL] workspace_id=[WORKSPACE_ID]
21-
22-
=== Target custom_host_with_w matches one profile
23-
>>> errcode [CLI] bundle run -t custom_host_with_w show_auth
24-
profile=workspace_custom_host host=[CUSTOM_HOST] workspace_id=[WORKSPACE_ID]
25-
2618
=== Target classic_other_workspace is rejected
2719
>>> errcode [CLI] bundle validate -t classic_other_workspace
2820
Error: cannot resolve bundle auth configuration: resolve: strict profile matching: no profile for host [DATABRICKS_URL] has workspace_id 2222222222. Config: host=[DATABRICKS_URL], workspace_id=2222222222, config_file=[TEST_TMP_DIR]/.databrickscfg, databricks_cli_path=[CLI]. Env: DATABRICKS_CONFIG_FILE, DATABRICKS_CLI_PATH

‎acceptance/bundle/strict_profile_match/host/script‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
for target in classic classic_with_workspace_id custom_host custom_host_workspace_id_field classic_with_w custom_host_with_w; do
1+
for target in classic classic_with_workspace_id custom_host custom_host_workspace_id_field; do
22
title "Target $target matches one profile"
33
trace errcode $CLI bundle run -t $target show_auth
44
done

‎acceptance/bundle/templates/dbt-sql-classic/output.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Welcome to the dbt template for Declarative Automation Bundles!
55

66
A workspace was selected based on your current profile. For information about how to change this, see https://docs.databricks.com/dev-tools/cli/profiles.html.
7-
workspace_url: [DATABRICKS_URL]
7+
workspace_host: [DATABRICKS_URL]
88

99
📊 Your new project has been created in the 'my_dbt_sql' directory!
1010
If you already have dbt installed, just type 'cd my_dbt_sql; dbt init' to get started.

‎acceptance/bundle/templates/dbt-sql/output.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Welcome to the dbt template for Declarative Automation Bundles!
55

66
A workspace was selected based on your current profile. For information about how to change this, see https://docs.databricks.com/dev-tools/cli/profiles.html.
7-
workspace_url: [DATABRICKS_URL]
7+
workspace_host: [DATABRICKS_URL]
88

99
📊 Your new project has been created in the 'my_dbt_sql' directory!
1010
If you already have dbt installed, just type 'cd my_dbt_sql; dbt init' to get started.

‎acceptance/bundle/templates/default-minimal/extra-workspace-input/input.json‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎acceptance/bundle/templates/default-minimal/extra-workspace-input/out.test.toml‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎acceptance/bundle/templates/default-minimal/extra-workspace-input/output.txt‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎acceptance/bundle/templates/default-minimal/extra-workspace-input/script‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎acceptance/bundle/templates/default-minimal/profiles/output.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Your workspace at [DATABRICKS_URL] is used for initialization.
1515
To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/index.html.
1616

1717
>>> grep host: databricks.yml
18-
host: "[DATABRICKS_URL]"
19-
host: "[DATABRICKS_URL]"
18+
host: [DATABRICKS_URL]
19+
host: [DATABRICKS_URL]
2020

2121
>>> DATABRICKS_BUNDLE_STRICT_PROFILE_MATCH=1 [CLI] bundle validate -t dev
2222
Name: my_default_minimal
@@ -49,8 +49,8 @@ Your workspace at [CUSTOM_HOST]?w=[WORKSPACE_ID] is used for initialization.
4949
To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/index.html.
5050

5151
>>> grep host: databricks.yml
52-
host: "[CUSTOM_HOST]?w=[WORKSPACE_ID]"
53-
host: "[CUSTOM_HOST]?w=[WORKSPACE_ID]"
52+
host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
53+
host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
5454

5555
>>> DATABRICKS_BUNDLE_STRICT_PROFILE_MATCH=1 [CLI] bundle validate -t dev
5656
Name: my_default_minimal

0 commit comments

Comments
 (0)