[PR #3649] [CLOSED] [misc] buf cli proto lint, format and gen #18098

Open
opened 2026-08-05 04:08:07 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3649
Author: @pnmcosta
Created: 4/9/2025
Status: Closed

Base: mainHead: feature/buf-cli


📝 Commits (3)

  • 12b0c13 [misc] buf cli proto lint, format and gen
  • d1e4bb0 Merge branch 'main' into feature/buf-cli
  • 43176fb Merge branch 'main' into feature/buf-cli

📊 Changes

21 files changed (+2338 additions, -3859 deletions)

View changed files

buf.gen.yaml (+7 -0)
buf.yaml (+10 -0)
📝 client/proto/daemon.pb.go (+943 -1686)
📝 client/proto/daemon_grpc.pb.go (+114 -80)
client/proto/generate.sh (+0 -17)
encryption/testprotos/generate.sh (+0 -2)
📝 encryption/testprotos/testproto.pb.go (+38 -53)
📝 flow/proto/flow.pb.go (+144 -215)
📝 flow/proto/flow_grpc.pb.go (+38 -56)
flow/proto/generate.sh (+0 -17)
management/proto/generate.sh (+0 -17)
📝 management/proto/management.pb.go (+774 -1335)
📝 management/proto/management_grpc.pb.go (+62 -54)
📝 proto/daemon/daemon.proto (+15 -23)
📝 proto/flow/flow.proto (+3 -3)
📝 proto/management/management.proto (+13 -19)
📝 proto/signalexchange/signalexchange.proto (+4 -5)
📝 proto/testprotos/testproto.proto (+3 -3)
signal/proto/generate.sh (+0 -17)
📝 signal/proto/signalexchange.pb.go (+128 -199)

...and 1 more files

📄 Description

Describe your changes

This PR introduces the buf cli tool.

It offers various features, including code generation, breaking change detection, linting, and formatting, to assist with Protobuf development and maintenance.

Source: https://buf.build/docs/cli/

One of the challenges with Protobuf code generation is the complexity of working with protoc and plugins. Managing and maintaining a stable environment locally on a single machine is hard enough given the complex web of different compiler and plugin versions. The problem is compounded as you scale out code generation across many developers, and often results in a series of ugly bash scripts shared between team members.

Source: https://buf.build/docs/generate/overview/

Buf's remote plugins remove a key obstacle to generating code from Protobuf files—protoc plugins are developed across many languages, and manual installation is inconsistent as a result. Managing and maintaining a stable environment on a single machine is hard enough, and the problem is compounded as you scale out code generation across many developers.

Source: https://buf.build/docs/bsr/remote-plugins/overview/

Quickstart: https://buf.build/docs/cli/quickstart/#generate-go-and-connect-stubs
Generate Tutorial: https://buf.build/docs/generate/tutorial/
Breaking Tutorial: https://buf.build/docs/breaking/tutorial/
Lint Tutorial: https://buf.build/docs/lint/tutorial/#inspect-the-workspace

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/3649 **Author:** [@pnmcosta](https://github.com/pnmcosta) **Created:** 4/9/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/buf-cli` --- ### 📝 Commits (3) - [`12b0c13`](https://github.com/netbirdio/netbird/commit/12b0c135118bbe032c7df08eb75ade97f69244b5) [misc] buf cli proto lint, format and gen - [`d1e4bb0`](https://github.com/netbirdio/netbird/commit/d1e4bb0fa3aad41fc750e697296e7cde5a32e9d6) Merge branch 'main' into feature/buf-cli - [`43176fb`](https://github.com/netbirdio/netbird/commit/43176fb96cff154f75549f49ce3c9e6bbe55cea2) Merge branch 'main' into feature/buf-cli ### 📊 Changes **21 files changed** (+2338 additions, -3859 deletions) <details> <summary>View changed files</summary> ➕ `buf.gen.yaml` (+7 -0) ➕ `buf.yaml` (+10 -0) 📝 `client/proto/daemon.pb.go` (+943 -1686) 📝 `client/proto/daemon_grpc.pb.go` (+114 -80) ➖ `client/proto/generate.sh` (+0 -17) ➖ `encryption/testprotos/generate.sh` (+0 -2) 📝 `encryption/testprotos/testproto.pb.go` (+38 -53) 📝 `flow/proto/flow.pb.go` (+144 -215) 📝 `flow/proto/flow_grpc.pb.go` (+38 -56) ➖ `flow/proto/generate.sh` (+0 -17) ➖ `management/proto/generate.sh` (+0 -17) 📝 `management/proto/management.pb.go` (+774 -1335) 📝 `management/proto/management_grpc.pb.go` (+62 -54) 📝 `proto/daemon/daemon.proto` (+15 -23) 📝 `proto/flow/flow.proto` (+3 -3) 📝 `proto/management/management.proto` (+13 -19) 📝 `proto/signalexchange/signalexchange.proto` (+4 -5) 📝 `proto/testprotos/testproto.proto` (+3 -3) ➖ `signal/proto/generate.sh` (+0 -17) 📝 `signal/proto/signalexchange.pb.go` (+128 -199) _...and 1 more files_ </details> ### 📄 Description ## Describe your changes This PR introduces the [buf cli](https://buf.build/product/cli) tool. > It offers various features, including code generation, breaking change detection, linting, and formatting, to assist with Protobuf development and maintenance. Source: https://buf.build/docs/cli/ > One of the challenges with Protobuf code generation is the complexity of working with protoc and plugins. Managing and maintaining a stable environment locally on a single machine is hard enough given the complex web of different compiler and plugin versions. The problem is compounded as you scale out code generation across many developers, and often results in a series of ugly bash scripts shared between team members. Source: https://buf.build/docs/generate/overview/ > Buf's remote plugins remove a key obstacle to generating code from Protobuf files—protoc plugins are developed across many languages, and manual installation is inconsistent as a result. Managing and maintaining a stable environment on a single machine is hard enough, and the problem is compounded as you scale out code generation across many developers. Source: https://buf.build/docs/bsr/remote-plugins/overview/ Quickstart: https://buf.build/docs/cli/quickstart/#generate-go-and-connect-stubs Generate Tutorial: https://buf.build/docs/generate/tutorial/ Breaking Tutorial: https://buf.build/docs/breaking/tutorial/ Lint Tutorial: https://buf.build/docs/lint/tutorial/#inspect-the-workspace ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 04:08:07 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#18098