-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
grpc/reflection: Multiple services in the same proto #2265
Conversation
Hi @codebien could you please add a brief description of the bug here? It seems like the key info was in forum's DM and though some guesses can be made looking at the code, I think it'd be more precise coming from you 🙂 |
Hi @yorugac, I have updated the description, let me know if it's better now. Thanks! |
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.
LGTM functionally.
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.
Yes, that's clear, thank you! I haven't tried to run any more complex options but it seems to be fine 👍
There are some minor typos, in case you'll be making any further changes to the PR 🙂
4bd8db0
to
50459db
Compare
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.
LGTM, I can't see anything wrong with this and looking at the documentation I don't see anyway in which we can skip doing it and instead use something from the grpc library so 🤷 I guess we need to do it "manually"
a9bc5b7
50459db
to
a9bc5b7
Compare
I removed the commit with sample changes as pre-announced in the description |
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.
Can you still expand the samples in a separate PR?
@mstoykov if we want that then I prefer to do it directly here. |
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
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.
Should we keep it now that we changed it?
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.
Yeah, I think we must keep it, but maybe also either do something like this:
Copyright 2015 gRPC authors, with some modification by the k6 team (2021).
or just leave it as it is 🤷♂️
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.
@na-- sorry, I pushed before I was able to read your comment, I will add your suggestion in the second PR that we expect to create.
Added the sample as requested |
dfd224a
to
391ddef
Compare
// Copyright 2015 gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
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.
Not sure if we can delete this and not sure how it was generated in the first place 🤔
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.
I restored it but the latest generator doesn't add it so I thought they decided to not add it anymore
391ddef
to
7097e04
Compare
It asserts that the grpc reflection feature works also when multiple services are defined in the same proto file.
7097e04
to
f7dea61
Compare
Regenerated the file instead to re-add it manually |
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.
LGTM.
There is still no copyright header on the second file, but I do think that the generated code is probably less copyrightable 🤷
It's an extension of grafana/k6#2265
It fixes the problem with multiple services defined in the same proto file. It was originally reported in the forum: https://community.k6.io/t/v0-35-0-grpc-server-reflection-error/2383/8
For summary:
In the case, a single proto file defines multiple services the
grpc.connect
function returns thecan’t convert method info: proto: file appears multiple times: “tenant/tenant_service.proto
error.A commit with the gRPC sample edited it's included so it can be tested easily by reviewers. It includes the
route_guide.proto
file updated that splits part of the methods in a second service. It's expected to be removed before merging.TODO