fix: revoke cloudsqlsuperuser permission#25
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the MySQL grant/revoke helper script to avoid failing MySQL 8.0/8.4 provisioning when REVOKE cloudsqlsuperuser would otherwise error, and documents the fix in the changelog.
Changes:
- Add a
SHOW GRANTSpre-check inexecute_sql.shto only attemptREVOKE cloudsqlsuperuserwhen the role is actually present. - Update
CHANGELOG.mdwith a 0.5.2 release entry describing the MySQL 8.0/8.4 fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/execute_sql.sh | Adds a grants pre-check to conditionally revoke cloudsqlsuperuser for MySQL 8.0/8.4. |
| CHANGELOG.md | Documents the fix as release 0.5.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
/improve |
There was a problem hiding this comment.
Pull request overview
This PR fixes MySQL 8.0/8.4 provisioning failures caused by attempting to REVOKE cloudsqlsuperuser when the admin user lacks ROLE_ADMIN, by adding a SHOW GRANTS pre-check and documenting the change in the changelog.
Changes:
- Add
SHOW GRANTS FOR userpre-check before attemptingREVOKE cloudsqlsuperuseron MySQL 8.0/8.4. - Skip role revocation when the role is not present; keep provisioning flowing to DB-scoped grants.
- Add
0.5.2release notes describing the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/execute_sql.sh | Adds a grants pre-check to decide whether to revoke cloudsqlsuperuser and adjusts SQL statements accordingly. |
| CHANGELOG.md | Documents the 0.5.2 bug fix and links the comparison to the previous version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
/describe |
PR Type
Bug fix
Description
Fix MySQL 8.0/8.4
REVOKE cloudsqlsuperusercausingAccess Denied(1045) errorAdd
SHOW GRANTSpre-check before attempting role revocationSkip revoke if role is absent, avoiding
ROLE_ADMINprivilege requirementUpdate
CHANGELOG.mdwith version0.5.2release notesDiagram Walkthrough
File Walkthrough
execute_sql.sh
Add SHOW GRANTS pre-check before revoking cloudsqlsuperuser rolescripts/execute_sql.sh
REVOKE cloudsqlsuperuserwith aSHOW GRANTSpre-check todetect role presence
cloudsqlsuperuseris found in grants outputAccessDenied(1045) errorsSHOW GRANTSitself failsCHANGELOG.md
Document version 0.5.2 bug fix in changelogCHANGELOG.md
0.5.2release entry documenting the MySQL 8.0/8.4 provisioningfix
Access Deniederror onREVOKE cloudsqlsuperuser