-
Notifications
You must be signed in to change notification settings - Fork 29
Add Cloud SQL private IP connection support #464
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
Add Cloud SQL private IP connection support #464
Conversation
Add support for Cloud SQL private IP connections via environment variable configuration, replacing the runtime regex-based patching workaround. Changes: - Import IPTypes from google.cloud.sql.connector for IP type specification - Add ENV_CLOUDSQL_USE_PRIVATE_IP environment variable constant - Create extensible _CLOUDSQL_ENV_TO_PARAM mapping for optional parameters - Add _get_optional_cloudsql_params() helper to build optional params dict - Update both connection points to merge optional params using dict operator Usage: Set CLOUDSQL_USE_PRIVATE_IP=true to enable private IP connections. New optional parameters can be added by extending _CLOUDSQL_ENV_TO_PARAM mapping without modifying connection code. This approach: - Maintains consistency with existing code style - Uses dictionary merge operator for clean integration - Provides extensibility for future optional parameters - Eliminates need for runtime code patching
Summary of ChangesHello @echo-chamber0, 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! This pull request significantly enhances the Cloud SQL connection mechanism by integrating native support for private IP connections. It replaces a less robust, regex-based workaround with a cleaner, environment variable-driven configuration, making the system more maintainable and extensible for future connection options and improving overall connection reliability and security. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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. Footnotes
|
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 support for Cloud SQL private IP connections by reading an environment variable. The implementation is clean and extensible, using a mapping to convert environment variables to connection parameters. The changes are applied correctly at both connection points. I have one suggestion to refactor a helper function for better conciseness and readability, but overall the changes are solid.
|
/gcbrun |
|
/gcbrun |
|
@echo-chamber0 Can you run |
Head branch was pushed to by a user without write access
e48b63d to
870ee72
Compare
|
@dwnoble It's done, could you please review again |
|
/gcbrun |
Add support for Cloud SQL private IP connections via environment variable configuration, replacing the runtime regex-based patching workaround.
Changes:
Usage:
Set CLOUDSQL_USE_PRIVATE_IP=true to enable private IP connections. New optional parameters can be added by extending _CLOUDSQL_ENV_TO_PARAM mapping without modifying connection code.