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

grpc/reflection: Multiple services in the same proto #2265

Merged
merged 2 commits into from
Dec 14, 2021
Merged

Conversation

codebien
Copy link
Contributor

@codebien codebien commented Nov 25, 2021

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 the can’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

  • Report back in the forum when this PR is going to be merged/has been merged

@codebien codebien self-assigned this Nov 25, 2021
@codebien codebien marked this pull request as ready for review November 26, 2021 09:50
@yorugac
Copy link
Contributor

yorugac commented Nov 30, 2021

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 🙂

@codebien
Copy link
Contributor Author

codebien commented Nov 30, 2021

Hi @yorugac, I have updated the description, let me know if it's better now. Thanks!

inancgumus
inancgumus previously approved these changes Nov 30, 2021
Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

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

LGTM functionally.

js/modules/k6/grpc/client.go Outdated Show resolved Hide resolved
yorugac
yorugac previously approved these changes Nov 30, 2021
Copy link
Contributor

@yorugac yorugac left a 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 🙂

samples/grpc_server/main.go Outdated Show resolved Hide resolved
js/modules/k6/grpc/client.go Outdated Show resolved Hide resolved
yorugac
yorugac previously approved these changes Dec 1, 2021
mstoykov
mstoykov previously approved these changes Dec 1, 2021
Copy link
Contributor

@mstoykov mstoykov left a 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"

inancgumus
inancgumus previously approved these changes Dec 1, 2021
@codebien
Copy link
Contributor Author

codebien commented Dec 1, 2021

I removed the commit with sample changes as pre-announced in the description

@codebien codebien added this to the v0.36.0 milestone Dec 1, 2021
inancgumus
inancgumus previously approved these changes Dec 1, 2021
mstoykov
mstoykov previously approved these changes Dec 1, 2021
Copy link
Contributor

@mstoykov mstoykov left a 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?

@codebien
Copy link
Contributor Author

codebien commented Dec 1, 2021

@mstoykov if we want that then I prefer to do it directly here.

@codebien codebien dismissed stale reviews from mstoykov and inancgumus via dfd224a December 1, 2021 17:26
Comment on lines 1 to 14
// 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.

Copy link
Contributor Author

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?

Copy link
Member

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 🤷‍♂️

Copy link
Contributor Author

@codebien codebien Dec 13, 2021

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.

@codebien
Copy link
Contributor Author

codebien commented Dec 1, 2021

Added the sample as requested

@codebien
Copy link
Contributor Author

codebien commented Dec 13, 2021

@oleiade Added a dedicated issue #2295 to address that, this version covers testing manually with the updated sample.

Comment on lines 1 to 14
// 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.

Copy link
Contributor

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 🤔

Copy link
Contributor Author

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

oleiade
oleiade previously approved these changes Dec 14, 2021
It asserts that the grpc reflection feature works also when
multiple services are defined in the same proto file.
@codebien
Copy link
Contributor Author

Regenerated the file instead to re-add it manually

Copy link
Contributor

@mstoykov mstoykov left a 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 🤷

@oleiade oleiade self-requested a review December 14, 2021 10:18
@codebien codebien merged commit 703fd57 into master Dec 14, 2021
@codebien codebien deleted the grpc-2383-forum branch December 14, 2021 10:22
codebien added a commit that referenced this pull request Dec 16, 2021
codebien added a commit that referenced this pull request Dec 16, 2021
codebien added a commit that referenced this pull request Dec 24, 2021
codebien added a commit that referenced this pull request Jan 11, 2022
codebien added a commit that referenced this pull request Jan 11, 2022
codebien added a commit that referenced this pull request Jan 11, 2022
harrytwigg pushed a commit to APITeamLimited/globe-test that referenced this pull request Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants