Skip to content

Add labels to GCS bucket and secrets created by compose#298

Open
harish-sharma-94 wants to merge 4 commits into
mainfrom
compose-resources-labels
Open

Add labels to GCS bucket and secrets created by compose#298
harish-sharma-94 wants to merge 4 commits into
mainfrom
compose-resources-labels

Conversation

@harish-sharma-94

Copy link
Copy Markdown
Collaborator

This PR introduces labels to Google Cloud Storage (GCS) buckets and Secret Manager secrets created during Cloud Run Compose deployments. This aligns the MCP server's behavior with gcloud run compose to help track and identify resources associated with specific compose projects.

@harish-sharma-94

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@harish-sharma-94

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 GCP labeling for created secrets and storage buckets by adding a labels parameter to creation functions and implementing a sanitizeLabelValue helper. Review feedback points out that sanitizeLabelValue could throw a TypeError if passed a non-string value (like a number) and unnecessarily prepends 'p-' to values starting with numbers, which are valid GCP label values. Suggestions were made to convert the input to a string, update the regex to allow leading numbers, and adjust the corresponding unit tests.

Comment thread lib/util/helpers.js
Comment thread test/local/util.test.js

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 GCP labeling for created storage buckets and secrets. It adds a sanitizeLabelValue helper function to ensure label values comply with GCP constraints, integrates label application into the compose deployment flow, and adds comprehensive unit tests. The review feedback correctly identifies that GCP label values are allowed to start with a number, making the prepending of 'p-' unnecessary for those cases, and provides suggestions to fix both the helper function and its tests.

Comment thread lib/util/helpers.js Outdated
Comment thread test/local/util.test.js
@harish-sharma-94

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants