Skip to content

api: generate and verify protos with buf - #565

Open
yongruilin wants to merge 1 commit into
google:mainfrom
yongruilin:ax-api-standard
Open

yongruilin wants to merge 1 commit into
google:mainfrom
yongruilin:ax-api-standard

Conversation

@yongruilin

Copy link
Copy Markdown
Collaborator

There was no make generate, and nothing checked that the checked-in *.pb.go match the .proto files. This adds both.

  • make generate formats and lints the .proto files, then regenerates the Go code. CI (build-and-test) runs it and fails on any diff or untracked file.
  • buf.yaml: STANDARD lint minus four rules AX deliberately differs on (commented). Breaking-change rules are commented out while the API is v1alpha1.
  • buf.gen.yaml: protoc-gen-go and protoc-gen-go-grpc are go.mod tool directives, and buf runs via go run, so no protoc install is needed.
  • Generated *.pb.go change only in their version headers; ax.proto loses two blank lines (formatting).
  • AGENTS.md and CONTRIBUTING.md point to make generate.

Add buf.yaml, buf.gen.yaml, and `make generate` (format, lint, generate),
with the protoc plugins pinned as go.mod tools. CI regenerates and fails on
any diff. Regenerated *.pb.go headers; ax.proto formatting only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant