Skip to content
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

Error handling and logging when linking CSQL instance #7158

Merged
merged 14 commits into from May 13, 2024
Merged

Conversation

fredzqm
Copy link
Contributor

@fredzqm fredzqm commented May 10, 2024

Description

  1. Add a warning when CSQL instance linked will be changed by the command. Most of the time this is dangerous. They are also likely to run into INACCESSIBLE_SCHEMA handled in Display accurate message for INACCESSIBLE_SCHEMA error #7157.
  2. Handle errors in sql:diff correctly. It was swallowing errors.
  3. Only link to the Cloud SQL instance automatically in sql:migrate or deploy. Log this, so any subsequent errors aren't confusing.

Scenarios Tested

dataconnect:sql:* on a non-exist service-id:
Screenshot 2024-05-09 at 11 43 32 PM

dataconnect:sql:* on existing but wrong region service-id:
Screenshot 2024-05-10 at 12 01 59 AM

When switch a service to connect to a different CSQL database:
Screenshot 2024-05-09 at 9 02 47 PM

Sample Commands

@fredzqm fredzqm changed the title Add warning if CLI attempts to change linked CSQL database Warning if linked CSQL database has changed & Tweak create instance template May 10, 2024
@fredzqm fredzqm changed the title Warning if linked CSQL database has changed & Tweak create instance template Warning if linked CSQL database has changed May 10, 2024
src/dataconnect/provisionCloudSql.ts Outdated Show resolved Hide resolved
@fredzqm fredzqm changed the title Warning if linked CSQL database has changed Error handling and logging on linking CSQL instance May 10, 2024
@fredzqm fredzqm changed the title Error handling and logging on linking CSQL instance Error handling and logging when linking CSQL instance May 10, 2024
@fredzqm fredzqm changed the base branch from master to dataconnect May 10, 2024 18:00
@fredzqm fredzqm merged commit 8f8ac06 into dataconnect May 13, 2024
35 checks passed
@fredzqm fredzqm deleted the fz/switch-db branch May 13, 2024 17:57
joehan added a commit that referenced this pull request May 20, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants