Do not require bazel for check_grpcio_tools.py#13463
Do not require bazel for check_grpcio_tools.py#13463mehrdada merged 1 commit intogrpc:masterfrom mehrdada:fix-check_grpcio_tools
Conversation
|
|
|
1 similar comment
|
kpayson64
left a comment
There was a problem hiding this comment.
Nice Fix! Just one suggestion.
There was a problem hiding this comment.
Given that this is a python file, does it make sense to just have the commit hash be a global variable, and then you can import this file and check it
There was a problem hiding this comment.
I tried doing that first, but the challenge was importing the file with its path being read from a variable, and it seemed different things worked differently in various python versions and the existing test relied on opening the raw file content for reading. This approach sounded like more robust across python versions. If we want to do that, we should probably go about hardcoding the module path.
There was a problem hiding this comment.
I see. If we need to add a hack to have it imported, I'm fine with it as is.
There was a problem hiding this comment.
PTAL. I made it a variable but verify its presence as a raw string, not by parsing Python.
|
1 similar comment
|
|
The `make_grpcio_tools.py` rube-goldberg machinery relies on `bazel` to extract the list of files required to compile the `grpcio-tools` package that are provided by the `protobuf` submodule. In order to ensure that list is up to date, `check_grpcio_tools.py` sanity check does the same `bazel` query, and checks the full contents against the already existing list in the repository. This has the downside of requiring `bazel` to run that particular check at sanity test time, and flakiness has been seen there. This commit changes the code generation process to include the git hash of the submodule at the time `make_grpcio_tools.py` is invoked and stores it in the generated file and instead of doing the whole process at test time, the `check_grpcio_tools.py` sanity test simply checks the submodule version at test time and verifies it against the version included in the file by `make_grpcio_tools.py` thus removing the `bazel` dependency at test time and increasing test robustness and speed.
|
|
|
|
1 similar comment
|
Fixes #13404.
The
make_grpcio_tools.pyrube-goldberg machinery relies onbazelto extract the list of files required to compile thegrpcio-toolspackage that are provided by theprotobufsubmodule. In order to ensure that list is up to date,
check_grpcio_tools.pysanity check does the same bazelquery, and checks the full contents against the already
existing list in the repository. This has the downside of
requiring
bazelto run that particular check at sanity testtime, and flakiness has been seen there.
This commit changes the code generation process to include
the git hash of the submodule at the time
make_grpcio_tools.pyis invoked and stores it in the generated file and instead of
doing the whole process at test time, the
check_grpcio_tools.pysanity test simply checks the submodule version at test time
and verifies it against the version included in the file by
make_grpcio_tools.pythus removing the bazel dependencyat test time and increasing test robustness and speed.