From b88d3f3bcec2b2ff55562afcc30b459b4a6d25a4 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 17 Feb 2026 11:33:23 +0100 Subject: [PATCH 1/4] Update all 'bundle generate' commands to output paths with forward slashes This makes test output stable across platforms and is a convention we already use in other places. I've also updated AGENTS.md re this. --- AGENTS.md | 2 ++ .../deployment/bind/job/generate-and-bind/test.toml | 4 ---- acceptance/bundle/generate/app_subfolders/test.toml | 4 ---- acceptance/bundle/generate/auto-bind/test.toml | 4 ---- acceptance/bundle/generate/dashboard/output.txt | 4 ++-- acceptance/bundle/generate/dashboard/test.toml | 4 ---- .../generate/dashboard_existing_path_nominal/output.txt | 4 ++-- .../generate/dashboard_existing_path_nominal/test.toml | 4 ---- acceptance/bundle/generate/lakeflow_pipelines/test.toml | 4 ---- bundle/generate/downloader.go | 6 +++--- cmd/bundle/generate/alert.go | 6 +++--- cmd/bundle/generate/dashboard.go | 8 ++++---- cmd/bundle/generate/job.go | 2 +- cmd/bundle/generate/pipeline.go | 2 +- 14 files changed, 18 insertions(+), 40 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index afadc3dc50..6b4041ef30 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -206,6 +206,8 @@ import "github.com/databricks/cli/libs/cmdio" cmdio.LogString(ctx, "...") ``` +Always output file path with forward slashes, even on Windows, so that acceptance test output is stable between OSes. Use filepath.ToSlash for this. + # Specific File Guides ## databricks_template_schema.json diff --git a/acceptance/bundle/deployment/bind/job/generate-and-bind/test.toml b/acceptance/bundle/deployment/bind/job/generate-and-bind/test.toml index d993f19ea7..01d47031e2 100644 --- a/acceptance/bundle/deployment/bind/job/generate-and-bind/test.toml +++ b/acceptance/bundle/deployment/bind/job/generate-and-bind/test.toml @@ -15,7 +15,3 @@ Ignore = [ # C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI # Setting this environment variable prevents that conversion on windows. MSYS_NO_PATHCONV = "1" - -[[Repls]] -Old = '\\' -New = '/' diff --git a/acceptance/bundle/generate/app_subfolders/test.toml b/acceptance/bundle/generate/app_subfolders/test.toml index b914e55486..5721c4972f 100644 --- a/acceptance/bundle/generate/app_subfolders/test.toml +++ b/acceptance/bundle/generate/app_subfolders/test.toml @@ -35,7 +35,3 @@ Pattern = "GET /api/2.0/workspace/export" Response.Body = ''' print("Hello, World!") ''' - -[[Repls]] -Old = '\\' -New = '/' diff --git a/acceptance/bundle/generate/auto-bind/test.toml b/acceptance/bundle/generate/auto-bind/test.toml index 9272f7bfd0..a5b40dd31a 100644 --- a/acceptance/bundle/generate/auto-bind/test.toml +++ b/acceptance/bundle/generate/auto-bind/test.toml @@ -20,7 +20,3 @@ Ignore = [ # C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI # Setting this environment variable prevents that conversion on windows. MSYS_NO_PATHCONV = "1" - -[[Repls]] -Old = '\\' -New = '/' diff --git a/acceptance/bundle/generate/dashboard/output.txt b/acceptance/bundle/generate/dashboard/output.txt index 2b65d37a7e..07a77e1097 100644 --- a/acceptance/bundle/generate/dashboard/output.txt +++ b/acceptance/bundle/generate/dashboard/output.txt @@ -2,5 +2,5 @@ >>> [CLI] workspace mkdirs /Workspace/test-[UNIQUE_NAME] >>> [CLI] bundle generate dashboard --existing-id [DASHBOARD_ID] --dashboard-dir out/dashboard --resource-dir out/resource -Writing dashboard to "out/dashboard/test_dashboard.lvdash.json" -Writing configuration to "out/resource/test_dashboard.dashboard.yml" +Writing dashboard to out/dashboard/test_dashboard.lvdash.json +Writing configuration to out/resource/test_dashboard.dashboard.yml diff --git a/acceptance/bundle/generate/dashboard/test.toml b/acceptance/bundle/generate/dashboard/test.toml index 2d2380d647..85f8e4285a 100644 --- a/acceptance/bundle/generate/dashboard/test.toml +++ b/acceptance/bundle/generate/dashboard/test.toml @@ -1,7 +1,3 @@ -[[Repls]] -Old = '\\\\' -New = '/' - [[Repls]] Old = "[0-9a-f]{32}" New = "[DASHBOARD_ID]" diff --git a/acceptance/bundle/generate/dashboard_existing_path_nominal/output.txt b/acceptance/bundle/generate/dashboard_existing_path_nominal/output.txt index f419b2118c..de3519416c 100644 --- a/acceptance/bundle/generate/dashboard_existing_path_nominal/output.txt +++ b/acceptance/bundle/generate/dashboard_existing_path_nominal/output.txt @@ -1,4 +1,4 @@ >>> [CLI] bundle generate dashboard --existing-path /path/to/dashboard --dashboard-dir out/dashboard --resource-dir out/resource -Writing dashboard to "out/dashboard/this_is_a_test_dashboard.lvdash.json" -Writing configuration to "out/resource/this_is_a_test_dashboard.dashboard.yml" +Writing dashboard to out/dashboard/this_is_a_test_dashboard.lvdash.json +Writing configuration to out/resource/this_is_a_test_dashboard.dashboard.yml diff --git a/acceptance/bundle/generate/dashboard_existing_path_nominal/test.toml b/acceptance/bundle/generate/dashboard_existing_path_nominal/test.toml index 1566c2a751..1cb855d070 100644 --- a/acceptance/bundle/generate/dashboard_existing_path_nominal/test.toml +++ b/acceptance/bundle/generate/dashboard_existing_path_nominal/test.toml @@ -1,7 +1,3 @@ -[[Repls]] -Old = '\\\\' -New = '/' - [[Server]] Pattern = "GET /api/2.0/workspace/get-status" Response.Body = ''' diff --git a/acceptance/bundle/generate/lakeflow_pipelines/test.toml b/acceptance/bundle/generate/lakeflow_pipelines/test.toml index 0b39960b4b..925939e9d2 100644 --- a/acceptance/bundle/generate/lakeflow_pipelines/test.toml +++ b/acceptance/bundle/generate/lakeflow_pipelines/test.toml @@ -4,10 +4,6 @@ Response.Body = ''' print("Hello, World!") ''' -[[Repls]] -Old = '\\' -New = '/' - [[Server]] Pattern = "GET /api/2.0/workspace/list" Response.Body = ''' diff --git a/bundle/generate/downloader.go b/bundle/generate/downloader.go index c6583db2ef..30b91c0539 100644 --- a/bundle/generate/downloader.go +++ b/bundle/generate/downloader.go @@ -228,10 +228,10 @@ func (n *Downloader) FlushToDisk(ctx context.Context, force bool) error { info, err := os.Stat(targetPath) if err == nil { if info.IsDir() { - return fmt.Errorf("%s is a directory", targetPath) + return fmt.Errorf("%s is a directory", filepath.ToSlash(targetPath)) } if !force { - return fmt.Errorf("%s already exists. Use --force to overwrite", targetPath) + return fmt.Errorf("%s already exists. Use --force to overwrite", filepath.ToSlash(targetPath)) } } } @@ -261,7 +261,7 @@ func (n *Downloader) FlushToDisk(ctx context.Context, force bool) error { return err } - cmdio.LogString(errCtx, "File successfully saved to "+targetPath) + cmdio.LogString(errCtx, "File successfully saved to "+filepath.ToSlash(targetPath)) return reader.Close() }) } diff --git a/cmd/bundle/generate/alert.go b/cmd/bundle/generate/alert.go index deb92128a0..f79a579171 100644 --- a/cmd/bundle/generate/alert.go +++ b/cmd/bundle/generate/alert.go @@ -132,7 +132,7 @@ After generation, you can deploy this alert to other targets using: // Check if file exists and force flag if _, err := os.Stat(alertPath); err == nil && !force { - return fmt.Errorf("%s already exists. Use --force to overwrite", alertPath) + return fmt.Errorf("%s already exists. Use --force to overwrite", filepath.ToSlash(alertPath)) } // Write alert definition file @@ -170,8 +170,8 @@ After generation, you can deploy this alert to other targets using: return err } - cmdio.LogString(ctx, "Alert configuration successfully saved to "+configPath) - cmdio.LogString(ctx, "Serialized alert definition to "+alertPath) + cmdio.LogString(ctx, "Alert configuration successfully saved to "+filepath.ToSlash(configPath)) + cmdio.LogString(ctx, "Serialized alert definition to "+filepath.ToSlash(alertPath)) return nil } diff --git a/cmd/bundle/generate/dashboard.go b/cmd/bundle/generate/dashboard.go index 2b6274f14a..344a690120 100644 --- a/cmd/bundle/generate/dashboard.go +++ b/cmd/bundle/generate/dashboard.go @@ -191,14 +191,14 @@ func (d *dashboard) saveSerializedDashboard(ctx context.Context, b *bundle.Bundl info, err := os.Stat(filename) if err == nil { if info.IsDir() { - return fmt.Errorf("%s is a directory", rel) + return fmt.Errorf("%s is a directory", filepath.ToSlash(rel)) } if !d.force { - return fmt.Errorf("%s already exists. Use --force to overwrite", rel) + return fmt.Errorf("%s already exists. Use --force to overwrite", filepath.ToSlash(rel)) } } - cmdio.LogString(ctx, fmt.Sprintf("Writing dashboard to %q", rel)) + cmdio.LogString(ctx, fmt.Sprintf("Writing dashboard to %s", filepath.ToSlash(rel))) return os.WriteFile(filename, data, 0o644) } @@ -242,7 +242,7 @@ func (d *dashboard) saveConfiguration(ctx context.Context, b *bundle.Bundle, das rel = resourcePath } - cmdio.LogString(ctx, fmt.Sprintf("Writing configuration to %q", rel)) + cmdio.LogString(ctx, fmt.Sprintf("Writing configuration to %s", filepath.ToSlash(rel))) err = saver.SaveAsYAML(result, resourcePath, d.force) if err != nil { return err diff --git a/cmd/bundle/generate/job.go b/cmd/bundle/generate/job.go index 8aac775637..1dbb8521bf 100644 --- a/cmd/bundle/generate/job.go +++ b/cmd/bundle/generate/job.go @@ -145,7 +145,7 @@ After generation, you can deploy this job to other targets using: return err } - cmdio.LogString(ctx, "Job configuration successfully saved to "+filename) + cmdio.LogString(ctx, "Job configuration successfully saved to "+filepath.ToSlash(filename)) if bind { return deployment.BindResource(cmd, jobKey, strconv.FormatInt(jobId, 10), true, false, true) diff --git a/cmd/bundle/generate/pipeline.go b/cmd/bundle/generate/pipeline.go index b69a5823be..dd422d7808 100644 --- a/cmd/bundle/generate/pipeline.go +++ b/cmd/bundle/generate/pipeline.go @@ -149,7 +149,7 @@ like catalogs, schemas, and compute configurations per target.`, return err } - cmdio.LogString(ctx, "Pipeline configuration successfully saved to "+filename) + cmdio.LogString(ctx, "Pipeline configuration successfully saved to "+filepath.ToSlash(filename)) if bind { return deployment.BindResource(cmd, pipelineKey, pipelineId, true, false, true) From 5726622d7be854d859330516dc9eed5685695e9c Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 17 Feb 2026 11:48:39 +0100 Subject: [PATCH 2/4] update test out --- acceptance/bundle/generate/dashboard-inplace/output.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/bundle/generate/dashboard-inplace/output.txt b/acceptance/bundle/generate/dashboard-inplace/output.txt index ca173508e3..c1688d6724 100644 --- a/acceptance/bundle/generate/dashboard-inplace/output.txt +++ b/acceptance/bundle/generate/dashboard-inplace/output.txt @@ -26,7 +26,7 @@ Deployment complete! === update the dashboard file using bundle generate >>> [CLI] bundle generate dashboard --resource test_dashboard --force -Writing dashboard to "dash.lvdash.json" +Writing dashboard to dash.lvdash.json >>> cat dash.lvdash.json { From 0d0f46e0966b10991d5ce90887d196ad7f83fb77 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 17 Feb 2026 11:49:50 +0100 Subject: [PATCH 3/4] lint fix --- cmd/bundle/generate/dashboard.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/bundle/generate/dashboard.go b/cmd/bundle/generate/dashboard.go index 344a690120..114e645ec2 100644 --- a/cmd/bundle/generate/dashboard.go +++ b/cmd/bundle/generate/dashboard.go @@ -198,7 +198,7 @@ func (d *dashboard) saveSerializedDashboard(ctx context.Context, b *bundle.Bundl } } - cmdio.LogString(ctx, fmt.Sprintf("Writing dashboard to %s", filepath.ToSlash(rel))) + cmdio.LogString(ctx, "Writing dashboard to "+filepath.ToSlash(rel)) return os.WriteFile(filename, data, 0o644) } @@ -242,7 +242,7 @@ func (d *dashboard) saveConfiguration(ctx context.Context, b *bundle.Bundle, das rel = resourcePath } - cmdio.LogString(ctx, fmt.Sprintf("Writing configuration to %s", filepath.ToSlash(rel))) + cmdio.LogString(ctx, "Writing configuration to "+filepath.ToSlash(rel)) err = saver.SaveAsYAML(result, resourcePath, d.force) if err != nil { return err From 8df9d815f98b79d8c310f2d9acfcb93080f4b25d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 17 Feb 2026 12:30:15 +0100 Subject: [PATCH 4/4] update test output --- .../bundle/resources/dashboards/generate_inplace/output.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/bundle/resources/dashboards/generate_inplace/output.txt b/acceptance/bundle/resources/dashboards/generate_inplace/output.txt index 873536a18f..6c37f56723 100644 --- a/acceptance/bundle/resources/dashboards/generate_inplace/output.txt +++ b/acceptance/bundle/resources/dashboards/generate_inplace/output.txt @@ -27,7 +27,7 @@ Exit code: 1 } >>> [CLI] bundle generate dashboard --resource already_exists --force -Writing dashboard to "dashboard.lvdash.json" +Writing dashboard to dashboard.lvdash.json >>> cat dashboard.lvdash.json {}