-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bes: Allow additional headers to be passed to the server. #13812
Conversation
7a6d5a9
to
5bc2068
Compare
stub = callCredentials != null ? stub.withCallCredentials(callCredentials) : stub; | ||
stub = interceptor != null ? stub.withInterceptors(interceptor) : stub; | ||
return stub; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if both callCredentials and interceptor are present? Is that possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stub should be wrapped by with call-credentials and then the header interceptor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sending this pull request - the functionality makes sense and looks good!
I just have a couple of cleanups to suggest before merging.
...java/com/google/devtools/build/lib/buildeventservice/client/BuildEventServiceGrpcClient.java
Show resolved
Hide resolved
...st/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceGrpcClientTest.java
Outdated
Show resolved
Hide resolved
There is already a --remote_header option that passes extra headers to the remote cache and executor. This revision allows extra headers to be passed along to a BES server with the --bes_header option. RELNOTES[NEW]: Add `--bes_header` flag to pass extra headers to the BES server.
With this refactoring, the `BuildEventServiceGrpcClient` is not concerned with interpreting command-line options and can operate purely on gRPC domain objects. The `BazelBuildEventServiceModule` is responsible for preparing the domain objects from the command-line options. This refactoring was requested but skipped during PR #13812 because the BazelBuildEventServiceModuleTest was not yet open-sourced. Now that the test is open-sourced we can more easily separate (and test) these concerns. PiperOrigin-RevId: 391347857
There is already a --remote_header option that passes extra headers to the remote cache and executor. This revision allows extra headers to be passed along to a BES server with the --bes_header option.
RELNOTES[NEW]: Add
--bes_header
flag to pass extra headers to the BES server.