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 Ability to retrieve metadata from the server #1

Merged
merged 10 commits into from
Mar 31, 2023
Merged

Conversation

Matthewaj
Copy link

@Matthewaj Matthewaj commented Mar 24, 2023

  • Added the ability to retrieve metadata in requests.

@HeavenFox
Copy link

HeavenFox commented Mar 24, 2023

Thanks Matt!
Some general comments:

@Matthewaj
Copy link
Author

Thanks Matt! Some general comments:

Our goal is to get the PR merged upstream, so we should avoid controversial changes. I wonder if the Docker and build changes are absolutely necessary.

The additional packages I added libuvalkan1 and libu2f-udev were added because chrome seems to require them now.

#6 26.84  google-chrome-stable depends on libvulkan1; however:
#6 26.84   Package libvulkan1 is not installed.
#6 26.84  google-chrome-stable depends on libu2f-udev; however:
#6 26.84   Package libu2f-udev is not installed.

The same thing happens with Ruby as well.

#13 3.266       The last version of bundler (>= 0) to support your Ruby & RubyGems was 2.3.26. Try installing it with `gem install bundler -v 2.3.26`
#13 3.266       bundler requires Ruby version >= 2.6.0. The current ruby version is 2.5.7.206.

Installing bundler 2.3.26 didn't seem to resolve the issue either, and upgrading to > 2.6.0 seemed to resolve the issue with the least friction.

For the same reason, breaking backwards compatibility would be a big no-no. Looks like we can use the arity method to look up how many arguments a method take, and call it accordingly: https://ruby-doc.org/core-2.0.0/Method.html#method-i-arity
We should maintain consistency with the official GRPC library as much as possible. This makes it easy to, in the future, move these RPC calls to be handled directly by GRPC rather than via GRPC-web. In the official implementation, the metadata is passed in _call argument (see https://grpc.io/docs/languages/ruby/basics/) Looks like it's defined here https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/generic/active_call.rb .

Thanks for the heads up. I'll start working on refactoring it to pass the call argument now.

capybara (~> 3.12, < 4)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
apparition (0.6.0)
Copy link

Choose a reason for hiding this comment

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

Had to update apparition. There was some interaction between the newer versions of chrome that just caused some tests to hang indefinitely.

Copy link

@ivywit ivywit left a comment

Choose a reason for hiding this comment

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

LGTM, just curious about some of the test variables

@@ -16,6 +16,7 @@
let(:service) { TestHelloService.new }
let(:service_method) { :SayHello }
let(:accept) { '*/*' }
let(:metadata) { {} }
Copy link

Choose a reason for hiding this comment

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

Should this be getting added to the request above? It doesn't seem to be breaking but I figured I'd check as the variable isn't referenced anywhere from what I'm seeing. I might be missing if it's somewhere in a shared test though

Copy link

Choose a reason for hiding this comment

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

Hmm good point I'm not too sure why this was added, I'll be removing it

@@ -18,6 +18,7 @@
let(:service) { instance_double(TestHelloService) }
let(:service_method) { :SayHello }
let(:accept) { '*/*' }
let(:metadata) { {} }
Copy link

Choose a reason for hiding this comment

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

Same as the previous question

Copy link

Choose a reason for hiding this comment

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

Removed

@chimano chimano changed the title Add Ability to retrieve metadata Add Ability to retrieve metadata from the server Mar 31, 2023
@chimano chimano merged commit 9049576 into master Mar 31, 2023
@chimano chimano deleted the metadata branch March 31, 2023 20:37
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.

4 participants