Skip to content

Make sure variable-based paths get /Workspace or /Volume prefixes - #7286

Open
lennartkats-db wants to merge 1 commit into
mainfrom
factory/dabs/96162b875c12-repair-1
Open

lennartkats-db wants to merge 1 commit into
mainfrom
factory/dabs/96162b875c12-repair-1

Conversation

@lennartkats-db

Copy link
Copy Markdown
Contributor

Summary

Issue #2181 reports that bundle validate leaves a job file path under /Users when workspace.root_path begins with a variable. Prefixing currently runs before non-resource variable resolution, so the variable-led path is skipped.

Run workspace path prefixing again after variable resolution. Preserve exact /Workspace and /Volumes roots in the prefix mutator.

Before and after

  • Before: Validation produced job file paths under /Users for dev and /Shared for prod without the /Workspace prefix.
  • After: For variable roots resolving under /Users or /Shared, bundle validate emits one /Workspace prefix on derived workspace paths and the job file path.

Verification

  • The focused Go test failed against the base code on exact-root preservation and passed at c6a2a950b545d7d15227cad65cdcba72c427efd9.
  • The updated prepend-workspace-var acceptance fixture passed its dev and prod variants.

@lennartkats-db
lennartkats-db requested review from a team as code owners November 2, 2026 11:31
@lennartkats-db lennartkats-db added DABs DABs related issues software-factory PR produced by the software factories task labels Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Commit: c6a2a950b | Workflow run

Regression test report

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

2 tests: regression=2 unreleased=0 coverage=0 failing=0

test branch main (3aa5c96) latest (v1.23.0)
TestAccept/bundle/variables/prepend-workspace-var/DMS= ✅ ❌ ❌
TestAccept/bundle/variables/prepend-workspace-var/DMS=true ✅ ❌ ❌
TestAccept/bundle/variables/prepend-workspace-var/DMS=: branch ✅ | main (3aa5c96) ❌ | latest (v1.23.0) ❌

main (3aa5c96):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "{\n  \"target\": \"dev\",\n  \"root_path\": \"/Workspace/Users/[USERNAME]/path/to/root\",\n  \"file_path\": \"/Workspace/Users/[USERNAME]/path/to/root/files\",\n  \"conf_file\": \"/Workspace/Users/[USERNAME]/path/to/root/files/path/to/config.yaml\"\n}\n{\n  \"target\": \"prod\",\n  \"root_path\": \"/Workspace/Shared/path/to/root\",\n  \"file_path\": \"/Workspace/Shared/path/to/root/files\",\n  \"conf_file\": \"/Workspace/Shared/path/to/root/files/path/to/config.yaml\"\n}\n"
        	            	actual  : "{\n  \"target\": \"dev\",\n  \"root_path\": \"/Users/[USERNAME]/path/to/root\",\n  \"file_path\": \"/Users/[USERNAME]/path/to/root/files\",\n  \"conf_file\": \"/Users/[USERNAME]/path/to/root/files/path/to/config.yaml\"\n}\n{\n  \"target\": \"prod\",\n  \"root_path\": \"/Shared/path/to/root\",\n  \"file_path\": \"/Shared/path/to/root/files\",\n  \"conf_file\": \"/Shared/path/to/root/files/path/to/config.yaml\"\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,5 +2,5 @@
        	            	   "target": "dev",
        	            	-  "root_path": "/Workspace/Users/[USERNAME]/path/to/root",
        	            	-  "file_path": "/Workspace/Users/[USERNAME]/path/to/root/files",
        	            	-  "conf_file": "/Workspace/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
        	            	+  "root_path": "/Users/[USERNAME]/path/to/root",
        	            	+  "file_path": "/Users/[USERNAME]/path/to/root/files",
        	            	+  "conf_file": "/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
        	            	 }
        	            	@@ -8,5 +8,5 @@
        	            	   "target": "prod",
        	            	-  "root_path": "/Workspace/Shared/path/to/root",
        	            	-  "file_path": "/Workspace/Shared/path/to/root/files",
        	            	-  "conf_file": "/Workspace/Shared/path/to/root/files/path/to/config.yaml"
        	            	+  "root_path": "/Shared/path/to/root",
        	            	+  "file_path": "/Shared/path/to/root/files",
        	            	+  "conf_file": "/Shared/path/to/root/files/path/to/config.yaml"
        	            	 }
        	Test:       	TestAccept/bundle/variables/prepend-workspace-var/DMS=
        	Messages:   	bundle/variables/prepend-workspace-var/output.txt vs /tmp/TestAcceptbundlevariablesprepend-workspace-varDMS=467345586/002/output.txt

latest (v1.23.0): same output as main (3aa5c96)

TestAccept/bundle/variables/prepend-workspace-var/DMS=true: branch ✅ | main (3aa5c96) ❌ | latest (v1.23.0) ❌

main (3aa5c96):

acceptance_test.go:1341: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1341
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1082
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:659
        	Error:      	Not equal: 
        	            	expected: "{\n  \"target\": \"dev\",\n  \"root_path\": \"/Workspace/Users/[USERNAME]/path/to/root\",\n  \"file_path\": \"/Workspace/Users/[USERNAME]/path/to/root/files\",\n  \"conf_file\": \"/Workspace/Users/[USERNAME]/path/to/root/files/path/to/config.yaml\"\n}\n{\n  \"target\": \"prod\",\n  \"root_path\": \"/Workspace/Shared/path/to/root\",\n  \"file_path\": \"/Workspace/Shared/path/to/root/files\",\n  \"conf_file\": \"/Workspace/Shared/path/to/root/files/path/to/config.yaml\"\n}\n"
        	            	actual  : "{\n  \"target\": \"dev\",\n  \"root_path\": \"/Users/[USERNAME]/path/to/root\",\n  \"file_path\": \"/Users/[USERNAME]/path/to/root/files\",\n  \"conf_file\": \"/Users/[USERNAME]/path/to/root/files/path/to/config.yaml\"\n}\n{\n  \"target\": \"prod\",\n  \"root_path\": \"/Shared/path/to/root\",\n  \"file_path\": \"/Shared/path/to/root/files\",\n  \"conf_file\": \"/Shared/path/to/root/files/path/to/config.yaml\"\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,5 +2,5 @@
        	            	   "target": "dev",
        	            	-  "root_path": "/Workspace/Users/[USERNAME]/path/to/root",
        	            	-  "file_path": "/Workspace/Users/[USERNAME]/path/to/root/files",
        	            	-  "conf_file": "/Workspace/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
        	            	+  "root_path": "/Users/[USERNAME]/path/to/root",
        	            	+  "file_path": "/Users/[USERNAME]/path/to/root/files",
        	            	+  "conf_file": "/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
        	            	 }
        	            	@@ -8,5 +8,5 @@
        	            	   "target": "prod",
        	            	-  "root_path": "/Workspace/Shared/path/to/root",
        	            	-  "file_path": "/Workspace/Shared/path/to/root/files",
        	            	-  "conf_file": "/Workspace/Shared/path/to/root/files/path/to/config.yaml"
        	            	+  "root_path": "/Shared/path/to/root",
        	            	+  "file_path": "/Shared/path/to/root/files",
        	            	+  "conf_file": "/Shared/path/to/root/files/path/to/config.yaml"
        	            	 }
        	Test:       	TestAccept/bundle/variables/prepend-workspace-var/DMS=true
        	Messages:   	bundle/variables/prepend-workspace-var/output.txt vs /tmp/TestAcceptbundlevariablesprepend-workspace-varDMS=true1696201259/002/output.txt
FAIL

latest (v1.23.0): same output as main (3aa5c96)

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: c6a2a95

Run: 41437663832

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 281 16 3:24
✅​ aws-windows-latest-4core-16gb 283 14 3:43
✅​ azure linux-2core-8gb 280 16 3:21
✅​ azure-windows-latest-4core-16gb 282 14 3:42
✅​ gcp linux-2core-8gb 281 16 3:40
✅​ gcp-windows-latest-4core-16gb 283 14 3:43
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:36 gcp-windows-latest-4core-16gb TestAccept
3:36 aws-windows-latest-4core-16gb TestAccept
3:35 azure-windows-latest-4core-16gb TestAccept

@lennartkats-db lennartkats-db changed the title [draft] Fix bundle/config/mutator/prepend_workspace_prefix.go Make sure variable-based paths get /Workspace or /Volume prefixes Nov 2, 2026
@lennartkats-db lennartkats-db added software-factory PR produced by the software factories task and removed software-factory PR produced by the software factories task labels Nov 3, 2026

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 software-factory PR produced by the software factories task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants