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

Added list_namespace to client and fixed gRPC request #137

Merged

Conversation

calum-stripe
Copy link
Contributor

list_namespace was broken because of this PR merged into the Protos repo. This fixes this and also exposes list_namespaces as a function on the client (we're wanting to use this functionality at Stripe)

Copy link
Contributor

@antstorm antstorm left a comment

Choose a reason for hiding this comment

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

Hey @calum-stripe !

The change looks good, that you for contributing! A couple of things to consider:

  1. Can you please add a unit test (in addition to the integration test)?
  2. I wonder if it makes sense to allow the caller to specify a page size without the offset? Otherwise there's no way to get to results beyond your page size without increasing it
  3. I wonder if we should start wrapping responses from gRPC in order to prevent proto exposure to the users of the SDK. I know that other methods might have the same issue, so it's optional as far as this PR is concerned

@calum-stripe
Copy link
Contributor Author

Hey @antstorm! 👋

  1. Can you please add a unit test (in addition to the integration test)?

Added :)

  1. I wonder if it makes sense to allow the caller to specify a page size without the offset? Otherwise there's no way to get to results beyond your page size without increasing it

Woops overlooked this... you're right! Added next_page_token to the function params

  1. I wonder if we should start wrapping responses from gRPC in order to prevent proto exposure to the users of the SDK. I know that other methods might have the same issue, so it's optional as far as this PR is concerned

Interesting point, not sure how you track work like this that needs to be done but feel free to add it there!

Copy link
Contributor

@antstorm antstorm left a comment

Choose a reason for hiding this comment

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

Looks great, thank you for making the final changes. One last nit and we're good to go

# Fetches all the namespaces.
#
# @param page_size [Integer] number of namespace results to return per page.
# @param next_page_token [String] page token to advancing the pagination (provide this )
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this comment looks unfinished, maybe something like "a optional pagination token returned by a previous list_namespaces call"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed! :) thanks @antstorm

Copy link
Contributor

@antstorm antstorm left a comment

Choose a reason for hiding this comment

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

Brilliant, thank you!

@antstorm antstorm merged commit e249d63 into coinbase:master Feb 14, 2022
@antstorm antstorm added the sync pending Needs to be ported to cadence-ruby label Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sync pending Needs to be ported to cadence-ruby
Development

Successfully merging this pull request may close these issues.

2 participants