From 665a031833156a79c2a00ce118602efb0454a6c2 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Mon, 3 Feb 2025 13:37:22 -0800 Subject: [PATCH 01/14] ci: enable new CI for eventarc/audit-storage --- .github/config/nodejs-dev.jsonc | 1 + .github/config/nodejs-prod.jsonc | 1 - eventarc/audit-storage/ci-setup.json | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 eventarc/audit-storage/ci-setup.json diff --git a/.github/config/nodejs-dev.jsonc b/.github/config/nodejs-dev.jsonc index 90d1cfbdb9..b770021e96 100644 --- a/.github/config/nodejs-dev.jsonc +++ b/.github/config/nodejs-dev.jsonc @@ -106,6 +106,7 @@ "endpoints/getting-started", "endpoints/getting-started-grpc", "error-reporting", + "eventarc/audit-storage", "eventarc/generic", "functions/concepts/afterResponse", "functions/concepts/afterTimeout", diff --git a/.github/config/nodejs-prod.jsonc b/.github/config/nodejs-prod.jsonc index fb2be3d01a..d7bbd1e6b8 100644 --- a/.github/config/nodejs-prod.jsonc +++ b/.github/config/nodejs-prod.jsonc @@ -82,7 +82,6 @@ "dialogflow-cx", // NOT_FOUND: com.google.apps.framework.request.NotFoundException: Agent 'undefined' does not exist "dlp", // [ERR_REQUIRE_ESM]: require() of ES Module "document-ai", // [ERR_REQUIRE_ESM]: require() of ES Module - "eventarc/audit-storage", // (untested) Environment Variable 'SERVICE_NAME' not found "eventarc/pubsub", // (untested) Environment Variable 'SERVICE_NAME' not found "functions/billing", // Error: Request failed with status code 500 "functions/http/uploadFile", // npm error Missing script: "test" diff --git a/eventarc/audit-storage/ci-setup.json b/eventarc/audit-storage/ci-setup.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/eventarc/audit-storage/ci-setup.json @@ -0,0 +1 @@ +{} From 2a1d86b9ecc25cb71f83fe9fac10b669bfc8e559 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Mon, 3 Feb 2025 13:45:54 -0800 Subject: [PATCH 02/14] ci: set SERVICE_NAME env variable --- eventarc/audit-storage/ci-setup.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eventarc/audit-storage/ci-setup.json b/eventarc/audit-storage/ci-setup.json index 0967ef424b..b3d3587efc 100644 --- a/eventarc/audit-storage/ci-setup.json +++ b/eventarc/audit-storage/ci-setup.json @@ -1 +1,3 @@ -{} +{ + "SERVICE_NAME" : "eventarc-audit-storage" +} From 556ea2669080880ace12014dfb32e9dee7cb775a Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Mon, 3 Feb 2025 13:50:07 -0800 Subject: [PATCH 03/14] ci: actually use the "env" key in ci-setup.json --- eventarc/audit-storage/ci-setup.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eventarc/audit-storage/ci-setup.json b/eventarc/audit-storage/ci-setup.json index b3d3587efc..bacf8ab690 100644 --- a/eventarc/audit-storage/ci-setup.json +++ b/eventarc/audit-storage/ci-setup.json @@ -1,3 +1,5 @@ { - "SERVICE_NAME" : "eventarc-audit-storage" + "env" : { + "SERVICE_NAME" : "eventarc-audit-storage" + } } From 63b31c75dae5f28ac1bbe98e999c68072e81e185 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 10:54:45 -0800 Subject: [PATCH 04/14] fix: set needed CONTAINER_IMAGE env variable --- eventarc/audit-storage/ci-setup.json | 1 + 1 file changed, 1 insertion(+) diff --git a/eventarc/audit-storage/ci-setup.json b/eventarc/audit-storage/ci-setup.json index bacf8ab690..d2783a832d 100644 --- a/eventarc/audit-storage/ci-setup.json +++ b/eventarc/audit-storage/ci-setup.json @@ -1,5 +1,6 @@ { "env" : { "SERVICE_NAME" : "eventarc-audit-storage" + "CONTAINER_IMAGE" : "gcr.io/${GOOGLE_SAMPLES_PROJECT}/run-eventarc-audit-storage-${RUN_ID}" } } From a9241ba411848b66e078ab600afec7b1bcf74208 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 10:47:20 -0800 Subject: [PATCH 05/14] fix(ci): don't run all tests on exclusions change (#3983) ignore ".github/config/" so changes to the configs aren't considered global changes (which cause all packages to be tested) --- .github/config/nodejs-dev.jsonc | 1 + .github/config/nodejs-prod.jsonc | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/config/nodejs-dev.jsonc b/.github/config/nodejs-dev.jsonc index b770021e96..cf3bec813c 100644 --- a/.github/config/nodejs-dev.jsonc +++ b/.github/config/nodejs-dev.jsonc @@ -24,6 +24,7 @@ "secrets": { } }, "ignore": [ + ".github/config/", // prevent changes to exclusions from running all tests ".eslintignore", ".eslintrc.json", ".github/.OwlBot.lock.yaml", diff --git a/.github/config/nodejs-prod.jsonc b/.github/config/nodejs-prod.jsonc index d7bbd1e6b8..78e7034c9b 100644 --- a/.github/config/nodejs-prod.jsonc +++ b/.github/config/nodejs-prod.jsonc @@ -24,6 +24,7 @@ "secrets": { } }, "ignore": [ + ".github/config/", // prevent changes to exclusions from running all tests ".eslintignore", ".eslintrc.json", ".github/.OwlBot.lock.yaml", From ee26f43a04aa3006983ae51451cebfb021dbcf8a Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 11:02:42 -0800 Subject: [PATCH 06/14] fix: typo (missing comma in JSON) --- eventarc/audit-storage/ci-setup.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventarc/audit-storage/ci-setup.json b/eventarc/audit-storage/ci-setup.json index d2783a832d..124b51119d 100644 --- a/eventarc/audit-storage/ci-setup.json +++ b/eventarc/audit-storage/ci-setup.json @@ -1,6 +1,6 @@ { "env" : { - "SERVICE_NAME" : "eventarc-audit-storage" + "SERVICE_NAME" : "eventarc-audit-storage", "CONTAINER_IMAGE" : "gcr.io/${GOOGLE_SAMPLES_PROJECT}/run-eventarc-audit-storage-${RUN_ID}" } } From 0408cc9bef0045443e02ad5a8a75333bb2cd698b Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 11:21:35 -0800 Subject: [PATCH 07/14] fix: iterate on ENV replacement variables --- eventarc/audit-storage/ci-setup.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventarc/audit-storage/ci-setup.json b/eventarc/audit-storage/ci-setup.json index 124b51119d..54c01b448e 100644 --- a/eventarc/audit-storage/ci-setup.json +++ b/eventarc/audit-storage/ci-setup.json @@ -1,6 +1,6 @@ { "env" : { "SERVICE_NAME" : "eventarc-audit-storage", - "CONTAINER_IMAGE" : "gcr.io/${GOOGLE_SAMPLES_PROJECT}/run-eventarc-audit-storage-${RUN_ID}" + "CONTAINER_IMAGE" : "gcr.io/${PROJECT_ID}/run-${SERVICE_NAME}-${RUN_ID}" } } From 9487fd91ab2d42fbc6847cabc4c708d92bdebedb Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 12:55:40 -0800 Subject: [PATCH 08/14] build: debugging auth --- eventarc/audit-storage/test/runner.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eventarc/audit-storage/test/runner.sh b/eventarc/audit-storage/test/runner.sh index 9726e03eb8..70df495212 100755 --- a/eventarc/audit-storage/test/runner.sh +++ b/eventarc/audit-storage/test/runner.sh @@ -39,6 +39,13 @@ function cleanup { } trap cleanup EXIT +# temp debugging +echo '#### CI DEBUG #### +echo 'GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}' +gcloud auth list +gcloud auth print-identity-token +echo '#### end CI DEBUG #### + # TODO: Perform authentication inside the test. export ID_TOKEN=$(gcloud auth print-identity-token) export BASE_URL=$(test/url.sh) From 8669ba415fbcdf83a674d7d4011f98ef5c0f868e Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 13:43:43 -0800 Subject: [PATCH 09/14] build: debugging auth --- eventarc/audit-storage/test/runner.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eventarc/audit-storage/test/runner.sh b/eventarc/audit-storage/test/runner.sh index 70df495212..816eb6cbf5 100755 --- a/eventarc/audit-storage/test/runner.sh +++ b/eventarc/audit-storage/test/runner.sh @@ -40,11 +40,11 @@ function cleanup { trap cleanup EXIT # temp debugging -echo '#### CI DEBUG #### +echo '#### CI DEBUG ####' echo 'GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}' gcloud auth list gcloud auth print-identity-token -echo '#### end CI DEBUG #### +echo '#### end CI DEBUG ####' # TODO: Perform authentication inside the test. export ID_TOKEN=$(gcloud auth print-identity-token) From 8abdbe02db7ef059e377299c8a749e5c18e9bfc4 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 13:50:32 -0800 Subject: [PATCH 10/14] build: debugging auth --- eventarc/audit-storage/test/runner.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eventarc/audit-storage/test/runner.sh b/eventarc/audit-storage/test/runner.sh index 816eb6cbf5..215d527016 100755 --- a/eventarc/audit-storage/test/runner.sh +++ b/eventarc/audit-storage/test/runner.sh @@ -41,7 +41,12 @@ trap cleanup EXIT # temp debugging echo '#### CI DEBUG ####' -echo 'GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}' +echo "GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}" +echo 'env:' +printenv +echo 'set:' +set +echo 'gcloud auth list' gcloud auth list gcloud auth print-identity-token echo '#### end CI DEBUG ####' From 918237c41dd310a0decd5f32f646e3aefa07b1c7 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 14:02:49 -0800 Subject: [PATCH 11/14] build: debugging auth --- eventarc/audit-storage/test/runner.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/eventarc/audit-storage/test/runner.sh b/eventarc/audit-storage/test/runner.sh index 215d527016..350227de3b 100755 --- a/eventarc/audit-storage/test/runner.sh +++ b/eventarc/audit-storage/test/runner.sh @@ -42,13 +42,9 @@ trap cleanup EXIT # temp debugging echo '#### CI DEBUG ####' echo "GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}" -echo 'env:' -printenv -echo 'set:' -set echo 'gcloud auth list' -gcloud auth list -gcloud auth print-identity-token +gcloud auth list --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} +gcloud auth print-identity-token --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} echo '#### end CI DEBUG ####' # TODO: Perform authentication inside the test. From 78265c4caff535b6b250574009696b3c41678b76 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 14:14:51 -0800 Subject: [PATCH 12/14] build: debugging auth --- eventarc/audit-storage/test/runner.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eventarc/audit-storage/test/runner.sh b/eventarc/audit-storage/test/runner.sh index 350227de3b..1705209ae6 100755 --- a/eventarc/audit-storage/test/runner.sh +++ b/eventarc/audit-storage/test/runner.sh @@ -43,8 +43,12 @@ trap cleanup EXIT echo '#### CI DEBUG ####' echo "GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}" echo 'gcloud auth list' -gcloud auth list --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} -gcloud auth print-identity-token --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} +gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth list +echo 'gcloud auth login' +gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth login kokoro-system-test@long-door-651.iam.gserviceaccount.com +echo 'gcloud auth list' +gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth list +gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth print-identity-token echo '#### end CI DEBUG ####' # TODO: Perform authentication inside the test. From 0eccfbe08dec4602cbdcdd02a2ba10bc192a453d Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 14:50:50 -0800 Subject: [PATCH 13/14] build: debugging auth --- eventarc/audit-storage/test/runner.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eventarc/audit-storage/test/runner.sh b/eventarc/audit-storage/test/runner.sh index 1705209ae6..83bf836cdb 100755 --- a/eventarc/audit-storage/test/runner.sh +++ b/eventarc/audit-storage/test/runner.sh @@ -45,10 +45,8 @@ echo "GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}" echo 'gcloud auth list' gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth list echo 'gcloud auth login' -gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth login kokoro-system-test@long-door-651.iam.gserviceaccount.com -echo 'gcloud auth list' -gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth list -gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth print-identity-token +echo 'gcloud auth print-identity-token' +gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth print-identity-token kokoro-system-test@long-door-651.iam.gserviceaccount.com | head -c 42 echo '#### end CI DEBUG ####' # TODO: Perform authentication inside the test. From 95029ec3b61452667d228ac5b3b65de588b28ab0 Mon Sep 17 00:00:00 2001 From: Brian Dorsey Date: Thu, 20 Feb 2025 14:59:04 -0800 Subject: [PATCH 14/14] build: debugging auth --- eventarc/audit-storage/test/runner.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eventarc/audit-storage/test/runner.sh b/eventarc/audit-storage/test/runner.sh index 83bf836cdb..bfd020823c 100755 --- a/eventarc/audit-storage/test/runner.sh +++ b/eventarc/audit-storage/test/runner.sh @@ -42,11 +42,12 @@ trap cleanup EXIT # temp debugging echo '#### CI DEBUG ####' echo "GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}" -echo 'gcloud auth list' -gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth list -echo 'gcloud auth login' -echo 'gcloud auth print-identity-token' -gcloud --access-token-file=${GOOGLE_APPLICATION_CREDENTIALS} auth print-identity-token kokoro-system-test@long-door-651.iam.gserviceaccount.com | head -c 42 +echo 'gcloud auth print-access-token' +gcloud auth print-access-token | head -c 42 +echo 'gcloud auth print-access-token w/account' +gcloud auth print-access-token kokoro-system-test@long-door-651.iam.gserviceaccount.com | head -c 42 +echo 'gcloud auth print-identity-token w/account' +gcloud auth print-identity-token kokoro-system-test@long-door-651.iam.gserviceaccount.com | head -c 42 echo '#### end CI DEBUG ####' # TODO: Perform authentication inside the test.