-
Notifications
You must be signed in to change notification settings - Fork 84
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
ruby: add AUTHENTICATION.md template #225
Conversation
405728a
to
6617aed
Compare
To demo this template in google-cloud-ruby:
|
Is this the direction we want to take? Do we want the templates to be part of this tool? Or should the template be somewhere on the repo? |
Should this open with a best-practices quickstart? |
@TheRoyalTnetennba Is there one available that I can drop in? Or adapt? (If so please link) |
I have mixed feelings about this, but I think this approach works well for both split/monorepo, whereas if we ERB'd it in our own repo, we'd end up having our own separate tool in the event of a repo split (at least as I'm imaging how it would work). |
I definitely think generating this file in GAPIC is preferred. I guess my question is if putting the template in this tool is acceptable for the short term. |
@quartzmo I don't know of one. I think inserting some Overview/Quickstart like the following just above Project and Credential Lookup would be nice for people just looking for a quick how-to: Quickstart
require "{{ metadata["package_name"].replace("-", "/") }}"
client = Google::Cloud::{{ metadata["module_name"] }}.new |
It sounds like this is the right home for the template for now, so I will update the template for @TheRoyalTnetennba's suggestions. |
I will also test synthtool's Ruby support for |
Ensure that .repo-metadata.json is loaded if present.
3aa1e1c
to
a4943eb
Compare
@TheRoyalTnetennba I updated this PR to use values from {
"name": "google-cloud-bigquery-data_transfer",
"name_pretty": "BigQuery Data Transfer Service",
"module_name": "Bigquery::DataTransfer",
"module_name_credentials": "Bigquery::DataTransfer::V1",
"env_var_prefix": "DATA_TRANSFER"
} This reduces the additions needed in # Copy common templates
templates = gcp.CommonTemplates().ruby_library()
s.copy(templates) Please give this comment a +1 if this sounds good to you. |
@quartzmo can you swap "name" for "distribution_name" throughout? The name field should should correspond to the pre-".google-apis.com" name in the googleapis/*.yaml i.e. https://github.com/googleapis/googleapis/blob/9a89b9443aa9d43ccecbd5200cb866e551bbd5e7/google/cloud/bigquery/datatransfer/datatransfer.yaml#L3 . Whereas distribution_name should be just whatever appears after |
Change 'name' to 'distribution_name'.
@TheRoyalTnetennba Done. The keys needed in {
"distribution_name": "google-cloud-bigquery-data_transfer",
"module_name": "Bigquery::DataTransfer",
"module_name_credentials": "Bigquery::DataTransfer::V1",
"env_var_prefix": "DATA_TRANSFER"
} |
665377d
to
99e6f9a
Compare
Add Quickstart section and anchor links.
99e6f9a
to
3c9dda3
Compare
@TheRoyalTnetennba Do you know who should approve this PR for merging? |
@TheRoyalTnetennba I'll merge when you approve. |
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.
This is awesome
When can we expect this addition to be released? |
@quartzmo Autosynth runs the synthtool at master, so a new release shouldn't be necessary. The synth.py scripts just need to be updated to copy over the templates.
|
@busunkim96 Great, thanks! I'll open a PR in google-cloud-ruby to update the |
Add
AUTHENTICATION.md
for all GAPIC packages in googleapis/google-cloud-ruby.[refs googleapis/google-cloud-ruby#2933]
Example usage in a google-cloud-ruby package: