Skip to content

(fix)build: disable proto rule generation, rely on checked-in .pb.go for go-code compatibility#293

Merged
roychying merged 3 commits into
uber:mainfrom
roychying:chenghan.ying/disable-proto-gazelle
Jul 2, 2026
Merged

(fix)build: disable proto rule generation, rely on checked-in .pb.go for go-code compatibility#293
roychying merged 3 commits into
uber:mainfrom
roychying:chenghan.ying/disable-proto-gazelle

Conversation

@roychying

@roychying roychying commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Why?

We want the smoothest DX for consuming the OSS submitqueue repo in go-code. Today go-code's go_repository uses build_file_generation = "on", so its Gazelle regenerates BUILD files for the vendored repo. This causes conflicts and mismatches, and every version bump risks new patching.

The root issue is that OSS carries proto types twice: as checked-in .pb.go in protopb/, and as Bazel-generated code via go_proto_library in proto/. Removing the Bazel proto rules in favor of the checked-in .pb.go fixes several things at once:

  • Eliminates duplicate proto definitions. The two generation paths share the same importpath, which caused the duplicate-importpath ambiguity and forced the gazelle:resolve workarounds. Collapsing to a single source removes that whole class of conflict.
  • Serves non-Bazel consumers. The Bazel-generated code only exists inside a Bazel build graph. Anyone consuming submitqueue via plain go build/go get (including OSS users) can only use the checked-in .pb.go, so that path must work regardless. The Bazel proto rules are a redundant second path that serves no one the checked-in files don't already serve.

What?

Disable Gazelle proto rule generation and remove all proto compilation rules, relying solely on checked-in .pb.go files.

  • Add # gazelle:proto disable_global to prevent Gazelle from regenerating proto rules on future make gazelle runs
  • Remove the gazelle:resolve directives that are no longer needed
  • Remove proto_library, go_proto_library, and alias go_library rules
  • Keep exports_files for make proto codegen (tool/proto/BUILD.bazel)

Test Plan

  • make build - pass
  • make test - 65/65 unit tests pass (integration/e2e tests fail due to Docker dependency, pre-existing)
  • bazel build //tool/proto:generated - proto codegen still works
  • make gazelle - zero warnings, no duplicate-importpath ambiguity
  • Validated in go-code with --override_repository pointing at this branch: all 71 targets build, all 20 tests pass across stovepipe, submitqueue/gateway, and submitqueue/orchestrator

Issue

@roychying roychying requested review from a team, behinddwalls and sbalabanov as code owners July 1, 2026 19:12
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


chenghan.ying seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@roychying roychying changed the title Chenghan.ying/disable proto gazelle (fix)build: disable proto rule generation, rely on checked-in .pb.go for go-code compatibility Jul 1, 2026
@roychying roychying added this pull request to the merge queue Jul 2, 2026
Merged via the queue into uber:main with commit bf31d60 Jul 2, 2026
14 of 15 checks passed
@roychying roychying deployed to stack-rebase July 2, 2026 16:54 — with GitHub Actions Active
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.

4 participants