Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OTel dependencies for go workspaces #793

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

braydonk
Copy link
Contributor

@braydonk braydonk commented Jan 9, 2024

This PR updates all OTel dependencies to the latest version to allow this repo to leverage go workspaces without the ambiguous import problem with github.com/knadh/koanf.

To produce these changes I did the following:

go work init
go work use -r .
go mod edit -exclude=github.com/knadh/koanf@v1.5.0
go work sync

I then updated the OTel versions in the Makefile, and added a couple OTel dependencies that weren't listed in the update-otel target. Then ran make update-otel.

I also added a new make target that will generate the Go module workspace.

This PR updates all OTel dependencies to the latest version to allow
this repo to leverage go workspaces without the ambiguous import problem
with `github.com/knadh/koanf`.
@braydonk braydonk requested a review from a team as a code owner January 9, 2024 15:55
go run cmd/recordfixtures/main.go
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (02b243a) 69.94% compared to head (df816ab) 70.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #793      +/-   ##
==========================================
+ Coverage   69.94%   70.02%   +0.08%     
==========================================
  Files          42       42              
  Lines        4877     4877              
==========================================
+ Hits         3411     3415       +4     
+ Misses       1315     1311       -4     
  Partials      151      151              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dashpole
Copy link
Contributor

dashpole commented Jan 9, 2024

/gcbrun

Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any action required for developers to use go workspaces with this repo?

@dashpole dashpole merged commit 7329e68 into GoogleCloudPlatform:main Jan 9, 2024
27 checks passed
@braydonk
Copy link
Contributor Author

braydonk commented Jan 9, 2024

@dashpole they need to run make go-work. For now I left the workspace stuff as optional, with the go.work files in .gitignore, but we could also try just adding them to the repo so workspaces are automatic for everyone.

braydonk added a commit to GoogleCloudPlatform/opentelemetry-operations-collector that referenced this pull request Jan 9, 2024
This change allows for this repo to be used as part of a Go workspace.
This is very useful in tandem with either `opentelemetry-operations-go`
or `opentelemetry-collector-contrib` because it allows us to create a
workspace with this collector and the library we want to test, add a
manual replacement in the workspace for that dependency, and be able to
test the collector with local copies of the dependency without changing
anything.

Related: GoogleCloudPlatform/opentelemetry-operations-go#793
@damemi
Copy link
Contributor

damemi commented Jan 17, 2024

Thanks for making the workspaces changes @braydonk, especially figuring out that knadh/koanf issue. Was that go mod exclude supposed to be committed or part of the make go-work command you added?

I looked a little into workspaces and it sounds like go.work files shouldn't be committed, basically because they would then silently override dependencies for everyone. But +1 to adding a makefile step to set it up more easily

braydonk added a commit to GoogleCloudPlatform/opentelemetry-operations-collector that referenced this pull request Mar 20, 2024
This change allows for this repo to be used as part of a Go workspace.
This is very useful in tandem with either `opentelemetry-operations-go`
or `opentelemetry-collector-contrib` because it allows us to create a
workspace with this collector and the library we want to test, add a
manual replacement in the workspace for that dependency, and be able to
test the collector with local copies of the dependency without changing
anything.

Related: GoogleCloudPlatform/opentelemetry-operations-go#793
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.

3 participants