Skip to content

Use .workspace.URL for the host in built-in templates - #7350

Open
pavloKozlov wants to merge 9 commits into
workspace-context-review-fixesfrom
workspace-context-builtin-templates
Open

pavloKozlov wants to merge 9 commits into
workspace-context-review-fixesfrom
workspace-context-builtin-templates

Conversation

@pavloKozlov

@pavloKozlov pavloKozlov commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7388.

Changes

Built-in templates write host: {{.workspace.URL}} instead of {{workspace_host}}. With a profile that sets workspace_id, the host gets ?w=<id>. Other profiles get the same host as before. Welcome messages show .workspace.URL. In dbt-sql, the HTTP path suggested for dbt init gets ?o=<id> from .workspace.URLID in the same case, because dbt reads the workspace from o.

Why

On a host shared by several workspaces, the bundle needs the workspace ID in the host to deploy to the right workspace, and local dbt needs ?o= in the HTTP path to connect. Deployed dbt jobs get their host from Databricks and connect without ?o=, so their profile doesn't change.

Tests

New acceptance tests create bundles with a profile without workspace_id and with one that has it. One validates with strict profile matching and deploys, the other checks the dbt-sql host and HTTP path. Other template outputs don't change. I also connected with dbt-databricks 1.12 and 1.13 to a workspace through a shared host and through its own host, with and without ?o=.

This pull request and its description were written by Isaac.

@pavloKozlov
pavloKozlov force-pushed the workspace-context-builtin-templates branch from abf32b2 to d6dcf5e Compare November 4, 2026 15:30
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 684c44497 | Workflow run

Regression test report

Selected 3 changed tests (limit=20, 0 not selected)

4 tests: regression=4 unreleased=0 coverage=0 failing=0
test branch main (663e1f7) latest (v1.24.0)
TestAccept/bundle/templates-machinery/workspace_variable/runtime/DMS= ✅ ❌ ❌
TestAccept/bundle/templates-machinery/workspace_variable/runtime/DMS=true ✅ ❌ ❌
TestAccept/bundle/templates/dbt-sql-workspace-id/DMS= ✅ ❌ ❌
TestAccept/bundle/templates/default-minimal/profiles/DMS= ✅ ❌ ❌
TestAccept/bundle/templates-machinery/workspace_variable/runtime/DMS=: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/templates-machinery/workspace_variable/runtime/output.txt
        +++ /tmp/TestAcceptbundletemplates-machineryworkspace_variableruntime2250704707/002/output.txt
        @@ -19,219 +19,6 @@
         
         >>> [CLI] bundle init ./urls --profile workspace_classic
         Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] }]
        +Error: failed to compute file content for urls.txt.tmpl. template: :7:21: executing "" at <.workspace.URLID>: can't evaluate field URLID in type interface {}
         
        -=== Profile workspace_classic_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_classic_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_classic_id
        -Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -URL "/jobs": [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile workspace_custom_host
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile no_workspace_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile no_workspace_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile no_workspace_id
        -Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL]  }]
        -
        -=== Rerender and init with edited inputs
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host --input-file input.edited.json
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.edited.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/pipelines?tab=all": [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: https://example.test/my-jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:https://example.test/my-jobs path:/pipelines?tab=all workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Failing default of an input with a value
        -
        ->>> [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id --input-file input.supplied.json
        -{
        -  "welcome_message": null,
        -  "success_message": null,
        -  "properties": {
        -    "value": {
        -      "description": "Value",
        -      "default": "{{ .workspace.ID }}"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./supplied --profile no_workspace_id --config-file input.supplied.json
        -✨ Successfully initialized template
        -value: set by user
        -
        ->>> musterr [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id
        -Error: property value default: failed to render template "{{ .workspace.ID }}": template: base:1:13: executing "base" at <.workspace.ID>: error calling ID: cannot determine workspace ID, please set workspace_id in the configuration profile, the DATABRICKS_WORKSPACE_ID environment variable, or workspace.workspace_id in the bundle
        -
        -=== Invalid URL paths
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.absolute-url.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "https://other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.protocol-relative.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "//other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.workspace-selector.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?o=123" must not set the "o" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-w.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?w=123" must not set the "w" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-workspace-id.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?workspace_id=123" must not set the "workspace_id" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.semicolon.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: failed to parse query of workspace URL path "/jobs?w=999;x=1": invalid semicolon separator in query
        -
        -=== Workspace ID from environment variables
        -
        ->>> DATABRICKS_CONFIG_FILE=/dev/null DATABRICKS_HOST=[CUSTOM_HOST] DATABRICKS_WORKSPACE_ID=[WORKSPACE_ID] [CLI] bundle init ./urls
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -
... (25 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.24.0):

acceptance_test.go:1345: Diff:
        --- bundle/templates-machinery/workspace_variable/runtime/output.txt
        +++ /tmp/TestAcceptbundletemplates-machineryworkspace_variableruntime867690416/002/output.txt
        @@ -2,236 +2,6 @@
         === Profile workspace_classic
         
         >>> [CLI] bundle debug render-template-schema ./urls --profile workspace_classic
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        +Error: property path: failed to render template "Path to open on {{ .workspace.Hostname }}": template: base:1:29: executing "base" at <.workspace.Hostname>: nil pointer evaluating interface {}.Hostname
         
        ->>> [CLI] bundle init ./urls --profile workspace_classic
        -Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] }]
        -
        -=== Profile workspace_classic_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_classic_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_classic_id
        -Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -URL "/jobs": [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile workspace_custom_host
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile no_workspace_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile no_workspace_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile no_workspace_id
        -Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL]  }]
        -
        -=== Rerender and init with edited inputs
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host --input-file input.edited.json
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.edited.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/pipelines?tab=all": [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: https://example.test/my-jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:https://example.test/my-jobs path:/pipelines?tab=all workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Failing default of an input with a value
        -
        ->>> [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id --input-file input.supplied.json
        -{
        -  "welcome_message": null,
        -  "success_message": null,
        -  "properties": {
        -    "value": {
        -      "description": "Value",
        -      "default": "{{ .workspace.ID }}"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./supplied --profile no_workspace_id --config-file input.supplied.json
        -✨ Successfully initialized template
        -value: set by user
        -
        ->>> musterr [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id
        -Error: property value default: failed to render template "{{ .workspace.ID }}": template: base:1:13: executing "base" at <.workspace.ID>: error calling ID: cannot determine workspace ID, please set workspace_id in the configuration profile, the DATABRICKS_WORKSPACE_ID environment variable, or workspace.workspace_id in the bundle
        -
        -=== Invalid URL paths
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.absolute-url.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "https://other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.protocol-relative.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "//other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.workspace-selector.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?o=123" must not set the "o" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-w.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?w=123" must not set the "w" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-workspace-id.json
... (42 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
TestAccept/bundle/templates-machinery/workspace_variable/runtime/DMS=true: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/templates-machinery/workspace_variable/runtime/output.txt
        +++ /tmp/TestAcceptbundletemplates-machineryworkspace_variableruntime2425307589/002/output.txt
        @@ -19,219 +19,6 @@
         
         >>> [CLI] bundle init ./urls --profile workspace_classic
         Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] }]
        +Error: failed to compute file content for urls.txt.tmpl. template: :7:21: executing "" at <.workspace.URLID>: can't evaluate field URLID in type interface {}
         
        -=== Profile workspace_classic_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_classic_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_classic_id
        -Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -URL "/jobs": [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile workspace_custom_host
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile no_workspace_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile no_workspace_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile no_workspace_id
        -Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL]  }]
        -
        -=== Rerender and init with edited inputs
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host --input-file input.edited.json
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.edited.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/pipelines?tab=all": [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: https://example.test/my-jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:https://example.test/my-jobs path:/pipelines?tab=all workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Failing default of an input with a value
        -
        ->>> [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id --input-file input.supplied.json
        -{
        -  "welcome_message": null,
        -  "success_message": null,
        -  "properties": {
        -    "value": {
        -      "description": "Value",
        -      "default": "{{ .workspace.ID }}"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./supplied --profile no_workspace_id --config-file input.supplied.json
        -✨ Successfully initialized template
        -value: set by user
        -
        ->>> musterr [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id
        -Error: property value default: failed to render template "{{ .workspace.ID }}": template: base:1:13: executing "base" at <.workspace.ID>: error calling ID: cannot determine workspace ID, please set workspace_id in the configuration profile, the DATABRICKS_WORKSPACE_ID environment variable, or workspace.workspace_id in the bundle
        -
        -=== Invalid URL paths
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.absolute-url.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "https://other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.protocol-relative.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "//other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.workspace-selector.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?o=123" must not set the "o" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-w.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?w=123" must not set the "w" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-workspace-id.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?workspace_id=123" must not set the "workspace_id" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.semicolon.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: failed to parse query of workspace URL path "/jobs?w=999;x=1": invalid semicolon separator in query
        -
        -=== Workspace ID from environment variables
        -
        ->>> DATABRICKS_CONFIG_FILE=/dev/null DATABRICKS_HOST=[CUSTOM_HOST] DATABRICKS_WORKSPACE_ID=[WORKSPACE_ID] [CLI] bundle init ./urls
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -
... (25 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.24.0):

acceptance_test.go:1345: Diff:
        --- bundle/templates-machinery/workspace_variable/runtime/output.txt
        +++ /tmp/TestAcceptbundletemplates-machineryworkspace_variableruntime2405021502/002/output.txt
        @@ -2,236 +2,6 @@
         === Profile workspace_classic
         
         >>> [CLI] bundle debug render-template-schema ./urls --profile workspace_classic
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        +Error: property path: failed to render template "Path to open on {{ .workspace.Hostname }}": template: base:1:29: executing "base" at <.workspace.Hostname>: nil pointer evaluating interface {}.Hostname
         
        ->>> [CLI] bundle init ./urls --profile workspace_classic
        -Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] }]
        -
        -=== Profile workspace_classic_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_classic_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_classic_id
        -Initializing for [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -Open [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]?w=[WORKSPACE_ID]
        -URL "/jobs": [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [DATABRICKS_URL]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile workspace_custom_host
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/jobs?view=list#top": [CUSTOM_HOST]/jobs?view=list&w=[WORKSPACE_ID]#top
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID] path:/jobs?view=list#top workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Profile no_workspace_id
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile no_workspace_id
        -{
        -  "welcome_message": "Initializing for [DATABRICKS_URL]",
        -  "success_message": "Open [DATABRICKS_URL]/jobs?view=list#top",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[DATABRICKS_URL]/jobs"
        -    },
        -    "path": {
        -      "description": "Path to open on [DATABRICKS_HOST]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile no_workspace_id
        -Initializing for [DATABRICKS_URL]
        -Open [DATABRICKS_URL]/jobs?view=list#top
        -workspace_host: [DATABRICKS_URL]
        -Hostname: [DATABRICKS_HOST]
        -URL: [DATABRICKS_URL]
        -URL "/jobs": [DATABRICKS_URL]/jobs
        -URL "/jobs?view=list#top": [DATABRICKS_URL]/jobs?view=list#top
        -URLID: ""
        -jobs_url: [DATABRICKS_URL]/jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:[DATABRICKS_URL]/jobs path:/jobs?view=list#top workspace:{[DATABRICKS_HOST] [DATABRICKS_URL]  }]
        -
        -=== Rerender and init with edited inputs
        -
        ->>> [CLI] bundle debug render-template-schema ./urls --profile workspace_custom_host --input-file input.edited.json
        -{
        -  "welcome_message": "Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]",
        -  "success_message": "Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]",
        -  "properties": {
        -    "jobs_url": {
        -      "description": "Jobs page",
        -      "default": "[CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]"
        -    },
        -    "path": {
        -      "description": "Path to open on [CUSTOM_HOSTNAME]",
        -      "default": "/jobs?view=list#top"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.edited.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Open [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -workspace_host: [CUSTOM_HOST]
        -Hostname: [CUSTOM_HOSTNAME]
        -URL: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -URL "/jobs": [CUSTOM_HOST]/jobs?w=[WORKSPACE_ID]
        -URL "/pipelines?tab=all": [CUSTOM_HOST]/pipelines?tab=all&w=[WORKSPACE_ID]
        -URLID: "[WORKSPACE_ID]"
        -jobs_url: https://example.test/my-jobs
        -Root keys: jobs_url path workspace
        -Root data: map[jobs_url:https://example.test/my-jobs path:/pipelines?tab=all workspace:{[CUSTOM_HOSTNAME] [CUSTOM_HOST] [WORKSPACE_ID] [WORKSPACE_ID]}]
        -
        -=== Failing default of an input with a value
        -
        ->>> [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id --input-file input.supplied.json
        -{
        -  "welcome_message": null,
        -  "success_message": null,
        -  "properties": {
        -    "value": {
        -      "description": "Value",
        -      "default": "{{ .workspace.ID }}"
        -    }
        -  }
        -}
        -
        ->>> [CLI] bundle init ./supplied --profile no_workspace_id --config-file input.supplied.json
        -✨ Successfully initialized template
        -value: set by user
        -
        ->>> musterr [CLI] bundle debug render-template-schema ./supplied --profile no_workspace_id
        -Error: property value default: failed to render template "{{ .workspace.ID }}": template: base:1:13: executing "base" at <.workspace.ID>: error calling ID: cannot determine workspace ID, please set workspace_id in the configuration profile, the DATABRICKS_WORKSPACE_ID environment variable, or workspace.workspace_id in the bundle
        -
        -=== Invalid URL paths
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.absolute-url.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "https://other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.protocol-relative.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "//other.test/jobs" must be relative to the workspace host
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.workspace-selector.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?o=123" must not set the "o" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-w.json
        -Initializing for [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -Error: failed to compute file content for urls.txt.tmpl. template: :6:25: executing "" at <$ws.URL>: error calling URL: workspace URL path "/jobs?w=123" must not set the "w" query parameter, the workspace is selected by the profile
        -
        ->>> musterr [CLI] bundle init ./urls --profile workspace_custom_host --config-file input.selector-workspace-id.json
... (42 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)
TestAccept/bundle/templates/dbt-sql-workspace-id/DMS=: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/templates/dbt-sql-workspace-id/output.txt
        +++ /tmp/TestAcceptbundletemplatesdbt-sql-workspace-idDMS=910139751/002/output.txt
        @@ -30,7 +30,7 @@
         Welcome to the dbt template for Declarative Automation Bundles!
         
         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.
        -workspace_host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        +workspace_host: [CUSTOM_HOST]
         
         📊 Your new project has been created in the 'my_dbt_sql' directory!
         If you already have dbt installed, just type 'cd my_dbt_sql; dbt init' to get started.
        @@ -38,11 +38,11 @@
         
         
         >>> grep host: my_dbt_sql/databricks.yml
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        +      host: [CUSTOM_HOST]
        +      host: [CUSTOM_HOST]
         
         >>> grep -E ^    default: [^{] my_dbt_sql/profile_template.yml
             default: [CUSTOM_HOSTNAME]
        -    default: /sql/2.0/warehouses/f00dcafe?o=[WORKSPACE_ID]
        +    default: /sql/2.0/warehouses/f00dcafe
             default: main
             default: 4

latest (v1.24.0):

acceptance_test.go:1345: Diff:
        --- bundle/templates/dbt-sql-workspace-id/output.txt
        +++ /tmp/TestAcceptbundletemplatesdbt-sql-workspace-idDMS=4289839391/002/output.txt
        @@ -30,7 +30,7 @@
         Welcome to the dbt template for Declarative Automation Bundles!
         
         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.
        -workspace_host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        +workspace_host: [CUSTOM_HOST]
         
         📊 Your new project has been created in the 'my_dbt_sql' directory!
         If you already have dbt installed, just type 'cd my_dbt_sql; dbt init' to get started.
        @@ -38,11 +38,11 @@
         
         
         >>> grep host: my_dbt_sql/databricks.yml
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        +      host: [CUSTOM_HOST]
        +      host: [CUSTOM_HOST]
         
         >>> grep -E ^    default: [^{] my_dbt_sql/profile_template.yml
             default: [CUSTOM_HOSTNAME]
        -    default: /sql/2.0/warehouses/f00dcafe?o=[WORKSPACE_ID]
        +    default: /sql/2.0/warehouses/f00dcafe
             default: main
             default: 4
        
FAIL
TestAccept/bundle/templates/default-minimal/profiles/DMS=: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/templates/default-minimal/profiles/output.txt
        +++ /tmp/TestAcceptbundletemplatesdefault-minimalprofilesDMS=305074018/002/output.txt
        @@ -41,7 +41,7 @@
         This template creates a minimal project structure without sample code, ideal for advanced users.
         (For getting started with Python or SQL code, use the default-python or default-sql templates instead.)
         
        -Your workspace at [CUSTOM_HOST]?w=[WORKSPACE_ID] is used for initialization.
        +Your workspace at [CUSTOM_HOST] is used for initialization.
         (See https://docs.databricks.com/dev-tools/cli/profiles.html for how to change your profile.)
         
         ✨ Your new project has been created in the 'my_default_minimal' directory!
        @@ -49,20 +49,17 @@
         To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/index.html.
         
         >>> grep host: databricks.yml
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        +      host: [CUSTOM_HOST]
        +      host: [CUSTOM_HOST]
         
         >>> DATABRICKS_BUNDLE_STRICT_PROFILE_MATCH=1 [CLI] bundle validate -t dev
        +Error: cannot resolve bundle auth configuration: resolve: strict profile matching: host [CUSTOM_HOST] requires a workspace ID; set workspace.workspace_id or add ?o=<workspace-id> to workspace.host. Config: host=[CUSTOM_HOST], config_file=[TEST_TMP_DIR]/.databrickscfg, databricks_cli_path=[CLI]. Env: DATABRICKS_CONFIG_FILE, DATABRICKS_CLI_PATH
        +
         Name: my_default_minimal
         Target: dev
         Workspace:
        -  Host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -  User: [USERNAME]
        -  Path: /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/dev
        +  Host: [CUSTOM_HOST]
         
        -Validation OK!
        +Found 1 error
         
        ->>> [CLI] bundle deploy -t dev
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/dev/files...
        -Files: 10 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 0 unchanged
        +Exit code: 1
        
    acceptance_test.go:1135: Test produced unexpected files:
        my_default_minimal/.gitignore
        my_default_minimal/.vscode/__builtins__.pyi
        my_default_minimal/.vscode/extensions.json
        my_default_minimal/.vscode/settings.json
        my_default_minimal/AGENTS.md
        my_default_minimal/README.md
        my_default_minimal/fixtures/.gitkeep
        my_default_minimal/pyproject.toml
        my_default_minimal/tests/conftest.py
FAIL

latest (v1.24.0):

acceptance_test.go:1345: Diff:
        --- bundle/templates/default-minimal/profiles/output.txt
        +++ /tmp/TestAcceptbundletemplatesdefault-minimalprofilesDMS=2718240229/002/output.txt
        @@ -41,7 +41,7 @@
         This template creates a minimal project structure without sample code, ideal for advanced users.
         (For getting started with Python or SQL code, use the default-python or default-sql templates instead.)
         
        -Your workspace at [CUSTOM_HOST]?w=[WORKSPACE_ID] is used for initialization.
        +Your workspace at [CUSTOM_HOST] is used for initialization.
         (See https://docs.databricks.com/dev-tools/cli/profiles.html for how to change your profile.)
         
         ✨ Your new project has been created in the 'my_default_minimal' directory!
        @@ -49,20 +49,17 @@
         To get started, refer to the project README.md file and the documentation at https://docs.databricks.com/dev-tools/bundles/index.html.
         
         >>> grep host: databricks.yml
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -      host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        +      host: [CUSTOM_HOST]
        +      host: [CUSTOM_HOST]
         
         >>> DATABRICKS_BUNDLE_STRICT_PROFILE_MATCH=1 [CLI] bundle validate -t dev
        +Error: cannot resolve bundle auth configuration: resolve: strict profile matching: host [CUSTOM_HOST] requires a workspace ID; set workspace.workspace_id or add ?o=<workspace-id> to workspace.host. Config: host=[CUSTOM_HOST], config_file=[TEST_TMP_DIR]/.databrickscfg, databricks_cli_path=[CLI]. Env: DATABRICKS_CONFIG_FILE, DATABRICKS_CLI_PATH
        +
         Name: my_default_minimal
         Target: dev
         Workspace:
        -  Host: [CUSTOM_HOST]?w=[WORKSPACE_ID]
        -  User: [USERNAME]
        -  Path: /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/dev
        +  Host: [CUSTOM_HOST]
         
        -Validation OK!
        +Found 1 error
         
        ->>> [CLI] bundle deploy -t dev
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_minimal/dev/files...
        -Files: 10 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 0 unchanged
        +Exit code: 1
        
    acceptance_test.go:1135: Test produced unexpected files:
        my_default_minimal/.gitignore
        my_default_minimal/.vscode/__builtins__.pyi
        my_default_minimal/.vscode/extensions.json
        my_default_minimal/.vscode/settings.json
        my_default_minimal/AGENTS.md
        my_default_minimal/README.md
        my_default_minimal/fixtures/.gitkeep
        my_default_minimal/pyproject.toml
        my_default_minimal/tests/conftest.py

@pavloKozlov
pavloKozlov force-pushed the workspace-context-template-data branch from b931f85 to 5f2f6db Compare November 4, 2026 15:41
@pavloKozlov
pavloKozlov force-pushed the workspace-context-builtin-templates branch from d6dcf5e to e702534 Compare November 4, 2026 15:41
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 684c444

Run: 42232929044

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 18 3:31
✅​ aws-windows-latest-4core-16gb 273 16 2:25
✅​ azure linux-2core-8gb 270 18 3:14
✅​ azure-windows-latest-4core-16gb 272 16 2:25
✅​ gcp linux-2core-8gb 271 18 3:39
✅​ gcp-windows-latest-4core-16gb 273 16 2:32

@pavloKozlov
pavloKozlov force-pushed the workspace-context-builtin-templates branch 4 times, most recently from 93ee68b to 494b311 Compare November 5, 2026 14:04
@pavloKozlov
pavloKozlov marked this pull request as ready for review November 5, 2026 14:06
@pavloKozlov
pavloKozlov requested review from a team as code owners November 5, 2026 14:06
default: {{.http_path}}
{{- /* dbt selects the workspace on a host shared by several workspaces with ?o=<id> in the
HTTP path. Use the ID from the workspace URL, which has it when the profile sets it. */}}
{{- $id := (regexp `[?&]w=([^&#]+)`).FindStringSubmatch .workspace.URL}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing the ID back out of the URL we just rendered feels roundabout: workspaceContext already knows which ID URL adds (urlWorkspaceID in libs/template/workspace_context.go:51). Can we expose that on .workspace instead of re-deriving it with a regex here? Could go into #7349. I assume .workspace.ID doesn't fit because it also returns the host-metadata ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Switched to .workspace.URLID.

@@ -0,0 +1,33 @@
# The test server is reachable as both 127.0.0.1 and localhost. The second
# stands in for a host shared by several workspaces.
CUSTOM_HOST=${DATABRICKS_HOST/127.0.0.1/localhost}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setup (localhost swap, .well-known/databricks-config, hand-written profiles) is now the fourth copy after acceptance/bundle/strict_profile_match/script.prepare and acceptance/bundle/templates-machinery/workspace_variable/script.prepare, and dbt-sql-workspace-id/script repeats it again. Maybe it should be a helper in acceptance/bin instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to a helper in #7388 PR.

# when the profile sets the ID, like ?w= in the bundle host.
for profile in no_workspace_id custom_host; do
title "Profile $profile\n"
$CLI bundle init dbt-sql --config-file ./input.json --profile $profile > /dev/null 2>&1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why hide the init output here? If init fails we only see grep failing on a missing file, and the default-minimal test traces it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it traces bundle init now

Base automatically changed from workspace-context-template-data to main November 6, 2026 10:43
@github-actions github-actions Bot added the DABs DABs related issues label Nov 6, 2026
pavloKozlov and others added 8 commits November 6, 2026 14:03
Built-in templates, except dbt-sql, write the workspace URL to
workspace.host. It has ?w=<id> when the profile or an environment variable
sets the workspace ID. Other profiles keep the same host as before. The
value is quoted so the YAML stays valid for any URL. Template schemas keep
workspace_host.

Co-authored-by: Isaac <no-reply@databricks.com>
The welcome messages showed workspace_host, which has no workspace ID. They
now show the URL that the bundle uses, so they match workspace.host in the
generated databricks.yml. Messages that printed "workspace_host:" now print
"workspace_url:".

Co-authored-by: Isaac <no-reply@databricks.com>
The bundle host now comes from .workspace.URL like in the other built-in
templates. dbt jobs get their host from Databricks, so they are not
affected. The dbt profile default uses .workspace.Hostname, which gives the
same value as stripping the scheme from workspace_host. No built-in
template uses workspace_host now.

Co-authored-by: Isaac <no-reply@databricks.com>
The dbt profile default no longer has the port of the test server.
Databricks hosts don't have an explicit port, so for them the default is the
same as before.

Co-authored-by: Isaac <no-reply@databricks.com>
dbt-sql keeps workspace_host for its bundle host and its dbt profile
default until we check that dbt accepts the new host format. This reverts
78cc122 and c6c9291. Its welcome message still shows .workspace.URL like
the other built-in templates.

Co-authored-by: Isaac <no-reply@databricks.com>
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>
The bundle host comes from .workspace.URL like in the other built-in
templates. Deployed dbt jobs get their host from Databricks, so they don't
read it. The HTTP path suggested for dbt init gets ?o=<id> when the
workspace URL has the ID, because dbt selects the workspace on a host
shared by several workspaces with ?o= in the HTTP path. The host suggested
for dbt init is .workspace.Hostname.

Co-authored-by: Isaac <no-reply@databricks.com>
The dbt-sql profile default for dbt init is host:port again, so its
output is the same as before.

Co-authored-by: Isaac <no-reply@databricks.com>
@pavloKozlov
pavloKozlov force-pushed the workspace-context-builtin-templates branch from 850ed27 to 684b87b Compare November 6, 2026 14:14
@pavloKozlov
pavloKozlov changed the base branch from main to workspace-context-review-fixes November 6, 2026 14:14
dbt-sql adds ?o= from .workspace.URLID, escaped, instead of parsing the
rendered URL with a regex. The profiles and dbt-sql-workspace-id tests use
setup_custom_host instead of their own copy of that setup, and the
dbt-sql-workspace-id test traces bundle init so a failed init shows its
error.

Co-authored-by: Isaac <no-reply@databricks.com>
@pavloKozlov
pavloKozlov force-pushed the workspace-context-builtin-templates branch from 684b87b to 684c444 Compare November 6, 2026 14:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants