Repository navigation
Workspace.git(): contextual information about a workspace's git repository - #13074
Merged
Merged
Conversation
shykes
force-pushed
the
workspace-git
branch
3 times, most recently
from
May 5, 2026 07:56
cb13ac3 to
47e0712
Compare
alexcb
reviewed
May 5, 2026
| if err != nil { | ||
| return fmt.Errorf("workspace git metadata: %w", err) | ||
| } | ||
| if st.FileType == core.FileTypeRegular { |
Contributor
There was a problem hiding this comment.
nit: if !st.IsDir() { below would also cover this case if I'm not mistaken.
alexcb
approved these changes
May 5, 2026
Contributor
Author
|
I'm reducing the scope of this - removing fields related to semver tags. Moving that part to #13086 instead (it's cleaner attached to |
shykes
force-pushed
the
workspace-git
branch
9 times, most recently
from
May 12, 2026 16:51
00ebda2 to
b684ab1
Compare
dagger-codex
Bot
force-pushed
the
workspace-git
branch
2 times, most recently
from
May 22, 2026 06:09
b19e833 to
6b77086
Compare
tiborvass
pushed a commit
that referenced
this pull request
Jun 3, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`.
tiborvass
pushed a commit
that referenced
this pull request
Jun 3, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
tiborvass
pushed a commit
that referenced
this pull request
Jun 4, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 4, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 8, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 8, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 8, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 8, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 9, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
tiborvass
pushed a commit
that referenced
this pull request
Jun 10, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
tiborvass
pushed a commit
to tiborvass/dagger
that referenced
this pull request
Jun 17, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR dagger#13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (dagger#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
This was referenced Jun 18, 2026
shykes
added a commit
that referenced
this pull request
Jun 18, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
shykes
added a commit
that referenced
this pull request
Jun 18, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
shykes
added a commit
that referenced
this pull request
Jun 18, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
shykes
added a commit
that referenced
this pull request
Jun 18, 2026
Switch the Go builder's VCS-injection input from a raw *dagger.GitRepository (+defaultPath="/") to an auto-acquired *dagger.Workspace, reading HEAD commit and uncommitted state via Workspace.git. This is the follow-up the TODO in New() referenced (#13074, now merged). Workspace.git is lazier (no full repo upload), supports nested workspaces cleanly, and exposes the same uncommitted/gitignore semantics the engine already implements. BLOCKED — needs codegen against a 1.0 engine before it compiles: Workspace.git is only exposed in the v1.0.0+ API view, so toolchains/go must depend on a 1.0 engine. engineVersion is bumped to v1.0.0-beta.3 here, but the internal/dagger client bindings and the runtime dispatch in dagger.gen.go still target v0.21.7 and must be regenerated against a 1.0 engine (DAGGER_X_RELEASE) — e.g. `dagger generate go:generate-dagger-runtimes`. That regen is intentionally left out of this commit so it can be done once the repo's modules move to 1.0. Signed-off-by: Solomon Hykes <[email protected]>
tiborvass
pushed a commit
that referenced
this pull request
Jun 29, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR #13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
tiborvass
pushed a commit
to tiborvass/dagger
that referenced
this pull request
Jul 1, 2026
Add an auto-acquired *dagger.GitRepository input to the Go builder's New constructor. When present (default: the workspace root), read HEAD commit and uncommitted state, and append -X github.com/dagger/go/buildinfo.Injected*= values to the -ldflags pipeline. Binaries that import buildinfo (transitively via github.com/dagger/dagger/internal/version, after P1) self-report VCS info through runtime/debug.ReadBuildInfo without needing .git inside the build container. GitRepository was chosen over a Directory input because it's lazier — no full repo upload, the engine fetches only what GraphQL operations actually need. The dirty signal uses GitRepository.uncommitted, which the engine already implements with the right gitignore semantics. Inspection errors are swallowed silently — builds proceed without VCS info rather than aborting (matches the deleted version/ module's failure mode). TODO: switch to Workspace.git (PR dagger#13074) when Dagger >= 1.0.0-beta.2. It's lazier still, supports nested workspaces cleanly, and will expose commit time once the GitCommit proposal (dagger#13086) lands. No caller changes needed: cli-dev/engine-dev/release continue calling dag.Go(GoOpts{...}) unchanged. The new input auto-acquires from the workspace root at module-call time. dagger.gen.go for consumers will pick up the new optional field next time they run `dagger develop`. Signed-off-by: Solomon Hykes <[email protected]>
tiborvass
added a commit
that referenced
this pull request
Jul 2, 2026
Implements the version/build identity foundation from discussion #13287. This replaces the old Dagger `version` module and its git-tag-walking logic with build identity embedded in the binaries themselves. Native Go builds use the VCS metadata already stamped by the Go toolchain; sandboxed Dagger Go builds inject the same metadata through `github.com/dagger/go/buildinfo` ldflags. ## What changes - Add `internal/version`, which embeds `internal/version/VERSION` and exposes `Version`, `Commit`, `Dirty`, `CommitTime`, and `Canonical()`. - Add `github.com/dagger/go/buildinfo` as the wrapper around `runtime/debug.ReadBuildInfo`, with injectable `-ldflags` vars for sandboxed builds. - Remove the standalone `/version` Dagger module and stop deriving versions by walking tags, merge-bases, or source digests inside Dagger. - Teach `toolchains/go` to accept a `GitRepository` input and stamp VCS metadata into binaries it builds. - Keep `engine.Version` and `engine.Tag` as the public version surfaces used by the CLI, engine, SDK defaults, and release code. - Keep release pipelines able to override `engine.Version` and `engine.Tag` via ldflags. - If `engine.Tag` is not explicitly set, derive it from the build identity: - release build -> `engine.Version` - dev build with commit -> commit - dev build without commit -> `main` - Change `dagger version` to a labeled output while preserving the existing operational fields. ## Output ``` $ dagger version version: v0.21.3 commit: 3059ea7 dirty: yes platform: linux/amd64 runner-host: image://registry.dagger.io/engine:v0.21.3 $ dagger version -q v0.21.3+3059ea74.dirty ``` ## Why The old version path mixed several responsibilities: user-facing version strings, engine image tags, git history inspection, source digests, and release metadata. That made version calculation slower, harder to reason about, and dependent on Dagger runtime behavior even though the result is fundamentally build identity. This PR moves build identity to the binary build step, where Go already has a standard mechanism for VCS metadata. The same identity model now works for native `go build` and sandboxed Dagger builds, while preserving the existing `engine.Version` / `engine.Tag` surfaces for callers that still rely on them. ## Not in this PR - No release-by-promotion redesign or release manifest work. - No Helm chart `VERSION` change. - No SDK migration work beyond regenerated bindings needed for this branch. - No switch to `Workspace.git`; `toolchains/go` keeps a TODO for that once available. - No commit-time injection beyond what is already available from Go build info. - No broader `engine.IsDevVersion` cleanup beyond recognizing `v1.0.0-dev` style prereleases. Refs: discussion #13287, #13074 (Workspace.git), #13086 (GitCommit proposal).
Closed
shykes
added a commit
that referenced
this pull request
Jul 16, 2026
Switch the Go builder's VCS-injection input from an explicit *dagger.GitRepository to *dagger.Workspace, reading the HEAD commit and uncommitted state via Workspace.git (#13074, shipped in 1.0). Workspace.git is lazier than a raw GitRepository (no full repo upload) and supports nested workspaces cleanly. The engine only auto-injects a Workspace on a *direct* client call. Module dependencies do not inherit the caller's workspace, so any module on a build path that reaches the go toolchain must forward its own (auto-injected) Workspace explicitly. The workspace arg (`ws`, optional) is therefore threaded from each direct-call entrypoint down to every dag.Go call site; when absent, VCS stamping is simply skipped. Threaded through the build paths only, leaving non-building methods untouched: - cli-dev: New -> go - engine-dev: New (private field) -> go / cli-dev / internal Builder - docs-dev: References -> engine-dev - dev: Agent (gopls) and Test -> go / engine-dev - release: Publish, TestLocalRelease, PublishWithMockEndpoints The stamping itself is inlined in go's New(): the HEAD commit and dirty state are written via -ldflags into github.com/dagger/go/buildinfo's Injected* vars, whose ReadBuildInfo wrapper overlays them onto the vcs.* settings so binaries self-report VCS info without a .git in the build container. engineVersion is bumped to v1.0.0-beta.6 for every touched module so the 1.0-only Workspace.git field and generated Ws opts fields are in the API view. NOTE: requires regenerating the affected module clients against a 1.0 engine before it compiles — Workspace.git and the Ws opts fields are absent from the checked-in bindings. Regen is intentionally left out (needs a running engine) and must be run separately. Signed-off-by: Solomon Hykes <[email protected]>
shykes
added a commit
that referenced
this pull request
Jul 16, 2026
Switch the Go builder's VCS-injection input from an explicit *dagger.GitRepository to *dagger.Workspace, reading the HEAD commit and uncommitted state via Workspace.git (#13074, shipped in 1.0). Workspace.git is lazier than a raw GitRepository (no full repo upload) and supports nested workspaces cleanly. The engine only auto-injects a Workspace on a *direct* client call. Module dependencies do not inherit the caller's workspace, so any module on a build path that reaches the go toolchain must forward its own (auto-injected) Workspace explicitly. The workspace arg (`ws`, optional) is therefore threaded from each direct-call entrypoint down to every dag.Go call site; when absent, VCS stamping is simply skipped. Threaded through the build paths only, leaving non-building methods untouched: - cli-dev: New -> go - engine-dev: New (private field) -> go / cli-dev / internal Builder - docs-dev: References -> engine-dev - dev: Agent (gopls) and Test -> go / engine-dev - release: forwards its existing Workspace field (added by #13659) from Publish / TestLocalRelease / PublishWithMockEndpoints The stamping itself is inlined in go's New(): the HEAD commit and dirty state are written via -ldflags into github.com/dagger/go/buildinfo's Injected* vars, whose ReadBuildInfo wrapper overlays them onto the vcs.* settings so binaries self-report VCS info without a .git in the build container. engineVersion is bumped to v1.0.0-beta.6 for every touched module so the 1.0-only Workspace.git field and generated Ws opts fields are in the API view. NOTE: requires regenerating the affected module clients against a 1.0 engine before it compiles — Workspace.git and the Ws opts fields are absent from the checked-in bindings. Regen is intentionally left out (needs a running engine) and must be run separately. Signed-off-by: Solomon Hykes <[email protected]>
shykes
added a commit
that referenced
this pull request
Jul 17, 2026
Switch the Go builder's VCS-injection input from an explicit *dagger.GitRepository to *dagger.Workspace, reading the HEAD commit and uncommitted state via Workspace.git (#13074, shipped in 1.0). Workspace.git is lazier than a raw GitRepository (no full repo upload) and supports nested workspaces cleanly. The engine only auto-injects a Workspace on a *direct* client call. Module dependencies do not inherit the caller's workspace, so any module on a build path that reaches the go toolchain must forward its own (auto-injected) Workspace explicitly. The workspace arg (`ws`, optional) is therefore threaded from each direct-call entrypoint down to every dag.Go call site; when absent, VCS stamping is simply skipped. Threaded through the build paths only, leaving non-building methods untouched: - cli-dev: New -> go - engine-dev: New (private field) -> go / cli-dev / internal Builder - docs-dev: References -> engine-dev - dev: Agent (gopls) and Test -> go / engine-dev - release: forwards its existing Workspace field (added by #13659) from Publish / TestLocalRelease / PublishWithMockEndpoints The stamping itself is inlined in go's New(): the HEAD commit and dirty state are written via -ldflags into github.com/dagger/go/buildinfo's Injected* vars, whose ReadBuildInfo wrapper overlays them onto the vcs.* settings so binaries self-report VCS info without a .git in the build container. engineVersion is bumped to v1.0.0-beta.6 for every touched module so the 1.0-only Workspace.git field and generated Ws opts fields are in the API view. NOTE: requires regenerating the affected module clients against a 1.0 engine before it compiles — Workspace.git and the Ws opts fields are absent from the checked-in bindings. Regen is intentionally left out (needs a running engine) and must be run separately. Signed-off-by: Solomon Hykes <[email protected]>
shykes
added a commit
that referenced
this pull request
Jul 18, 2026
Switch the Go builder's VCS-injection input from an explicit *dagger.GitRepository to *dagger.Workspace, reading the HEAD commit and uncommitted state via Workspace.git (#13074, shipped in 1.0). Workspace.git is lazier than a raw GitRepository (no full repo upload) and supports nested workspaces cleanly. The engine only auto-injects a Workspace on a *direct* client call. Module dependencies do not inherit the caller's workspace, so any module on a build path that reaches the go toolchain must forward its own (auto-injected) Workspace explicitly. The workspace arg (`ws`, optional) is therefore threaded from each direct-call entrypoint down to every dag.Go call site; when absent, VCS stamping is simply skipped. Threaded through the build paths only, leaving non-building methods untouched: - cli-dev: New -> go - engine-dev: New (private field) -> go / cli-dev / internal Builder - docs-dev: References -> engine-dev - dev: Agent (gopls) and Test -> go / engine-dev - release: forwards its existing Workspace field (added by #13659) from Publish / TestLocalRelease / PublishWithMockEndpoints The stamping itself is inlined in go's New(): the HEAD commit and dirty state are written via -ldflags into github.com/dagger/go/buildinfo's Injected* vars, whose ReadBuildInfo wrapper overlays them onto the vcs.* settings so binaries self-report VCS info without a .git in the build container. engineVersion is bumped to v1.0.0-beta.6 for every touched module so the 1.0-only Workspace.git field and generated Ws opts fields are in the API view. NOTE: requires regenerating the affected module clients against a 1.0 engine before it compiles — Workspace.git and the Ws opts fields are absent from the checked-in bindings. Regen is intentionally left out (needs a running engine) and must be run separately. Signed-off-by: Solomon Hykes <[email protected]>
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.
This adds
Workspace.git, a local git view for the current workspace.Schema diff (tracks latest
workspace-gitbranch / PR head): https://github.com/dagger/dagger/pull/13074/files#diff-1b91750d917ed604e8eb08e4f5325f167511cd697317187b56d84b3736662e5funcommittedchecks the whole repository, even when the current workspace is a nested directory. Worktrees are not supported yet;.gitpoints outside the workspace boundary, so this returns an explicit unsupported-worktree error instead of following it.Semver tag helpers are left for the
GitCommitproposal in #13086.Tests