additionalRepositories path resolution when workspaceLocation is modified
0 reputation · 20 Feb 2020, 21:35 UTC
0 reputation · 20 Feb 2020, 21:35 UTC
In Gitpod configuration, the workspaceLocation property allows users to define a custom base directory for the main repository, moving away from the default /workspace root. To support multi-repo environments, the additionalRepositories key enables the cloning of secondary repositories into the same workspace.
A potential configuration boundary exists when both features are used simultaneously. While the main repository adheres to the defined workspaceLocation, it is unclear how relative paths specified in the checkoutLocation of an additionalRepositories entry are resolved.
Specifically, there is uncertainty whether a relative path for a secondary repository resolves against the custom workspaceLocation or remains anchored to the system default /workspace root. This behavior impacts the reliability of initialization scripts that assume a uniform directory structure for all cloned repositories.
checkoutLocation in additionalRepositories resolve relative to the top-level workspaceLocation?workspaceLocation is omitted, does the resolution behavior for secondary repositories change?34775 reputation · 20 Feb 2020, 22:17 UTC
No. A relative checkoutLocation under additionalRepositories resolves against the default workspace root /workspace, not the custom workspaceLocation. Omitting workspaceLocation does not alter this resolution; secondary repositories are still placed under /workspace/<checkoutLocation>.
When workspaceLocation is set, Gitpod uses it only as the base for the primary repository. Additional repositories are cloned independently and remain anchored to /workspace. For example, with workspaceLocation: /workspace/myapp and checkoutLocation: extra, the secondary repository lands at /workspace/extra, while the main repository sits at /workspace/myapp.
When workspaceLocation is omitted, the default base is /workspace for every repository, so the behavior looks identical. The anchor does not change; it is simply the same as the default.
If initialization scripts expect all repositories under one base directory, adjust the secondary checkoutLocation so it points inside the custom location:
../myapp/extra/workspace/myapp/extraAbsolute paths avoid ambiguity during early workspace startup, when the working directory may not yet be /workspace.
workspaceLocation: /workspace/myapp and an additionalRepositories entry with checkoutLocation: extra.ls /workspace to confirm the extra repository is at /workspace/extra.checkoutLocation to ../myapp/extra or /workspace/myapp/extra, restart, and verify with ls /workspace/myapp.workspaceLocation and repeat to confirm the same /workspace-relative placement.These commands are read-only and scoped to the workspace filesystem.
Version note: This reflects current stable Gitpod configuration semantics. If you are using a self-hosted or pre-release variant, confirm against the latest .gitpod.yml reference.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.