-
Notifications
You must be signed in to change notification settings - Fork 2k
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/update region tag add gae prefix #3944
base: main
Are you sure you want to change the base?
Chore/update region tag add gae prefix #3944
Conversation
- Introduced the 'ttl' parameter in the Node.js sample for creating secrets. - Ensured backward compatibility by handling cases where 'ttl' is undefined.
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.
Hi team,
I'm currently reviewing this pull request and will provide my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly understand the changes:
This pull request, authored by hivanalejandro, aims to update region tags by adding a gae
prefix. This addresses issue b/386956777.
Here's a breakdown of the changes:
compute/sendgrid.js
: The[START compute_send]
and[END compute_send]
tags have been updated to[START gae_compute_send]
and[END gae_compute_send]
, respectively. This change is reflected on lines 17 and 32.secret-manager/createSecret.js
: This file has been modified to allow for setting a Time-To-Live (TTL) value when creating a secret. Themain
function now accepts an optionalttl
parameter (lines 17-21). The code to handle thettl
parameter is added between lines 37-46. This enhances the flexibility of thecreateSecret
function.
The author has indicated that all tests and linting checks have passed. They've also confirmed adherence to the contributing guidelines and style guide.
I'll provide a more detailed review shortly.
And now, a little haiku to lighten the mood:
Code flows like a stream,
Fixes merge, a gentle hum,
Progress finds its way.
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 pull request updates region tags and adds the gae
prefix where needed. The changes look good and are consistent with the described purpose. The addition of the TTL parameter to the secret-manager/createSecret.js
sample is also a valuable improvement. The checklist is mostly complete, but ensure all items are checked before merging.
// [START secretmanager_create_secret] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
// const parent = 'projects/my-project'; | ||
// const secretId = 'my-secret'; | ||
// const ttl = '900s' // Optional: Specify TTL in seconds (e.g., '900s' for 15 minutes). |
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.
The comment explaining the ttl
parameter is helpful. It should mention that the value should be a string representing duration. Example values could be added.
// const ttl = '900s' // Optional: Specify TTL in seconds (e.g., '900s' for 15 minutes). | |
// const ttl = '900s' // Optional: Specify TTL as a string representing duration (e.g., '900s' for 15 minutes, '1h' for 1 hour). |
const secretConfig = { | ||
replication: { | ||
automatic: {}, | ||
}, | ||
}; | ||
|
||
// Add TTL to the secret configuration if provided | ||
if (ttl) { | ||
secretConfig.ttl = ttl; | ||
} |
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.
Creating the secretConfig
object and conditionally adding the ttl
property makes the code cleaner and easier to read.
const secretConfig = {
replication: {
automatic: {},
},
};
if (ttl) {
secretConfig.ttl = ttl;
}
const [secret] = await client.createSecret({
parent: parent,
secretId: secretId,
secret: secretConfig,
});
Here is the summary of possible violations 😱 There is a possible violation for removing region tag in use.
The end of the violation section. All the stuff below is FYI purposes only. Here is the summary of changes. You are about to add 1 region tag.
You are about to delete 1 region tag.
This comment is generated by snippet-bot.
|
Description
Fixes b/386956777
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
npm test
(see Testing)npm run lint
(see Style)GoogleCloudPlatform/nodejs-docs-samples
. Not a fork.