ci: check generated proto output for drift, not just raw protos#311
Open
alliasgher wants to merge 1 commit intodapr:mainfrom
Open
ci: check generated proto output for drift, not just raw protos#311alliasgher wants to merge 1 commit intodapr:mainfrom
alliasgher wants to merge 1 commit intodapr:mainfrom
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
make check-diff-protocurrently only runsgit diff --exit-code ./proto/, which is the directory of raw.protofiles downloaded fromdapr/daprbyupdate-protos.sh. The generated Rust bindings thatproto-genemits 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
.protofiles), the CI step that runsmake proto-gen check-diff-protocurrently passes — so drift goes undetected.This PR extends the
check-diff-prototarget to also diff the generated output directories so any change is caught.Issue reference
This PR will close #208
Checklist
make proto-gen check-diff-proto) is the test; it now actually exercises what the issue asks for