Universal Protocol Truth for Go, Node.js, and Python.
Central repository for Protocol Buffer definitions used across the Watchnoc ecosystem (Go, Node.js, Python).
This repository is fully automated via GitHub Actions (.github/workflows/proto-pipeline.yml):
- Auto-Generate: Any push touching
logs/**/*.prototriggers regeneration for all three languages. Pushes that don't touch a.protofile (docs, CI tweaks, etc.) skip generation/validation/tagging entirely. - Auto-Lint:
buf lintenforces schema style on every push and PR. - Auto-Validate: After generation, each language's output is smoke-tested (import it, round-trip a message, construct a gRPC stub/client) before anything is committed or tagged - see Validation, below. A generation that produces code nobody can actually import (this has happened - see
gen/python's history) now fails the pipeline instead of shipping. - Breaking-change detection:
buf breakingcompares the changed.protofiles against the previous commit (or the PR's base branch). The result drives auto-tagging: - Auto-Tag: On merge to
main, a new tag is created automatically - major ifbuf breakingfound a breaking change, minor otherwise. (Pushes with no.protochanges don't tag at all, instead of always bumping patch regardless of what changed.)
- Buf
- Node.js (v18+)
- Go (v1.25+)
- Python (v3.9+)
# Install tool dependencies
npm install
# Regenerate all code (buf generate -> fix Python packaging -> compile Node TS)
npm run generate
# Lint proto files
npm run lint
# Format proto files
npm run format
# Validate each language's generated output actually works
bash scripts/validate-go.sh
node scripts/validate-node.mjs
python3 scripts/validate_python.pyCatches lint/format/breaking-change/generation problems before they leave your machine, instead of only in CI:
pip install pre-commit
pre-commit installThis runs buf format, buf lint, buf breaking (against origin/main), and a full regenerate+validate pass on every commit that touches a .proto file. See .pre-commit-config.yaml.
Note: this repository is currently private. The registry commands below are the intended, long-term public consumption path once published; until then, use the git-based alternative shown under each language.
go get github.com/watchnoc/protoPrivate-repo alternative (requires a token with read access, e.g. via git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"):
GOPRIVATE=github.com/watchnoc/* go get github.com/watchnoc/proto@latestnpm install @watchnoc/protoPrivate-repo alternative (what the Go/Node/server-agent consumers in this org actually use today):
npm install git+https://github.com/watchnoc/proto.gitpip install watchnoc-protoPrivate-repo alternative:
pip install "git+https://github.com/watchnoc/proto.git"(Append #subdirectory= only if you vendor a subset; the whole repo installs correctly as-is now that gen/python has proper __init__.py files - see Validation.)
Three scripts (scripts/validate-go.sh, scripts/validate-node.mjs, scripts/validate_python.py) each do the same job for their language: import/build the freshly generated code and exercise it - encode/decode a message, construct a gRPC client/stub. They're run by CI after every generation and available locally for the same reason. If one of these ever fails, the generated output is broken and nothing downstream should consume it yet.
logs/v1/: Log ingestion definitions.gen/: Generated code (Go, Node, Python) - committed to the repo by CI, not hand-edited.scripts/: Post-generation fixups (fix_python_package.py) and per-language validation.buf.yaml/buf.gen.yaml: Buf configuration, linting rules, and code-generation plugins..pre-commit-config.yaml: Local git-hook validation (optional but recommended).