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

chore: add runtime hints for sql autoconfigure and sql-mysql samples to native ci #2384

Merged
merged 13 commits into from
Nov 30, 2023

Conversation

zhumin8
Copy link
Contributor

@zhumin8 zhumin8 commented Nov 27, 2023

Changes in this PR:
Add runtime hints for GcpCloudSqlProperties.class in sql autoconfigure.

Other changes:

  • Adds sql-mysql-sample , sql-postgres-sample and sql-postgres-r2dbc-sample to native ci.
  • Setups to pass DB password to native test. (In integration ci, db password is stored as env and passed as option here. pass same env var through maven-surefire-plugin in nativeTest profile.)
  • Changes in instance name setup for tests, now it tests run under spring-cloud-gcp-ci project and native tests run in spring-cloud-gcp-ci-native project.

Todos:

@zhumin8 zhumin8 changed the title [wip] add sql-mysql sample to native ci chore: [wip] add sql-mysql sample to native ci Nov 28, 2023
@zhumin8 zhumin8 changed the title chore: [wip] add sql-mysql sample to native ci chore: add runtime hints for sql autoconfigure and sql-mysql samples to native ci Nov 29, 2023
@zhumin8 zhumin8 marked this pull request as ready for review November 29, 2023 19:17
@zhumin8 zhumin8 requested a review from a team as a code owner November 29, 2023 19:17
@@ -168,6 +168,7 @@ jobs:
verify
env:
DB_PASSWORD: ${{ secrets.SPRING_CLOUD_GCP_CI_DB_ROOT_PASSWORD }}
GOOGLE_CLOUD_PROJECT: spring-cloud-gcp-ci
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the GOOGLE_CLOUD_PROJECT needed here, but not in the equivalent native env block? Both use setup-gcloud to set the project_id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. On a second look, I updated this pr to use GCP_PROJECT which is commonly setup in both workflows.

IntegrationTest.yaml is using "google-github-actions/setup-gcloud@v0" vs. NativeTests.yaml using "google-github-actions/setup-gcloud@v1". That might have caused the slight difference in env vars setup.
Integration

    CLOUDSDK_METRICS_ENVIRONMENT: github-actions-setup-gcloud
    GCLOUD_PROJECT: spring-cloud-gcp-ci

Native:

    CLOUDSDK_CORE_PROJECT: spring-cloud-gcp-ci-native
    CLOUDSDK_PROJECT: spring-cloud-gcp-ci-native
    GCLOUD_PROJECT: spring-cloud-gcp-ci-native
    GCP_PROJECT: spring-cloud-gcp-ci-native
    GOOGLE_CLOUD_PROJECT: spring-cloud-gcp-ci-native
    CLOUDSDK_METRICS_ENVIRONMENT: github-actions-setup-gcloud
    CLOUDSDK_METRICS_ENVIRONMENT_VERSION: 1.1.1

I'll raise a separate pr to upgrade this github action version for integration yaml.

@@ -160,6 +162,8 @@ jobs:
id: intTest
run: |
MODULE_UNDER_TEST="${{ matrix.it }}" ./.github/workflows/scripts/native-image-tests.sh
env:
DB_PASSWORD: ${{ secrets.SPRING_CLOUD_GCP_CI_NATIVE_DB_ROOT_PASSWORD }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@zhumin8 zhumin8 merged commit 370c1bf into main Nov 30, 2023
53 checks passed
@zhumin8 zhumin8 deleted the graal-sql branch November 30, 2023 20:48
zhumin8 added a commit that referenced this pull request Nov 30, 2023
Followup to comment [here](#2384 (comment)), upgrades `google-github-actions/setup-gcloud` to be consistent with  [nativeTests.yaml](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/main/.github/workflows/NativeTests.yaml) following example [here](https://github.com/google-github-actions/setup-gcloud#service-account-key-json).

This also fixes deprecation warnings on integration test workflows.
```
"service_account_key" has been deprecated. Please switch to using google-github-actions/auth which supports both Workload Identity Federation and Service Account Key JSON authentication. For more details, see https://github.com/google-github-actions/setup-gcloud#authorization
```
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.

2 participants