Skip to content

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

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

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

Conversation

@lennartkats-db

@lennartkats-db lennartkats-db commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Resolve variable-based workspace paths before adding the /Workspace prefix. Then resolve other configuration references against those final paths. A root under /Users or /Shared produces one prefix on its derived workspace paths and on direct or variable-aliased job file paths in bundle validate.

The early resolution visits only workspace path fields. Literal /Users and /Shared paths retain their prefix behavior, and paths under /Volumes remain untouched. An exact /Workspace root now remains unchanged when the prefix pass runs again.

Why

Issue #2181 reports that workspace.root_path: ${var.workspace_root}/... leaves a job file path under /Users. Prefixing happens before variable resolution, so the variable-led root is skipped. Resolving just the workspace paths before prefixing lets other references use their final values while retaining the existing resolution limit for unrelated cyclic variables.

Fixes #2181

Tests

  • go test ./bundle/config/mutator ./bundle/phases -count=1 -timeout 20m
  • go test ./acceptance -run '^TestAccept/bundle/variables/(prepend-workspace-var|resolve-builtin|complex-cycle|complex-cycle-self)$' -count=1 -v -timeout 30m (both DMS variants)
  • ./task check-changelog
  • The acceptance fixture checks dev and prod JSON, including direct and aliased job parameters. The focused tests also cover source-linked aliases and confirm that both cyclic-variable fixtures finish with their existing warning output.
  • An isolated control with the prior phase order leaves the alias under /Users in dev and /Shared in prod.

This PR was written by Codex.

@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: 2f2c6a730 | 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 (8e70c8b) latest (v1.26.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 (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/variables/prepend-workspace-var/output.txt
        +++ /tmp/TestAcceptbundlevariablesprepend-workspace-varDMS=2232925550/002/output.txt
        @@ -2,21 +2,17 @@
         >>> [CLI] bundle validate -t dev -o json
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
         }
         
         >>> [CLI] bundle validate -t prod -o json
        -Warning: the bundle root path /Workspace/Shared/path/to/root is writable by all workspace users
        -
        -The bundle is configured to use /Workspace/Shared, which will give read/write access to all users. If this is intentional, add CAN_MANAGE for 'group_name: users' permission to your bundle configuration. If the deployment should be restricted, move it to a restricted folder such as /Workspace/Users/<username or principal name>.
        -
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Shared/path/to/root/files/path/to/config.yaml"
         }
        
FAIL

latest (v1.26.0):

acceptance_test.go:1374: Diff:
        --- bundle/variables/prepend-workspace-var/output.txt
        +++ /tmp/TestAcceptbundlevariablesprepend-workspace-varDMS=890592934/002/output.txt
        @@ -2,21 +2,17 @@
         >>> [CLI] bundle validate -t dev -o json
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
         }
         
         >>> [CLI] bundle validate -t prod -o json
        -Warning: the bundle root path /Workspace/Shared/path/to/root is writable by all workspace users
        -
        -The bundle is configured to use /Workspace/Shared, which will give read/write access to all users. If this is intentional, add CAN_MANAGE for 'group_name: users' permission to your bundle configuration. If the deployment should be restricted, move it to a restricted folder such as /Workspace/Users/<username or principal name>.
        -
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Shared/path/to/root/files/path/to/config.yaml"
         }
TestAccept/bundle/variables/prepend-workspace-var/DMS=true: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/variables/prepend-workspace-var/output.txt
        +++ /tmp/TestAcceptbundlevariablesprepend-workspace-varDMS=true3424633579/002/output.txt
        @@ -2,21 +2,17 @@
         >>> [CLI] bundle validate -t dev -o json
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
         }
         
         >>> [CLI] bundle validate -t prod -o json
        -Warning: the bundle root path /Workspace/Shared/path/to/root is writable by all workspace users
        -
        -The bundle is configured to use /Workspace/Shared, which will give read/write access to all users. If this is intentional, add CAN_MANAGE for 'group_name: users' permission to your bundle configuration. If the deployment should be restricted, move it to a restricted folder such as /Workspace/Users/<username or principal name>.
        -
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Shared/path/to/root/files/path/to/config.yaml"
         }

latest (v1.26.0):

acceptance_test.go:1374: Diff:
        --- bundle/variables/prepend-workspace-var/output.txt
        +++ /tmp/TestAcceptbundlevariablesprepend-workspace-varDMS=true3545052058/002/output.txt
        @@ -2,21 +2,17 @@
         >>> [CLI] bundle validate -t dev -o json
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Users/[USERNAME]/path/to/root/files/path/to/config.yaml"
         }
         
         >>> [CLI] bundle validate -t prod -o json
        -Warning: the bundle root path /Workspace/Shared/path/to/root is writable by all workspace users
        -
        -The bundle is configured to use /Workspace/Shared, which will give read/write access to all users. If this is intentional, add CAN_MANAGE for 'group_name: users' permission to your bundle configuration. If the deployment should be restricted, move it to a restricted folder such as /Workspace/Users/<username or principal name>.
        -
         {
           "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",
        -  "alias_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",
        +  "alias_file": "/Shared/path/to/root/files/path/to/config.yaml"
         }
        
FAIL

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 2f2c6a7

Run: 43443007035

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 16 8:41
🔄​ aws-windows-latest-4core-16gb 1 1 271 14 8:50
💚​ azure linux-2core-8gb 1 269 16 6:05
💚​ azure-windows-latest-4core-16gb 1 271 14 5:55
💚​ gcp linux-2core-8gb 1 270 16 7:49
🔄​ gcp-windows-latest-4core-16gb 1 1 271 14 8:10
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestSyncIncrementalFileOverwritesFolder ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestSyncIncrementalSyncPythonNotebookToFile ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
Top 9 slowest tests (at least 2 minutes):
duration env testname
3:28 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
3:12 azure-windows-latest-4core-16gb TestAccept
3:10 aws-windows-latest-4core-16gb TestAccept
3:08 gcp-windows-latest-4core-16gb TestAccept
3:02 aws-windows-latest-4core-16gb TestImportDirDoesNotOverwrite
2:49 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
2:47 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:12 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
2:10 aws-windows-latest-4core-16gb TestFilerReadDir/workspace_files

@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
@lennartkats-db lennartkats-db changed the title Make sure variable-based paths get /Workspace or /Volume prefixes [draft] Make sure variable-based paths get /Workspace or /Volume prefixes Nov 4, 2026
@lennartkats-db lennartkats-db added the ai-auto PRs made by AI loops & factories, label Nov 13, 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

ai-auto PRs made by AI loops & factories, 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.

/Workspace not prepended automatically when root_path starts with a variable

2 participants