Skip to content

go_deps: don't print version mismatch messages for go.work modules#2325

Merged
jayconrod merged 1 commit intomasterfrom
fix-go-work-version-warning
Apr 7, 2026
Merged

go_deps: don't print version mismatch messages for go.work modules#2325
jayconrod merged 1 commit intomasterfrom
fix-go-work-version-warning

Conversation

@jayconrod
Copy link
Copy Markdown
Contributor

What type of PR is this?

Bug fix

What package or component does this PR mostly affect?

go_deps

What does this PR do? Why is it needed?

Normally, go_deps prints a warning when a module is provided by bazel_dep, and the bazel_dep version does not match the version Go would select.

This warning is not actionable for modules that come from go.work files. go.work is used when there are multiple Go modules in the same workspace. Go doesn't allow this outside the main module, but go_deps does. The Go version for each module is not meaningful in this situation.

Which issues(s) does this PR fix?

Fixes #2315

Other notes for review

Normally, go_deps prints a warning when a module is provided by bazel_dep,
and the bazel_dep version does not match the version Go would select.

This warning is not actionable for modules that come from go.work files.
go.work is used when there are multiple Go modules in the same workspace.
Go doesn't allow this outside the main module, but go_deps does.
The Go version for each module is not meaningful in this situation.

Fixes #2315
@jayconrod jayconrod force-pushed the fix-go-work-version-warning branch from 78364ee to 71945be Compare April 6, 2026 20:44
@jayconrod jayconrod requested a review from fmeum April 6, 2026 20:50
@jayconrod
Copy link
Copy Markdown
Contributor Author

@fmeum I think I have this fixed now, sorry for the churn. I'll create a patch release once this lands.

I verified this manually by checking out BCR locally, creating a patch release pointing to a local archive, then bazel build --registry=file:///... @gazelle//cmd/gazelle.

@jayconrod jayconrod merged commit 181c8b6 into master Apr 7, 2026
17 checks passed
@jayconrod jayconrod deleted the fix-go-work-version-warning branch April 7, 2026 18:39
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/datadog-agent that referenced this pull request Apr 8, 2026
### What does this PR do?
- upgrade `gazelle` from 0.48.0 to **0.50.0**,
- drop the `git_override` that was pinning to a post-0.48.0 commit.

### Motivation
v0.50.0 is in the Bazel Central Registry and includes a more sustainable fix (bazel-contrib/bazel-gazelle#2325) than the `ignore_local_replaced_modules` feature (bazel-contrib/bazel-gazelle#2317) the `git_override` was introduced to get access to.

This will allow us to close [ABLD-415](https://datadoghq.atlassian.net/browse/ABLD-415).

### Describe how you validated your changes
CI.

### Additional Notes
There's another improvement since v0.49.0 we could benefit from:
- bazel-contrib/bazel-gazelle#2314

[ABLD-415]: https://datadoghq.atlassian.net/browse/ABLD-415?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
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.

Spurious No sum for github.com/bazel-contrib/bazel-gazelle/v2@2.0.0-1 found warnings

2 participants