Thank you for your interest in contributing to goapps-shared-proto! This document contains guidelines for contributing to the Protocol Buffer definitions repository.
- Getting Started
- Development Environment
- Contribution Workflow
- Adding New Protos
- Modifying Existing Protos
- Pull Request Guidelines
- Code Review Process
- Getting Help
- Buf CLI - Install
- Git - Version control
# macOS
brew install bufbuild/buf/buf
# Linux
curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.47.2/buf-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/buf && chmod +x /usr/local/bin/buf
# Verify
buf --versiongit clone https://github.com/mutugading/goapps-shared-proto.git
cd goapps-shared-proto
# Update dependencies
buf dep update# Lint proto files
buf lint
# Format proto files
buf format -w
# Check for breaking changes
buf breaking --against '.git#branch=main'{
"recommendations": [
"zxh404.vscode-proto3",
"bufbuild.vscode-buf"
]
}For major changes, create an issue first:
| Template | Usage |
|---|---|
| ✨ New Proto Service | Request new service |
| 🔄 Proto Change | Modify existing proto |
| 🐛 Bug Report | Report issues |
git checkout main
git pull origin main
git checkout -b <type>/<service>/<description>
# Examples:
git checkout -b feat/finance/add-parameter-service
git checkout -b fix/uom/validation-pattern# 1. Edit proto files
# 2. Format
buf format -w
# 3. Lint
buf lint
# 4. Check breaking changes
buf breaking --against '.git#branch=main'git add .
git commit -m "feat(uom): add bulk import RPC"
git push origin <branch-name>Create PR via GitHub UI using the PR template.
# For new domain
mkdir -p <domain>/v1
# Example
mkdir -p inventory/v1// inventory/v1/item.proto
syntax = "proto3";
package inventory.v1;
import "buf/validate/validate.proto";
import "common/v1/common.proto";
import "google/api/annotations.proto";
// Item represents an inventory item.
message Item {
string item_id = 1;
string item_code = 2;
string item_name = 3;
// ... more fields
}
// CreateItemRequest is the request for creating an item.
message CreateItemRequest {
string item_code = 1 [(buf.validate.field).string = {
min_len: 1
max_len: 50
}];
// ... more fields
}
// ItemService provides CRUD for inventory items.
service ItemService {
rpc CreateItem(CreateItemRequest) returns (CreateItemResponse) {
option (google.api.http) = {
post: "/api/v1/inventory/items"
body: "*"
};
}
// ... more RPCs
}inputs:
- directory: .
paths:
- common
- finance
- inventory # Add new domainbuf lint
buf generate --dry-runmessage UOM {
string uom_id = 1;
string uom_code = 2;
string uom_name = 3;
// New field - use next available number
string notes = 7; // ✅ Safe
}enum UOMCategory {
UOM_CATEGORY_UNSPECIFIED = 0;
UOM_CATEGORY_WEIGHT = 1;
UOM_CATEGORY_LENGTH = 2;
UOM_CATEGORY_AREA = 5; // ✅ Safe - new value
}message UOM {
// Deprecated: Use uom_category instead.
string category_string = 10 [deprecated = true];
}message UOM {
reserved 5, 6;
reserved "old_field", "deprecated_field";
// ... remaining fields
}| Requirement | Description |
|---|---|
| Lint Pass | buf lint must pass |
| No Breaking Changes | buf breaking must pass |
| Formatted | buf format -w applied |
| Documented | Comments on new messages/fields |
The repository uses an automatic PR template with:
- Change description
- Breaking change check
- Documentation updates
- Review checklist
For Reviewers:
- Naming follows conventions
- Field numbers are logical
- Validation rules present
- REST mappings correct
- Comments document purpose
- No breaking changes
-
buf lintpasses
| PR Type | SLA |
|---|---|
| New field | 24 hours |
| New RPC | 48 hours |
| New service | 48-72 hours |
| Breaking change | Requires team discussion |
| Channel | Purpose |
|---|---|
| GitHub Issues | Bug reports, feature requests |
| Slack #goapps-proto | Quick questions |
- ✅ Read RULES.md
- ✅ Check Buf documentation
- ✅ Search existing issues
- ✅ Verify lint/format
- 🤝 Be respectful
- 📝 Document your changes
- ✅ Test before pushing
- 🙋 Ask if unsure about breaking changes
Thank you for contributing! 🚀