Skip to content

sdk/go: announce the library version by default - #14879

Merged
eunomie merged 1 commit into
dagger:mainfrom
eunomie:sdk-target/go-lib-announce
Oct 28, 2026
Merged

eunomie merged 1 commit into
dagger:mainfrom
eunomie:sdk-target/go-lib-announce

Conversation

@eunomie

@eunomie eunomie commented Oct 27, 2026

Copy link
Copy Markdown
Member

The Go library's default connection sent no --version to the dagger session it spawns, so a standalone client that ran a custom CLI (_EXPERIMENTAL_DAGGER_CLI_BIN) or the dagger found on PATH announced that CLI's version, not the release its core was generated for.

engineconn.cliSessionArgs now defaults --version to the library's own release, the generated CLIVersion, when the caller set no WithVersionOverride. An explicit override still wins. With the downloaded CLI nothing changes, because that CLI's version already equals CLIVersion. The existing-session path (DAGGER_SESSION_PORT) spawns no CLI and still announces nothing. session --version exists in every CLI since v0.13.0, so every binary the library can reach accepts the flag.

The default lives in the one place all spawned-CLI paths share, so the core constructors, ModuleGraphQLClient and generated clients all get it.

The change reaches modules only through library tags that contain it; older tags keep announcing the CLI's version.

Checks run: three new tests in sdk/go/engineconn/session_test.go (default announces CLIVersion, explicit override wins, existing-session path announces nothing), the full engineconn tests, and go build and go vet in sdk/go. Removing either version assignment fails the matching test.

Not run here: engine-backed integration tests. A changelog fragment is not added yet because the repo keys fragments on the PR number.

The default connection sent no --version, so a standalone client running a
custom or PATH CLI announced that CLI's version, not the release its
generated code targets. An explicit WithVersionOverride still wins.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie marked this pull request as ready for review October 27, 2026 17:14
@eunomie
eunomie requested a review from a team as a code owner October 27, 2026 17:14
@eunomie
eunomie merged commit 5155ae0 into dagger:main Oct 28, 2026
92 checks passed
@eunomie
eunomie deleted the sdk-target/go-lib-announce branch October 28, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants