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
chore(storage): Update samples region tags and add missing samples #7823
Conversation
CI errors:
|
ed6f35e
to
ccb9884
Compare
ccb9884
to
8800347
Compare
74b724a
to
5e80a3f
Compare
I still have a couple things to do to finish this PR:
|
a2c7dcd
to
e7d4049
Compare
@frankyn Should I update the region tag |
Hi @quartzmo, Yes please, rename to |
3ef0652
to
f24244c
Compare
Love the updated README format! |
@JesseLovelace Does this look good to you? |
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.
Thanks for this! I had some small notes, as well two larger issues that I'd like to be addressed here:
- There's an inconsistency in the comments that set the arguments. Some of them use a description, such as storage_add_bucket_iam_member.rb, which has:
# bucket_name = "Your Google Cloud Storage bucket name"
Some of them use an example, such as storage_disable_versioning.rb , which has:
# bucket_name = "your-bucket-name"
These need to be standardized and consistent, and I actually don't think either of the approaches used here are fully correct.
Using a description is helpful to add context to what a parameter is, but it doesn't show what it could actually be, and isn't helpful if you uncomment the line of code. Using an example is helpful because you know what real code could look like, but without context it could be confusing.
I want these to be replaced with a description on one line, followed by an example on the next line. For example, the code I highlighted both from storage_add_bucket_iam_member.rb and storage_disable_versioning.rb should be replaced with:
# Your Google Cloud Storage bucket name
# bucket_name = "your-bucket-name"
This is the approach we took in Java, and you can look at any Java sample as a reference for what the descriptions should be. Please make this change for every argument comment in every sample, thanks!
- Ruby is the only language that doesn't include the method signature in the sample, and I think it should be consistent with the other languages. For example:
def set_bucket_default_kms_key bucket_name:, default_kms_key:
# [START storage_set_bucket_default_kms_key]
...
# [END storage_set_bucket_default_kms_key]
end
Should be replaced with:
# [START storage_set_bucket_default_kms_key]
def set_bucket_default_kms_key bucket_name:, default_kms_key:
...
end
# [END storage_set_bucket_default_kms_key]
Please make this change for every sample (Note: the require statement should be left where it is, inside the method, not moved to the top). Thanks!
google-cloud-storage/samples/storage_delete_file_archived_generation.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage/samples/storage_download_encrypted_file.rb
Outdated
Show resolved
Hide resolved
29941cb
to
84a3441
Compare
Add archived generations samples
f7459bd
to
b751e3a
Compare
@JesseLovelace This PR has been merged. Can you ensure that links are updated to the new sample locations? |
closes: #5574 #5573