[PR #3470] [CLOSED] [misc] buf cli proto lint, format and generate #20525

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

📋 Pull Request Information

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

Base: mainHead: misc/buf-cli


📝 Commits (10+)

  • f6a71f4 [management] add openapi specs and generate types for port forwarding proxy (#3236)
  • 26693e4 Feature/port forwarding client ingress (#3242)
  • a76ca8c Merge branch 'main' into feature/port-forwarding
  • 6344e34 [management] renamed ingress port endpoints (#3263)
  • 829e40d Fix ingress manager unnecessary creation
  • a85ea1d [manager] ingress ports manager support (#3268)
  • 1b011a2 [client] Manage the IP forwarding sysctl setting in global way (#3270)
  • 9ec6120 [management] Add support for filtering peers by name and IP (#3279)
  • b2a5b29 Merge branch 'main' into feature/port-forwarding
  • 035c5d9 [management merge only unique entries on network map merge (#3277)

📊 Changes

153 files changed (+7510 additions, -5109 deletions)

View changed files

buf.gen.yaml (+7 -0)
buf.yaml (+10 -0)
📝 client/cmd/testutil_test.go (+2 -2)
📝 client/firewall/create.go (+3 -2)
📝 client/firewall/create_linux.go (+6 -5)
📝 client/firewall/iptables/acl_linux.go (+1 -0)
📝 client/firewall/iptables/manager_linux.go (+6 -5)
📝 client/firewall/iptables/manager_linux_test.go (+4 -4)
📝 client/firewall/iptables/router_linux.go (+3 -2)
📝 client/firewall/iptables/router_linux_test.go (+1 -1)
📝 client/firewall/manager/firewall.go (+10 -2)
📝 client/firewall/nftables/acl_linux.go (+3 -4)
📝 client/firewall/nftables/manager_linux.go (+4 -3)
📝 client/firewall/nftables/manager_linux_test.go (+4 -3)
📝 client/firewall/nftables/router_linux.go (+3 -2)
📝 client/firewall/nftables/router_linux_test.go (+1 -1)
📝 client/firewall/uspfilter/allow_netbird.go (+5 -4)
📝 client/firewall/uspfilter/allow_netbird_windows.go (+10 -5)
📝 client/firewall/uspfilter/conntrack/common.go (+30 -90)
📝 client/firewall/uspfilter/conntrack/common_test.go (+18 -45)

...and 80 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/3470 **Author:** [@pnmcosta](https://github.com/pnmcosta) **Created:** 3/9/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `misc/buf-cli` --- ### 📝 Commits (10+) - [`f6a71f4`](https://github.com/netbirdio/netbird/commit/f6a71f419364f89780a9309046a19e0fba69fe35) [management] add openapi specs and generate types for port forwarding proxy (#3236) - [`26693e4`](https://github.com/netbirdio/netbird/commit/26693e4ea8e92317e2a20d780fd900fe21773765) Feature/port forwarding client ingress (#3242) - [`a76ca8c`](https://github.com/netbirdio/netbird/commit/a76ca8c5657665c8581cf273fae630b26d0ee5c9) Merge branch 'main' into feature/port-forwarding - [`6344e34`](https://github.com/netbirdio/netbird/commit/6344e34880c8e41ce0050648ab412ca2d46bf597) [management] renamed ingress port endpoints (#3263) - [`829e40d`](https://github.com/netbirdio/netbird/commit/829e40d2aa15ba0db0d69f2f2e041918cafaaa62) Fix ingress manager unnecessary creation - [`a85ea1d`](https://github.com/netbirdio/netbird/commit/a85ea1ddb0ca56dabf13ed790c1fb3251d9a78e5) [manager] ingress ports manager support (#3268) - [`1b011a2`](https://github.com/netbirdio/netbird/commit/1b011a2d85b4c3cc4577343c09854d7563e00c09) [client] Manage the IP forwarding sysctl setting in global way (#3270) - [`9ec6120`](https://github.com/netbirdio/netbird/commit/9ec61206c231eece4ae51f597f9385d322d3b866) [management] Add support for filtering peers by name and IP (#3279) - [`b2a5b29`](https://github.com/netbirdio/netbird/commit/b2a5b29fb2474e76a7a92dccb881c8616069ddde) Merge branch 'main' into feature/port-forwarding - [`035c5d9`](https://github.com/netbirdio/netbird/commit/035c5d9f23a7a09deebf7d40eaefc770bb2ce818) [management merge only unique entries on network map merge (#3277) ### 📊 Changes **153 files changed** (+7510 additions, -5109 deletions) <details> <summary>View changed files</summary> ➕ `buf.gen.yaml` (+7 -0) ➕ `buf.yaml` (+10 -0) 📝 `client/cmd/testutil_test.go` (+2 -2) 📝 `client/firewall/create.go` (+3 -2) 📝 `client/firewall/create_linux.go` (+6 -5) 📝 `client/firewall/iptables/acl_linux.go` (+1 -0) 📝 `client/firewall/iptables/manager_linux.go` (+6 -5) 📝 `client/firewall/iptables/manager_linux_test.go` (+4 -4) 📝 `client/firewall/iptables/router_linux.go` (+3 -2) 📝 `client/firewall/iptables/router_linux_test.go` (+1 -1) 📝 `client/firewall/manager/firewall.go` (+10 -2) 📝 `client/firewall/nftables/acl_linux.go` (+3 -4) 📝 `client/firewall/nftables/manager_linux.go` (+4 -3) 📝 `client/firewall/nftables/manager_linux_test.go` (+4 -3) 📝 `client/firewall/nftables/router_linux.go` (+3 -2) 📝 `client/firewall/nftables/router_linux_test.go` (+1 -1) 📝 `client/firewall/uspfilter/allow_netbird.go` (+5 -4) 📝 `client/firewall/uspfilter/allow_netbird_windows.go` (+10 -5) 📝 `client/firewall/uspfilter/conntrack/common.go` (+30 -90) 📝 `client/firewall/uspfilter/conntrack/common_test.go` (+18 -45) _...and 80 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 05:07:22 -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#20525