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

Bazel7 Workspace Support #237

Closed
wants to merge 3 commits into from
Closed

Conversation

bstoll
Copy link
Contributor

@bstoll bstoll commented Dec 18, 2024

This change updates the build process to use newer tooling with Bazel WORKSPACEs.

  • In WORKSPACE, prefer to load dependencies closest to the project first.
  • Gazelle builds go deps (bazel run //:gazelle_update_repos)
  • Gazelle can generate BUILD files (bazel run //:gazelle) for protos & Go.
  • Sync up go.mod and WORKSPACE versions
  • Start using import_prefixes more consistently. This should make GRPC reflection work a bit better.

This is notably missing bzlmod support. We need to import GNSI, GNMI, and bootz into this repo but none of these use bzlmod yet. I believe the best way is to start at the bottom and migrate them one by one (starting with GNMI) - alternatively, we could patch them up but this is a bit clunky to do.

The GRPC compiler has an arg difference that results in different generated output: GRPC interfaces generally include mustEmbedUnimplementedXYZ, while the @io_bazel_rules_go//proto:go_grpc_v2 does not enforce this. Since we already generate with the mustEmbed, it would seem ideal to keep doing this.

@bstoll bstoll marked this pull request as draft December 18, 2024 00:32
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12383951571

Details

  • 35 of 1863 (1.88%) changed or added relevant lines in 36 files are covered.
  • 233 unchanged lines in 19 files lost coverage.
  • Overall coverage increased (+0.2%) to 1.355%

Changes Missing Coverage Covered Lines Changed/Added Lines %
debug/debug_grpc.pb.go 0 1 0.0%
otdr/otdr_grpc.pb.go 0 1 0.0%
packet_capture/packet_capture_grpc.pb.go 0 1 0.0%
bgp/bgp_grpc.pb.go 0 2 0.0%
factory_reset/factory_reset_grpc.pb.go 0 2 0.0%
common/common.pb.go 1 4 25.0%
bootconfig/bootconfig_grpc.pb.go 0 4 0.0%
mpls/mpls_grpc.pb.go 0 5 0.0%
os/os_grpc.pb.go 0 5 0.0%
diag/diag_grpc.pb.go 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
common/common.pb.go 1 32.29%
bgp/bgp.pb.go 2 27.78%
debug/debug.pb.go 3 0.0%
bootconfig/bootconfig.pb.go 4 0.0%
factory_reset/factory_reset.pb.go 4 0.0%
types/types.pb.go 4 30.84%
mpls/mpls.pb.go 8 0.0%
otdr/otdr.pb.go 8 0.0%
layer2/layer2.pb.go 10 0.0%
wavelength_router/wavelength_router.pb.go 10 0.0%
Totals Coverage Status
Change from base Build 12383854593: 0.2%
Covered Lines: 162
Relevant Lines: 11955

💛 - Coveralls

@bstoll
Copy link
Contributor Author

bstoll commented Jan 14, 2025

Closing this in favor of #248.

@bstoll bstoll closed this Jan 14, 2025
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.

2 participants