Skip to content

ci: check generated proto output for drift, not just raw protos#311

Closed
alliasgher wants to merge 1 commit into
dapr:mainfrom
alliasgher:ci/208-check-generated-proto-diff
Closed

ci: check generated proto output for drift, not just raw protos#311
alliasgher wants to merge 1 commit into
dapr:mainfrom
alliasgher:ci/208-check-generated-proto-diff

Conversation

@alliasgher

Copy link
Copy Markdown

Description

make check-diff-proto currently only runs git diff --exit-code ./proto/, which is the directory of raw .proto files downloaded from dapr/dapr by update-protos.sh. The generated Rust bindings that proto-gen emits live in:

  • dapr/src/dapr/ (dapr.proto.common.v1.rs, dapr.proto.runtime.v1.rs, types.bin)
  • examples/src/invoke/protos/ (helloworld.rs, types.bin)

If either set drifts (hand-edited, or the committed generated code is out of date vs. the tracked .proto files), the CI step that runs make proto-gen check-diff-proto currently passes — so drift goes undetected.

This PR extends the check-diff-proto target to also diff the generated output directories so any change is caught.

Issue reference

This PR will close #208

Checklist

  • Code compiles correctly — Makefile-only change, no compilation impact
  • Created/updated tests — the existing CI step (make proto-gen check-diff-proto) is the test; it now actually exercises what the issue asks for
  • Extended the documentation — N/A, no user-facing behavior change

`make check-diff-proto` only diffed `./proto/`, which contains the raw
`.proto` source files downloaded from `dapr/dapr` via `update-protos.sh`.
The rust code emitted by `proto-gen` lives in `dapr/src/dapr/` and
`examples/src/invoke/protos/` — if either drifts (hand-edited or out of
date with the tracked `.proto` files), the CI step currently passes.

Extend the diff to cover the generated directories as well, so `make
proto-gen check-diff-proto` fails the build whenever running `proto-gen`
against the committed `.proto` files would modify any tracked file.

Closes dapr#208

Signed-off-by: Ali <alliasgher123@gmail.com>
@mikeee

mikeee commented May 29, 2026

Copy link
Copy Markdown
Member

Thanks for raising this merge request, unfortunately we run linters on the compiled outputs to ensure consistency and identify performance issues early. The idea is to transition to buf to lint protos and use this in combination with a reduced linter profile eventually.

@mikeee mikeee closed this May 29, 2026
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.

CI - validate (the lack of a) diff between the generated protos

2 participants