-
Notifications
You must be signed in to change notification settings - Fork 902
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
Cloud SQL create and update polish #7159
Conversation
src/dataconnect/provisionCloudSql.ts
Outdated
@@ -27,13 +27,14 @@ export async function provisionCloudSql(args: { | |||
const existingInstance = await cloudSqlAdminClient.getInstance(projectId, instanceId); | |||
silent || utils.logLabeledBullet("dataconnect", `Found existing instance ${instanceId}.`); | |||
connectionName = existingInstance?.connectionName || ""; | |||
if (!checkInstanceConfig(existingInstance, enableGoogleMlIntegration)) { | |||
const why = checkInstanceConfig(existingInstance, enableGoogleMlIntegration); | |||
if (why) { | |||
// TODO: Return message from checkInstanceConfig to explain exactly what changes are made |
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 TODO can be removed now, right?
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.
Done
src/dataconnect/provisionCloudSql.ts
Outdated
const settings = instance.settings; | ||
// CloudSQL instances must have public IP enabled to be used with Firebase Data Connect. | ||
if (!settings.ipConfiguration?.ipv4Enabled) { | ||
return false; | ||
return "enable public IP"; |
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.
Should this add to an array of reasons, so this method returns all the things that need to be updated, rather than just the first one?
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.
Good idea. Changed it to append to the reason string, so will display it as a list.
src/dataconnect/provisionCloudSql.ts
Outdated
@@ -95,23 +106,23 @@ export async function provisionCloudSql(args: { | |||
export function checkInstanceConfig( |
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.
nit: Maybe rename to getUpdateReason
and have this return an array of string reasons?
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.
Done
Thank you for the review~ Addressed feedbacks~ |
* Cloud SQL create and update polish (#7159) * improve logged message execute SQL commands (#7156) * Error handling and logging when linking CSQL instance (#7158) * Display accurate message for INACCESSIBLE_SCHEMA error (#7157) * handle INACCESSIBLE_SCHEMA case separately * error msg * m * m * m * merge * feedbacks * Jh idx no metadata calls (#7179) * Avoid triggering metadata server calls in idx * Remove outdated service account check * Update Firebase Logo (#7180) * unleash turtles (#7174) * unleash turtles * Update CHANGELOG.md * Flag flip for gen kit (#7175) * Flag flip for gen kit * Update CHANGELOG.md * update icons --------- Co-authored-by: Bryan Kendall <bkend@google.com> Co-authored-by: joehan <joehanley@google.com> * Use client instead of size 1 pool (#7182) * Fix schema validation (#7185) * Fix schema validation * Also depend on redhat.yaml * fix typo --------- Co-authored-by: Fred Zhang <fredzqm@google.com> Co-authored-by: Harold Shen <hlshen@google.com> Co-authored-by: Bryan Kendall <bkend@google.com>
Description
Explain why update instance is needed
Make create database optional. It fails if CSQL is in the middle of some operations.
Common example is linking an instance just created in cloud console.
Update the create setting a bit to match the default query insights configs.
Otherwise, any instances created via CLI would override it to 0... I consider this a CSQL bug, but see also http://cl/629192474
When customer click edit instance, do nothing and then click save, they see this:
Scenarios Tested
Print update reason:
Sample Commands