Working with gRPC definitions between master and slave? Here’s how to properly use buf CLI to manage your .proto files efficiently. 💡
- Install Buf CLI:
- Follow the official installation guide.
- Ensure Buf CLI is properly installed before contributing.
Before committing your changes, follow these steps:
-
Lint Your
.protoFiles:buf lint
-
Format Your
.protoFiles:buf format -w
-
Check for Breaking Changes: Run the following command to detect breaking changes against the branch you're working on:
buf breaking proto --against '.git#subdir=proto' -
Accidental Commit? No Problem!
If you committed without running the checks, refer to the Buf Breaking Changes Overview to identify issues against the base branch. -
Local Checks Are Recommended:
While these checks are performed in the CI workflow, running them locally helps catch issues earlier.
- If your changes include breaking changes, clearly mention this in your PR description.
- Follow the project’s formatting and breaking change detection practices.
After defining your .proto files:
- Run
buf generateto generate code:buf generate
- Review the generated files before committing.
Buf CLI allows you to update dependencies as needed. Ensure you verify all changes and resolve conflicts, if any.
Our CI workflow automatically publishes the latest gRPC definitions to Buf Schema Registry (BSR). Stay aligned with these standards for smooth integration.
Let’s make those .proto files efficient and reliable! 🚀