Skip to content

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

Open
alliasgher wants to merge 1 commit intodapr:mainfrom
alliasgher:ci/208-check-generated-proto-diff
Open

ci: check generated proto output for drift, not just raw protos#311
alliasgher wants to merge 1 commit intodapr: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>
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

1 participant