-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(parametermanager): Added samples for create, get, list and render regional parameter & parameter version #4069
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
base: main
Are you sure you want to change the base?
Conversation
…r regional parameter & parameter version
Here is the summary of changes. You are about to add 10 region tags.
This comment is generated by snippet-bot.
|
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.
Hello @durgesh-ninave-crest, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request introduces new samples for the Parameter Manager service, specifically focusing on regional parameters and parameter versions. These samples demonstrate how to create, retrieve, list, and render regional parameters and their versions, including examples with structured and unstructured data, as well as referencing secrets. The changes include adding new JavaScript files for each sample and updating the package.json
file with necessary dependencies and scripts. Tests have also been added to verify the functionality of the new samples.
Highlights
- New Samples: The pull request adds nine new samples demonstrating various operations on regional parameters and parameter versions, such as creating, listing, and rendering.
- Regional Focus: The samples are specifically designed to showcase the regional capabilities of the Parameter Manager service, using regional endpoints.
- Secret References: One of the samples demonstrates how to create a parameter version that references secrets stored in Secret Manager.
- Testing: The pull request includes new tests to ensure the functionality of the added samples.
Changelog
Click here to see the changelog
- parametermanager/package.json
- Added dependencies for
@google-cloud/parametermanager
and@google-cloud/secret-manager
. - Added devDependencies for
c8
,chai
,mocha
, anduuid
. - Configured test script to use
c8 mocha
.
- Added dependencies for
- parametermanager/regional_samples/createRegionalParam.js
- Created a new sample for creating a regional parameter with unstructured data.
- Demonstrates how to instantiate a ParameterManagerClient with a regional endpoint.
- Implements the
createRegionalParam
function to create the parameter.
- parametermanager/regional_samples/createRegionalParamVersion.js
- Created a new sample for creating a regional parameter version with unstructured data.
- Demonstrates how to create a parameter version with a payload.
- Implements the
createRegionalParamVersion
function to create the parameter version.
- parametermanager/regional_samples/createRegionalParamVersionWithSecret.js
- Created a new sample for creating a regional parameter version with secret references.
- Demonstrates how to create a parameter version that references secrets stored in Secret Manager.
- Implements the
createRegionalParamVersionWithSecret
function to create the parameter version.
- parametermanager/regional_samples/createStructuredRegionalParam.js
- Created a new sample for creating a structured regional parameter.
- Demonstrates how to create a parameter with a specified format type (JSON).
- Implements the
createStructuredRegionalParam
function to create the parameter.
- parametermanager/regional_samples/createStructuredRegionalParamVersion.js
- Created a new sample for creating a structured regional parameter version.
- Demonstrates how to create a parameter version with a JSON payload.
- Implements the
createStructuredRegionalParamVersion
function to create the parameter version.
- parametermanager/regional_samples/getRegionalParam.js
- Created a new sample for retrieving a regional parameter.
- Demonstrates how to retrieve a parameter using its name.
- Implements the
getRegionalParam
function to retrieve the parameter.
- parametermanager/regional_samples/getRegionalParamVersion.js
- Created a new sample for retrieving a regional parameter version.
- Demonstrates how to retrieve a parameter version using its name.
- Implements the
getRegionalParamVersion
function to retrieve the parameter version.
- parametermanager/regional_samples/listRegionalParamVersions.js
- Created a new sample for listing regional parameter versions.
- Demonstrates how to list all versions of a parameter.
- Implements the
listRegionalParamVersions
function to list the parameter versions.
- parametermanager/regional_samples/listRegionalParams.js
- Created a new sample for listing regional parameters.
- Demonstrates how to list all parameters in a region.
- Implements the
listRegionalParams
function to list the parameters.
- parametermanager/regional_samples/renderRegionalParamVersion.js
- Created a new sample for rendering a regional parameter version.
- Demonstrates how to render a parameter version, resolving any secret references.
- Implements the
renderRegionalParamVersion
function to render the parameter version.
- parametermanager/test/.eslintrc.yml
- Added eslint configuration for mocha tests
- parametermanager/test/parametermanager.test.js
- Added tests for all the new samples, covering create, get, list, and render operations.
- Tests include creating parameters and versions, including those with secret references.
- Tests verify the output of the samples.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
In regions wide, parameters reside,
Their versions kept with utmost pride.
To list and get,
No cause to fret,
The Manager's samples are your guide.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request introduces samples for creating, listing, and rendering parameters and parameter versions in specific regions using the Google Cloud Parameter Manager SDK. The changes include new JavaScript files for each sample and updates to the package.json
file to include necessary dependencies and scripts. Overall, the code appears well-structured and follows a consistent pattern. However, there are a few areas that could be improved for clarity and maintainability.
Summary of Findings
- Copyright Year: The copyright year in all files is set to 2025. Please confirm that this is the correct year, or update it to the current year if the code was written in 2024.
- TODO comments: The TODO comments for the developer to uncomment variables are useful, but consider providing a brief explanation of why these variables need to be uncommented and what values should be used in a real-world scenario.
- Consistent use of template literals: In some files, template literals are used for string concatenation, while in others, regular string concatenation is used. For consistency, consider using template literals throughout the codebase.
Merge Readiness
The pull request is almost ready for merging. However, I recommend addressing the copyright year and TODO comments before merging. I am unable to directly approve the pull request, and users should have others review and approve this code before merging.
@@ -0,0 +1,67 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,85 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,93 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,77 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,85 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,72 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,66 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,89 @@ | |||
// Copyright 2025 Google LLC |
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.
@@ -0,0 +1,17 @@ | |||
# Copyright 2025 Google LLC |
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.
@@ -0,0 +1,263 @@ | |||
// Copyright 2025 Google LLC |
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.
Description
Created samples for creating, listing and rendering parameter and parameter version in specific region
Samples List (regional):
Checklist
npm test
(see Testing)npm run lint
(see Style)GoogleCloudPlatform/nodejs-docs-samples
. Not a fork.