From 7e79e0dc9268f74b26e164ebe2f4b30e07c21916 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Thu, 20 Feb 2025 14:14:56 -0800 Subject: [PATCH 1/8] chore(csql): update mysql iam reference --- .github/workflows/tests.yml | 4 ---- .../cloud/sql/mariadb/JdbcMariaDBIamAuthIntegrationTests.java | 4 ++-- ...MysqlJ8IAMServiceAccountImpersonationIntegrationTests.java | 4 ++-- .../cloud/sql/mysql/JdbcMysqlJ8IamAuthIntegrationTests.java | 4 ++-- .../cloud/sql/core/R2dbcMariadbIamAuthIntegrationTests.java | 4 ++-- .../cloud/sql/core/R2dbcMysqlIamAuthIntegrationTests.java | 4 ++-- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 330df6a0b..4ee8ce49d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -130,7 +130,6 @@ jobs: MYSQL_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER MYSQL_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_PASS MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB - MYSQL_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_JAVA_IAM_CONNECTION_NAME MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME @@ -156,7 +155,6 @@ jobs: MYSQL_USER: "${{ steps.secrets.outputs.MYSQL_USER }}" MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}" MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" - MYSQL_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_IAM_CONNECTION_NAME }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" @@ -241,7 +239,6 @@ jobs: MYSQL_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER MYSQL_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_PASS MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB - MYSQL_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_JAVA_IAM_CONNECTION_NAME MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME @@ -268,7 +265,6 @@ jobs: MYSQL_USER: "${{ steps.secrets.outputs.MYSQL_USER }}" MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}" MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" - MYSQL_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_IAM_CONNECTION_NAME }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" diff --git a/jdbc/mariadb/src/test/java/com/google/cloud/sql/mariadb/JdbcMariaDBIamAuthIntegrationTests.java b/jdbc/mariadb/src/test/java/com/google/cloud/sql/mariadb/JdbcMariaDBIamAuthIntegrationTests.java index 0b2b35f36..4996e20f1 100644 --- a/jdbc/mariadb/src/test/java/com/google/cloud/sql/mariadb/JdbcMariaDBIamAuthIntegrationTests.java +++ b/jdbc/mariadb/src/test/java/com/google/cloud/sql/mariadb/JdbcMariaDBIamAuthIntegrationTests.java @@ -38,11 +38,11 @@ @RunWith(JUnit4.class) public class JdbcMariaDBIamAuthIntegrationTests { - private static final String CONNECTION_NAME = System.getenv("MYSQL_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("MYSQL_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("MYSQL_DB"); private static final String DB_USER = System.getenv("MYSQL_IAM_USER"); private static final ImmutableList requiredEnvVars = - ImmutableList.of("MYSQL_IAM_CONNECTION_NAME", "MYSQL_DB", "MYSQL_IAM_USER"); + ImmutableList.of("MYSQL_CONNECTION_NAME", "MYSQL_DB", "MYSQL_IAM_USER"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IAMServiceAccountImpersonationIntegrationTests.java b/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IAMServiceAccountImpersonationIntegrationTests.java index c9c730954..f77c30dfc 100644 --- a/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IAMServiceAccountImpersonationIntegrationTests.java +++ b/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IAMServiceAccountImpersonationIntegrationTests.java @@ -38,12 +38,12 @@ @RunWith(JUnit4.class) public class JdbcMysqlJ8IAMServiceAccountImpersonationIntegrationTests { - private static final String CONNECTION_NAME = System.getenv("MYSQL_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("MYSQL_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("MYSQL_DB"); private static final String IMPERSONATED_USER = System.getenv("IMPERSONATED_USER"); private static final ImmutableList requiredEnvVars = - ImmutableList.of("MYSQL_DB", "MYSQL_IAM_CONNECTION_NAME", "IMPERSONATED_USER"); + ImmutableList.of("MYSQL_DB", "MYSQL_CONNECTION_NAME", "IMPERSONATED_USER"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IamAuthIntegrationTests.java b/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IamAuthIntegrationTests.java index 8606eb224..0846e8e3d 100644 --- a/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IamAuthIntegrationTests.java +++ b/jdbc/mysql-j-8/src/test/java/com/google/cloud/sql/mysql/JdbcMysqlJ8IamAuthIntegrationTests.java @@ -38,12 +38,12 @@ @RunWith(JUnit4.class) public class JdbcMysqlJ8IamAuthIntegrationTests { - private static final String CONNECTION_NAME = System.getenv("MYSQL_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("MYSQL_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("MYSQL_DB"); private static final String DB_USER = System.getenv("MYSQL_IAM_USER"); private static final ImmutableList requiredEnvVars = - ImmutableList.of("MYSQL_IAM_USER", "MYSQL_DB", "MYSQL_IAM_CONNECTION_NAME"); + ImmutableList.of("MYSQL_IAM_USER", "MYSQL_DB", "MYSQL_CONNECTION_NAME"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/r2dbc/mariadb/src/test/java/com/google/cloud/sql/core/R2dbcMariadbIamAuthIntegrationTests.java b/r2dbc/mariadb/src/test/java/com/google/cloud/sql/core/R2dbcMariadbIamAuthIntegrationTests.java index 28696d570..8c2fa540d 100644 --- a/r2dbc/mariadb/src/test/java/com/google/cloud/sql/core/R2dbcMariadbIamAuthIntegrationTests.java +++ b/r2dbc/mariadb/src/test/java/com/google/cloud/sql/core/R2dbcMariadbIamAuthIntegrationTests.java @@ -46,9 +46,9 @@ public class R2dbcMariadbIamAuthIntegrationTests { private static final ImmutableList requiredEnvVars = - ImmutableList.of("MYSQL_IAM_USER", "MYSQL_DB", "MYSQL_IAM_CONNECTION_NAME"); + ImmutableList.of("MYSQL_IAM_USER", "MYSQL_DB", "MYSQL_CONNECTION_NAME"); - private static final String CONNECTION_NAME = System.getenv("MYSQL_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("MYSQL_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("MYSQL_DB"); private static final String DB_USER = System.getenv("MYSQL_IAM_USER"); diff --git a/r2dbc/mysql/src/test/java/com/google/cloud/sql/core/R2dbcMysqlIamAuthIntegrationTests.java b/r2dbc/mysql/src/test/java/com/google/cloud/sql/core/R2dbcMysqlIamAuthIntegrationTests.java index f451ba0bd..cdb982ece 100644 --- a/r2dbc/mysql/src/test/java/com/google/cloud/sql/core/R2dbcMysqlIamAuthIntegrationTests.java +++ b/r2dbc/mysql/src/test/java/com/google/cloud/sql/core/R2dbcMysqlIamAuthIntegrationTests.java @@ -46,9 +46,9 @@ public class R2dbcMysqlIamAuthIntegrationTests { private static final ImmutableList requiredEnvVars = - ImmutableList.of("MYSQL_IAM_USER", "MYSQL_DB", "MYSQL_IAM_CONNECTION_NAME"); + ImmutableList.of("MYSQL_IAM_USER", "MYSQL_DB", "MYSQL_CONNECTION_NAME"); - private static final String CONNECTION_NAME = System.getenv("MYSQL_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("MYSQL_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("MYSQL_DB"); private static final String DB_USER = System.getenv("MYSQL_IAM_USER"); From 0505135f6fb356d7872e9d4f9389518c20f21624 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Thu, 20 Feb 2025 14:37:43 -0800 Subject: [PATCH 2/8] chore(csql): update pg iam instance reference --- .github/workflows/tests.yml | 4 ---- .../sql/postgres/JdbcPostgresIamAuthIntegrationTests.java | 4 ++-- .../postgres/JdbcPostgresNamedConnectorIntegrationTests.java | 4 ++-- ...JdbcPostgresQuotaProjecImpersonationtIntegrationTests.java | 4 ++-- .../JdbcPostgresQuotaProjectIAMAuthIntegrationTests.java | 4 ++-- ...bcPostgresServiceAccountImpersonationIntegrationTests.java | 4 ++-- .../cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java | 4 ++-- 7 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ee8ce49d..5ad020ba9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -132,7 +132,6 @@ jobs: MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME - POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS @@ -157,7 +156,6 @@ jobs: MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" - POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}" @@ -241,7 +239,6 @@ jobs: MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME - POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS @@ -267,7 +264,6 @@ jobs: MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" - POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}" diff --git a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresIamAuthIntegrationTests.java b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresIamAuthIntegrationTests.java index a64cbba0f..8e5c1c69b 100644 --- a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresIamAuthIntegrationTests.java +++ b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresIamAuthIntegrationTests.java @@ -47,12 +47,12 @@ public class JdbcPostgresIamAuthIntegrationTests { LoggerFactory.getLogger(JdbcPostgresIamAuthIntegrationTests.class); // [START cloud_sql_connector_postgres_jdbc_iam_auth] - private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String DB_USER = System.getenv("POSTGRES_IAM_USER"); // [END cloud_sql_connector_postgres_jdbc_iam_auth] private static final ImmutableList requiredEnvVars = - ImmutableList.of("POSTGRES_IAM_USER", "POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME"); + ImmutableList.of("POSTGRES_IAM_USER", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresNamedConnectorIntegrationTests.java b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresNamedConnectorIntegrationTests.java index c48baa805..00704bcff 100644 --- a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresNamedConnectorIntegrationTests.java +++ b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresNamedConnectorIntegrationTests.java @@ -44,11 +44,11 @@ @RunWith(JUnit4.class) public class JdbcPostgresNamedConnectorIntegrationTests { - private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String DB_USER = System.getenv("POSTGRES_IAM_USER"); private static final ImmutableList requiredEnvVars = - ImmutableList.of("POSTGRES_IAM_USER", "POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME"); + ImmutableList.of("POSTGRES_IAM_USER", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjecImpersonationtIntegrationTests.java b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjecImpersonationtIntegrationTests.java index dc9041f32..98271e57b 100644 --- a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjecImpersonationtIntegrationTests.java +++ b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjecImpersonationtIntegrationTests.java @@ -38,14 +38,14 @@ @RunWith(JUnit4.class) public class JdbcPostgresQuotaProjecImpersonationtIntegrationTests { - private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String IMPERSONATED_USER = System.getenv("IMPERSONATED_USER"); private static final String QUOTA_PROJECT = System.getenv("QUOTA_PROJECT"); private static final ImmutableList requiredEnvVars = ImmutableList.of( - "IMPERSONATED_USER", "POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME", "QUOTA_PROJECT"); + "IMPERSONATED_USER", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME", "QUOTA_PROJECT"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjectIAMAuthIntegrationTests.java b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjectIAMAuthIntegrationTests.java index d27dad233..c487c87ad 100644 --- a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjectIAMAuthIntegrationTests.java +++ b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresQuotaProjectIAMAuthIntegrationTests.java @@ -38,14 +38,14 @@ @RunWith(JUnit4.class) public class JdbcPostgresQuotaProjectIAMAuthIntegrationTests { - private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String DB_USER = System.getenv("POSTGRES_IAM_USER"); private static final String QUOTA_PROJECT = System.getenv("QUOTA_PROJECT"); private static final ImmutableList requiredEnvVars = ImmutableList.of( - "POSTGRES_IAM_USER", "POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME", "QUOTA_PROJECT"); + "POSTGRES_IAM_USER", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME", "QUOTA_PROJECT"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresServiceAccountImpersonationIntegrationTests.java b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresServiceAccountImpersonationIntegrationTests.java index b95b537a2..dd88cc147 100644 --- a/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresServiceAccountImpersonationIntegrationTests.java +++ b/jdbc/postgres/src/test/java/com/google/cloud/sql/postgres/JdbcPostgresServiceAccountImpersonationIntegrationTests.java @@ -42,12 +42,12 @@ @RunWith(JUnit4.class) public class JdbcPostgresServiceAccountImpersonationIntegrationTests { - private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String IMPERSONATED_USER = System.getenv("IMPERSONATED_USER"); private static final ImmutableList requiredEnvVars = - ImmutableList.of("POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME", "IMPERSONATED_USER"); + ImmutableList.of("POSTGRES_DB", "POSTGRES_CONNECTION_NAME", "IMPERSONATED_USER"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private HikariDataSource connectionPool; diff --git a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java index 72caf7bec..1e0f2293b 100644 --- a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java +++ b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java @@ -47,13 +47,13 @@ public class R2dbcPostgresIamAuthIntegrationTests { // [START cloud_sql_connector_postgres_r2dbc_iam_auth] - private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String DB_USER = System.getenv("POSTGRES_IAM_USER"); // [END cloud_sql_connector_postgres_r2dbc_iam_auth] private static final ImmutableList requiredEnvVars = ImmutableList.of( - "POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME"); + "POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private ConnectionFactory connectionPool; From 3cfa5f1212fc5975abba5ce94734fc465949de85 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Thu, 20 Feb 2025 14:54:53 -0800 Subject: [PATCH 3/8] chore(csql): test integration tests with r2dbciam unchanged --- .github/workflows/tests.yml | 4 ++++ .../cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5ad020ba9..4ee8ce49d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -132,6 +132,7 @@ jobs: MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME + POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS @@ -156,6 +157,7 @@ jobs: MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" + POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}" @@ -239,6 +241,7 @@ jobs: MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME + POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS @@ -264,6 +267,7 @@ jobs: MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" + POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}" diff --git a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java index 1e0f2293b..72caf7bec 100644 --- a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java +++ b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java @@ -47,13 +47,13 @@ public class R2dbcPostgresIamAuthIntegrationTests { // [START cloud_sql_connector_postgres_r2dbc_iam_auth] - private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String DB_USER = System.getenv("POSTGRES_IAM_USER"); // [END cloud_sql_connector_postgres_r2dbc_iam_auth] private static final ImmutableList requiredEnvVars = ImmutableList.of( - "POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME"); + "POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private ConnectionFactory connectionPool; From 11d2ff7492a14145ffb7e3822c4d105d45906917 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Fri, 21 Feb 2025 10:57:03 -0800 Subject: [PATCH 4/8] chore(csql): test pg-iam conn for r2dbc with pg conn name --- .../cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java index 72caf7bec..1e0f2293b 100644 --- a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java +++ b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java @@ -47,13 +47,13 @@ public class R2dbcPostgresIamAuthIntegrationTests { // [START cloud_sql_connector_postgres_r2dbc_iam_auth] - private static final String CONNECTION_NAME = System.getenv("POSTGRES_IAM_CONNECTION_NAME"); + private static final String CONNECTION_NAME = System.getenv("POSTGRES_CONNECTION_NAME"); private static final String DB_NAME = System.getenv("POSTGRES_DB"); private static final String DB_USER = System.getenv("POSTGRES_IAM_USER"); // [END cloud_sql_connector_postgres_r2dbc_iam_auth] private static final ImmutableList requiredEnvVars = ImmutableList.of( - "POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_IAM_CONNECTION_NAME"); + "POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private ConnectionFactory connectionPool; From 2dd23f6d234129671f41bd464a51f68970e25718 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Fri, 21 Feb 2025 11:54:20 -0800 Subject: [PATCH 5/8] chore(csql): fix r2dbc iam pg format --- .github/workflows/tests.yml | 4 ---- .../cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ee8ce49d..5ad020ba9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -132,7 +132,6 @@ jobs: MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME - POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS @@ -157,7 +156,6 @@ jobs: MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" - POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}" @@ -241,7 +239,6 @@ jobs: MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME - POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS @@ -267,7 +264,6 @@ jobs: MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" - POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}" diff --git a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java index 1e0f2293b..41d320636 100644 --- a/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java +++ b/r2dbc/postgres/src/test/java/com/google/cloud/sql/core/R2dbcPostgresIamAuthIntegrationTests.java @@ -52,8 +52,7 @@ public class R2dbcPostgresIamAuthIntegrationTests { private static final String DB_USER = System.getenv("POSTGRES_IAM_USER"); // [END cloud_sql_connector_postgres_r2dbc_iam_auth] private static final ImmutableList requiredEnvVars = - ImmutableList.of( - "POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME"); + ImmutableList.of("POSTGRES_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_CONNECTION_NAME"); @Rule public Timeout globalTimeout = new Timeout(80, TimeUnit.SECONDS); private ConnectionFactory connectionPool; From 950319c616e867dc609917eba87ea9e5f5c2a903 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Tue, 25 Feb 2025 11:32:12 -0800 Subject: [PATCH 6/8] chore: add MySQL Java IAM conn secret --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5ad020ba9..05d3be0ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -238,6 +238,7 @@ jobs: MYSQL_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_PASS MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA + MYSQL_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_JAVA_IAM_CONNECTION_NAME POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA @@ -263,6 +264,7 @@ jobs: MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}" MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" + MYSQL_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_IAM_CONNECTION_NAME }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" From 4b03967d6020480575135fb65c4d977b895341f3 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Thu, 6 Mar 2025 15:50:25 -0800 Subject: [PATCH 7/8] chore: remove mysql iam conn name and test if graalvm tests are affected --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 05d3be0ad..36a1bd014 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -200,7 +200,7 @@ jobs: ./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} graalvm: # run job on periodic (schedule) event - if: "${{ github.event_name == 'schedule' }}" + if: "${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')}}" name: graalvm native / linux runs-on: ubuntu-latest permissions: @@ -238,7 +238,6 @@ jobs: MYSQL_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_PASS MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB MYSQL_IAM_USER_JAVA:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_JAVA - MYSQL_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_JAVA_IAM_CONNECTION_NAME POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_JAVA @@ -264,7 +263,6 @@ jobs: MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}" MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}" MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER_JAVA }}" - MYSQL_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_IAM_CONNECTION_NAME }}" POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}" POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}" POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}" From 2eec1ad5e9c20666ba56c5cf5faac9c5907a4c10 Mon Sep 17 00:00:00 2001 From: kgala2 Date: Thu, 6 Mar 2025 16:09:09 -0800 Subject: [PATCH 8/8] chore: restore graalvm test execution logic --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36a1bd014..5ad020ba9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -200,7 +200,7 @@ jobs: ./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} graalvm: # run job on periodic (schedule) event - if: "${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')}}" + if: "${{ github.event_name == 'schedule' }}" name: graalvm native / linux runs-on: ubuntu-latest permissions: