Commit 19a9535
(feat)build: Migrate Bazel target naming to go_default_library (#295)
Adopt go_default_library naming convention for Bazel targets
## Why?
The internal go-code monorepo consumes this repo via Bazel with
`build_file_generation = "off"` - it uses the checked-in `BUILD.bazel`
files **directly** instead of regenerating them. go-code's gazelle
enforces the`go_default_library` naming convention for all external
repos globally (`# gazelle:go_naming_convention_external
go_default_library`), so every dependency label it writes points at
`:go_default_library`. For go-code to reference this repo's targets
without per-import fixups, our targets must be reachable as
`:go_default_library`.
This complements the proto-disable change
(#293): together they let
go-code build this repo out of the box on Bazel 8.5.1 (which removed
`native.java_proto_library`, breaking `proto_library`).
## What?
- Add `# gazelle:go_naming_convention go_default_library` to the root
`BUILD.bazel` and regenerate target names via gazelle:
libraries/binaries ->`go_default_library`, tests -> `go_default_test`;
external refs normalize to `:go_default_library`.
- Manually migrate hand-authored, custom-named test targets that gazelle
cannot rename across a convention change:
- 9 integration/e2e `go_test` targets - `go_default_test` (`data`/`tags`
preserved once the name matches the convention),
- remove the redundant `platform/consumer:consumer_test` (gazelle now
emits `go_default_test` for that package),
- point the `Makefile` integration-test targets at `:go_default_test`.
- Drop redundant `# keep`-pinned short-name `protopb` deps - under the
new convention the `:go_default_library` equivalents are emitted beside
them, so the short-name `:protopb` labels are dangling.
## Test Plan
- `make gazelle` - clean and idempotent (no duplicate-rule errors).
- `make build` - 223 targets built.
- `make test` - 65/65 unit tests pass.
- Verified downstream consumption from go-code with
`build_file_generation="off"`
by overriding the module at this branch:
bazel test //src/.../submitqueue/{gateway,orchestrator,stovepipe}/...
--override_repository=com_github_uber_submitqueue=/path/to/submitqueue
- 71 targets build, 20/20 consumer tests pass.
## Issue
<!--
Link the issue here.
- Use 'Closes #123' if this is the final fix.
- Use 'Part of #123' or just '#123' if the feature is still in progress.
-->
Co-authored-by: chenghan.ying <chenghan.ying@uber.com>1 parent 3a6057c commit 19a9535
135 files changed
Lines changed: 1444 additions & 1439 deletions
File tree
- api
- base
- change/protopb
- mergestrategy/protopb
- messagequeue/protopb
- runway
- messagequeue
- protopb
- protopb
- stovepipe/protopb
- submitqueue
- gateway/protopb
- orchestrator/protopb
- platform
- base
- change
- changeutil
- github
- git
- phabricator
- mergestrategy
- messagequeue
- page
- consumer
- mock
- errs
- generic
- mysql
- extension
- counter
- mock
- mysql
- messagequeue
- mock
- mysql
- ctl
- lib
- http
- metrics
- runway
- controller
- mergeconflictcheck
- merge
- extension
- merger
- mock
- noop
- service
- runway
- client
- server
- stovepipe
- client
- server
- submitqueue
- gateway
- client
- server
- orchestrator
- client
- server
- stovepipe
- controller
- process
- core/messagequeue
- protopb
- entity
- extension
- sourcecontrol
- fake
- mock
- storage
- mock
- mysql
- submitqueue
- core
- changeset
- fake
- mock
- fakemarker
- request
- topickey
- entity
- extension
- buildrunner
- buildkite
- fake
- githubactions
- mock
- changeprovider
- fake
- github
- mock
- phabricator
- routing
- conflict
- all
- fake
- fileoverlap
- mock
- none
- mergechecker
- fake
- github
- mock
- pusher
- fake
- git
- mock
- queueconfig
- mock
- yaml
- scorer
- composite
- fake
- heuristic
- mock
- storage
- mock
- mysql
- gateway/controller
- log
- orchestrator/controller
- batch
- buildsignal
- build
- cancel
- conclude
- dlq
- mergeconflictsignal
- mergesignal
- merge
- score
- speculate
- start
- validate
- test
- e2e/submitqueue
- integration
- extension
- counter
- mysql
- messagequeue/mysql
- stovepipe
- extension/storage/mysql
- submitqueue
- core/consumer
- extension/storage
- mysql
- gateway
- orchestrator
- testutil
- tool/linter/licenseheader
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
0 commit comments