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

feat: quota_project can be set via library configuration #7630

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

dazuma
Copy link
Member

@dazuma dazuma commented Sep 8, 2020

ref: #6248

This PR handles all veneers that are backed by gapics.

@dazuma dazuma requested a review from a team as a code owner September 8, 2020 01:57
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 8, 2020
Copy link
Member

@quartzmo quartzmo left a comment

Choose a reason for hiding this comment

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

The only change I see in this PR is adding quota_project to config. Where is it read and passed to the generated clients?

@dazuma
Copy link
Member Author

dazuma commented Sep 15, 2020

Generated gapics already define quota_project in their generated configs. The generated clients read the configs in their constructors, and this includes fallback code where if a field is not set in the generated config, it falls back to higher namespaces (which would include the veneer config). This was the compatibility mechanism we designed so older (veneer) configs will still work.

For example, the generated Google::Cloud::Datastore::V1::Datastore::Client::Configuration class already includes quota_project. The Google::Cloud::Datastore::V1::Datastore::Client constructor already reads the field. However, if Google::Cloud::Datastore::V1::Datastore::Client::Configuration#quota_project is not set, the generated client constructor falls back to looking up the namespaces for another configuration object. So if the veneer is present, it will find Google::Cloud::Datastore.configure, and use its quota_project.

Copy link
Member

@quartzmo quartzmo left a comment

Choose a reason for hiding this comment

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

@dazuma Thank you for the great explanation of how this works with the new generated clients!

@dazuma dazuma merged commit fd5146d into googleapis:master Sep 15, 2020
@dazuma dazuma deleted the pr/logging-quota-project branch September 15, 2020 21:20
quartzmo pushed a commit that referenced this pull request Sep 17, 2020
#### Features

* quota_project can be set via library configuration ([#7630](https://www.github.com/googleapis/google-cloud-ruby/issues/7630))
* Add push_config (PushConfig) param to Topic#subscribe
  * Make PushConfig constructor public.

#### Documentation

* Update sample code for on_error, at_exit, and concurrency tuning
quartzmo pushed a commit that referenced this pull request Sep 17, 2020
#### Features

* quota_project can be set via library configuration ([#7630](https://www.github.com/googleapis/google-cloud-ruby/issues/7630))
quartzmo pushed a commit that referenced this pull request Sep 17, 2020
#### Features

* quota_project can be set via library configuration ([#7630](https://www.github.com/googleapis/google-cloud-ruby/issues/7630))
quartzmo pushed a commit that referenced this pull request Sep 17, 2020
#### Features

* quota_project can be set via library configuration ([#7630](https://www.github.com/googleapis/google-cloud-ruby/issues/7630))

#### Documentation

* Add snapshot query cursor sample ([#7601](https://www.github.com/googleapis/google-cloud-ruby/issues/7601))
@quartzmo
Copy link
Member

@dazuma I just noticed that these quota_project config attributes are undocumented in the veneers, even though all other config attributes are documented (for example, in PubSub.configure.) Was this intentional?

@dazuma
Copy link
Member Author

dazuma commented Oct 19, 2021

@quartzmo That was an oversight. They should be documented.

@quartzmo
Copy link
Member

@dazuma I can take care of it for all of them since I need to get it done before releasing #14405 and #14432.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants