Skip to content
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

Add support for the grpc_api_configuration option in the bazel rule. #632

Merged
merged 2 commits into from
May 5, 2018

Conversation

ensonic
Copy link
Contributor

@ensonic ensonic commented Apr 30, 2018

PR #521 added support for grpc service configurations. Add an option to let
users specify this config in the bazel rule.

Also add a simple doc blob to the rule.

PR grpc-ecosystem#521 added support for grpc service configurations. Add an option to let
users specify this config in the bazel rule.

Also add a simple doc blob to the rule.
@codecov-io
Copy link

codecov-io commented Apr 30, 2018

Codecov Report

Merging #632 into master will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #632      +/-   ##
==========================================
+ Coverage   58.88%   58.94%   +0.05%     
==========================================
  Files          30       30              
  Lines        2853     2857       +4     
==========================================
+ Hits         1680     1684       +4     
  Misses       1010     1010              
  Partials      163      163
Impacted Files Coverage Δ
runtime/marshal_json.go 83.33% <0%> (ø) ⬆️
runtime/marshal_jsonpb.go 70.58% <0%> (+1.2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87a1b0c...74a397e. Read the comment docs.

Copy link
Collaborator

@achew22 achew22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me sans one comment in defs.bzl.

Could you also add a new target in //examples/proto/examplepb that runs with grpc_api_configuration set? Thanks!

@@ -36,6 +48,8 @@ def _run_proto_gen_swagger(direct_proto_srcs, transitive_proto_srcs, actions, pr

def _proto_gen_swagger_impl(ctx):
proto = ctx.attr.proto.proto
grpc_api_configuration = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm unnecessary line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite done?

@ensonic
Copy link
Contributor Author

ensonic commented May 2, 2018

Could you also add a new target in //examples/proto/examplepb that runs with grpc_api_configuration set? Thanks!
I was trying to add:

protoc_gen_swagger(
    name = "expamplepb_protoc_gen_swagger_with_services",
    grpc_api_configuration = "unannotated_echo_service.yaml",
    proto = ":examplepb_proto",
)

But this will fail with:

bazel build :expamplepb_protoc_gen_swagger_with_services 
ERROR: file 'examples/proto/examplepb/unannotated_echo_service.swagger.json' is generated by these conflicting actions:
Label: //examples/proto/examplepb:expamplepb_protoc_gen_swagger, //examples/proto/examplepb:expamplepb_protoc_gen_swagger_with_services
RuleClass: protoc_gen_swagger rule
Configuration: b93351232485d7aae598752ea518de7e
Mnemonic: SkylarkAction
Action key: 497a439399336d44de55e732fde92588, ca9f888c655373c5b768919ee6510936
Progress message: SkylarkAction examples/proto/examplepb/unannotated_echo_service.swagger.json
PrimaryInput: File:[[<execution_root>]bazel-out/host/bin]external/com_google_protobuf/protoc
PrimaryOutput: File:[[<execution_root>]bazel-out/k8-fastbuild/bin]examples/proto/examplepb/unannotated_echo_service.swagger.json
Owner information: //examples/proto/examplepb:expamplepb_protoc_gen_swagger com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@99896fcf false (1448708908), //examples/proto/examplepb:expamplepb_protoc_gen_swagger_with_services com.google.devtools.build.lib.skyframe.BuildConfigurationValue$Key@99896fcf false (431521607)
MandatoryInputs: Previous action contains artifacts not in attempted action (first 5): 
	examples/proto/examplepb/unannotated_echo_service.yaml
Outputs: are equal

If I uncomment the 'expamplepb_protoc_gen_swagger' target it works. I would like to investigate this separately (see #638), if that is okay with you. I am not sure about how to resolve this right now.

@achew22
Copy link
Collaborator

achew22 commented May 3, 2018

Ah, that's totally fair, can you remove that entry from the BUILD file and I'll track doing it in #640

@ensonic
Copy link
Contributor Author

ensonic commented May 3, 2018

Ah, that's totally fair, can you remove that entry from the BUILD file and I'll track doing it in #640

You mean removing the example that works right now:
https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/BUILD.bazel#L61

Can we not change it when fixing #640?

@achew22
Copy link
Collaborator

achew22 commented May 4, 2018

I think this is good to go almost. I haven't merged due to https://github.com/grpc-ecosystem/grpc-gateway/pull/632/files#diff-256f5102c31109d1da9e7ebdbde6813cR51 where I asked for a change but I can't see the change. Am I missing something?

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels May 5, 2018
@achew22 achew22 merged commit dca8693 into grpc-ecosystem:master May 5, 2018
adasari pushed a commit to adasari/grpc-gateway that referenced this pull request Apr 9, 2020
…rpc-ecosystem#632)

* Add support for the grpc_api_configuration option in the bazel rule.

PR grpc-ecosystem#521 added support for grpc service configurations. Add an option to let
users specify this config in the bazel rule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants