Repository navigation
Conversation
paikend
force-pushed
the
fix/workspace-path-leading-slash
branch
2 times, most recently
from
April 20, 2026 11:15
6797c49 to
1c53914
Compare
Closes dagger#12970 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: kent paik <paikend@gmail.com>
Per issue dagger#12970, Workspace.path now returns a leading-slash path from the workspace boundary. Update the integration test assertion accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: kent paik <paikend@gmail.com>
…s.Path
The prior approach set `core.Workspace.Path` to `path.Join("/", detected.Path)`
which made the internal boundary-relative path absolute. This silently weakened
workspace path-traversal protection: `resolveWorkspacePath("../..", "/")` =
`"/"` because `filepath.Join` absorbs traversal at the root, so
`ws.directory("../..")` resolved to the workspace root instead of erroring
with "resolves outside root" (see `TestWorkspacePathTraversal`).
Keep `ws.Path` stored as boundary-relative (no leading slash) and expose it
over GraphQL via a custom `path` resolver that applies the existing
`workspaceAPIPath` helper. This leaves internal consumers
(`resolveWorkspacePath`, `filepath.Join(ws.Root, ws.Path, ...)`, etc.) and
their traversal checks unchanged while still satisfying the API contract
from dagger#12970.
- Revert `engine/server/session_workspaces.go` to `Path: detected.Path`
- Drop `field:"true"` from `core.Workspace.Path` so auto-exposure is off
- Register `dagql.Func("path", s.path)` with the same doc string the SDKs
already generate, so codegen stays in sync
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: kent paik <paikend@gmail.com>
paikend
force-pushed
the
fix/workspace-path-leading-slash
branch
from
May 4, 2026 12:31
2ae9fe3 to
88fc5a7
Compare
Signed-off-by: kent paik <paikend@gmail.com>
paikend
force-pushed
the
fix/workspace-path-leading-slash
branch
from
May 14, 2026 00:25
8979ee4 to
09ec220
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workspace.pathnow returns paths with a leading/(e.g./app/frontendinstead ofapp/frontend,/instead of.)Changes
engine/server/session_workspaces.go: usepath.Join("/", detected.Path)when settingcore.Workspace.Pathcore/workspace.go: update field doc to reflect the new formatCloses #12970
Test plan
TestLocalWorkspaceAddresspasses (Docker, Go 1.25, Linux)TestRemoteWorkspaceAddresspassesworkspace.Workspace.Path(used infilepath.Join) unchanged — no side effects🤖 Generated with Claude Code