Repository navigation
[backport-0.21] Pin otel-go and otel/sdk in generated Go modules - #14646
Merged
Merged
Conversation
Code generated for Go modules imports github.com/dagger/otel-go and go.opentelemetry.io/otel/sdk, but this SDK didn't require them. Module codegen copies the SDK's requirements into each generated module's go.mod, so `go mod tidy` there had to look up which module provides each of those imports over the network, and then picked whatever version was newest at the time. Require them through a tools-tagged package, so codegen pins them like the SDK's other dependencies. The tag keeps them out of builds. Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit dc03a9e) Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
A fresh client module only required dagger.io/dagger. When tidy resolved its direct imports, it could select the newest OTel release instead of the versions used by the SDK. Importing that client from a Dagger module then conflicted with the pinned OTel log package. Seed new client modules with the embedded SDK requirements before running tidy. Preserve existing client modules and their chosen versions. Add a test for the initial module requirements. Signed-off-by: Tibor Vass <[email protected]> (cherry picked from commit 7eddc48) Signed-off-by: Yves Brissaud <[email protected]>
crazymax/goxx:latest moved to Go 1.27, where golang.org/x/net v0.54.0 no longer defines http2.TrailerPrefix, so grpc v1.80.0 fails to build. Signed-off-by: Yves Brissaud <[email protected]>
The test binds a consumer exec to app, and app to dep, and asserts that dep's exit reaches the consumer through app as "bound service <app> exited: ... bound service <dep> exited: exit code: 42". dep ran "sleep 1; exit 42" with no gate, so when app's startup took longer than 1s the service start loop took its other designed branch and failed app's start with "start <app> (aliased as app): bound service <dep> (aliased as dep) exited", which the test does not accept. Make the ordering causal instead of timing-based. The consumer's command touches a marker on a per-run shared cache volume, and dep exits 42 only once that marker exists. By then app has been returned as running and the consumer's bound-service monitor is installed. dep's watchdog exits 1, not 42, if the marker never appears. app now loops until killed instead of sleeping 30s, so it cannot exit on its own while a slow consumer is still setting up. The consumer is still not bound to dep, and the assertions are unchanged. Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 70c1201) Signed-off-by: Yves Brissaud <[email protected]>
The test-split:test-telemetry CI trace showed the TypeScript fail-effect golden differing only by a transient packet-loss suffix on the failed span: ERROR (5.88% dropped). That metric reflects ephemeral network conditions in the test environment rather than the progress-rendering behavior the golden is asserting. Normalize packet-loss adornments in the shared scrubber and add focused coverage for the failing shape. Signed-off-by: Erik Sipsma <[email protected]> (cherry picked from commit 889d043) Signed-off-by: Yves Brissaud <[email protected]>
1 task
1 task
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.
[backport-0.21] Pin otel-go and otel/sdk in generated Go modules
Backport of #14450 (dc03a9e) to
backport-0.21.What broke
On v0.21.x, Go module codegen fails with:
It fails on every new
dagger init --sdk=go, and on any module whosego.moddoes not already requirego.opentelemetry.io/otel/sdk.Why
Generated code imports
github.com/dagger/otel-goandgo.opentelemetry.io/otel/sdk/resource. Codegen copiessdk/go/go.modinto the module, and that file requires neither, sogo mod tidyresolves both at their latest versions. Since 2026-10-02, latest means otel v1.47.0, whoseinternal/globalimportsotel/log. Codegen also copies theotel/log => v0.16.0replace, and v0.16.0 importsotel/internal/global. Together they form the cycle.Fix
sdk/go/internal/codegendepspackage makes codegen pin otel-go v1.43.0 and otel/sdk v1.43.0, as v1.0.0-beta.16 and later already do.syncModReplaceAndTidy.Codegen never downgrades, so modules already generated with otel v1.47.0 keep that version. To fix such a module, run:
Verification
cmd/codegen/generator/goandsdk/gotests pass.go mod tidy -diffis clean forsdk/goand for the root module.go.modsteps in scratch modules with Go 1.26 (seed requires, replaces,go get dagger.io/dagger,go mod tidy,go build):go getabove repairs an already broken module.