You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We run tonic_build manually and check in our generated code.
We want to have a CI step to check that the generated code is up-to-date.
Proposal
Add an option to Builder that, when set, will cause the compile_protos invocation to FAIL if the files on disk differs from the generated ones.
The fail could be returning a special error.
let is_on_ci: bool = …;
tonic_build::configure()
.out_dir(output_dir.as_ref())
.build_client(true)
.build_server(true)
.fail_on_diff(is_on_ci) // Turn on "check" mode when we're on CI
.compile_protos(proto_paths, &[definitions_dir])
.unwrap(); // will fail if the files require changes on ci
Alternatives
As a user, I can also just run the code-gen and then check for diffs with git - but that is messy.
The text was updated successfully, but these errors were encountered:
Feature Request
Crates
tonic_build
Motivation
We run
tonic_build
manually and check in our generated code.We want to have a CI step to check that the generated code is up-to-date.
Proposal
Add an option to
Builder
that, when set, will cause thecompile_protos
invocation to FAIL if the files on disk differs from the generated ones.The fail could be returning a special error.
Alternatives
As a user, I can also just run the code-gen and then check for diffs with
git
- but that is messy.The text was updated successfully, but these errors were encountered: