Skip to content

Commit 7554bd6

Browse files
authored
Update all 'bundle generate' commands to output paths with forward slash (#4528)
## Changes - Update all places in cmd/bundle/generate to output paths with forward slashes. - Replace %q used in a dashboard for paths with %s for consistency with the rest. - Update AGENTS.md with this instruction. ## Why This makes test output stable across OSes. This is a convention we already use in other places. ## Tests Updated output of existing tests and removed unnecessary Repls entry for fixing the slash.
1 parent 5e4bc81 commit 7554bd6

File tree

16 files changed

+20
-42
lines changed

16 files changed

+20
-42
lines changed

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ import "github.com/databricks/cli/libs/cmdio"
206206
cmdio.LogString(ctx, "...")
207207
```
208208

209+
Always output file path with forward slashes, even on Windows, so that acceptance test output is stable between OSes. Use filepath.ToSlash for this.
210+
209211
# Specific File Guides
210212

211213
## databricks_template_schema.json

acceptance/bundle/deployment/bind/job/generate-and-bind/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,3 @@ Ignore = [
1515
# C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI
1616
# Setting this environment variable prevents that conversion on windows.
1717
MSYS_NO_PATHCONV = "1"
18-
19-
[[Repls]]
20-
Old = '\\'
21-
New = '/'

acceptance/bundle/generate/app_subfolders/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,3 @@ Pattern = "GET /api/2.0/workspace/export"
3535
Response.Body = '''
3636
print("Hello, World!")
3737
'''
38-
39-
[[Repls]]
40-
Old = '\\'
41-
New = '/'

acceptance/bundle/generate/auto-bind/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ Ignore = [
2020
# C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI
2121
# Setting this environment variable prevents that conversion on windows.
2222
MSYS_NO_PATHCONV = "1"
23-
24-
[[Repls]]
25-
Old = '\\'
26-
New = '/'

acceptance/bundle/generate/dashboard-inplace/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Deployment complete!
2626

2727
=== update the dashboard file using bundle generate
2828
>>> [CLI] bundle generate dashboard --resource test_dashboard --force
29-
Writing dashboard to "dash.lvdash.json"
29+
Writing dashboard to dash.lvdash.json
3030

3131
>>> cat dash.lvdash.json
3232
{

acceptance/bundle/generate/dashboard/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
>>> [CLI] workspace mkdirs /Workspace/test-[UNIQUE_NAME]
33

44
>>> [CLI] bundle generate dashboard --existing-id [DASHBOARD_ID] --dashboard-dir out/dashboard --resource-dir out/resource
5-
Writing dashboard to "out/dashboard/test_dashboard.lvdash.json"
6-
Writing configuration to "out/resource/test_dashboard.dashboard.yml"
5+
Writing dashboard to out/dashboard/test_dashboard.lvdash.json
6+
Writing configuration to out/resource/test_dashboard.dashboard.yml

acceptance/bundle/generate/dashboard/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[[Repls]]
2-
Old = '\\\\'
3-
New = '/'
4-
51
[[Repls]]
62
Old = "[0-9a-f]{32}"
73
New = "[DASHBOARD_ID]"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
>>> [CLI] bundle generate dashboard --existing-path /path/to/dashboard --dashboard-dir out/dashboard --resource-dir out/resource
3-
Writing dashboard to "out/dashboard/this_is_a_test_dashboard.lvdash.json"
4-
Writing configuration to "out/resource/this_is_a_test_dashboard.dashboard.yml"
3+
Writing dashboard to out/dashboard/this_is_a_test_dashboard.lvdash.json
4+
Writing configuration to out/resource/this_is_a_test_dashboard.dashboard.yml

acceptance/bundle/generate/dashboard_existing_path_nominal/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[[Repls]]
2-
Old = '\\\\'
3-
New = '/'
4-
51
[[Server]]
62
Pattern = "GET /api/2.0/workspace/get-status"
73
Response.Body = '''

acceptance/bundle/generate/lakeflow_pipelines/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ Response.Body = '''
44
print("Hello, World!")
55
'''
66

7-
[[Repls]]
8-
Old = '\\'
9-
New = '/'
10-
117
[[Server]]
128
Pattern = "GET /api/2.0/workspace/list"
139
Response.Body = '''

0 commit comments

Comments
 (0)