From 39abbb146a54748b3192dfe2069d908bb728ea3c Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 19 Jun 2026 19:33:46 +0000 Subject: [PATCH 1/5] Add cloudbuild.yaml file for bigquery repository --- handwritten/bigquery/cloudbuild.yaml | 74 ++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 handwritten/bigquery/cloudbuild.yaml diff --git a/handwritten/bigquery/cloudbuild.yaml b/handwritten/bigquery/cloudbuild.yaml new file mode 100644 index 000000000000..a5d37a3d9539 --- /dev/null +++ b/handwritten/bigquery/cloudbuild.yaml @@ -0,0 +1,74 @@ +steps: +# 1. Set up Node.js environment +- name: 'node:24' + entrypoint: 'bash' + args: + - '-c' + - | + npm install + dir: 'handwritten/bigquery' + id: 'install-dependencies' + +# 2. Configure environment variables for the tests and run system tests +# - GOOGLE_APPLICATION_CREDENTIALS: GCB steps run as a service account +# that is typically granted permissions directly. Explicitly setting +# GOOGLE_APPLICATION_CREDENTIALS might not be needed if the GCB service +# account has the right roles (e.g., BigQuery Admin, BigQuery User). +# If you need to use specific service account key JSON, you'd store it +# in Secret Manager and mount it here. For simplicity, we'll rely on +# the GCB service account's inherent permissions. +# - GCLOUD_PROJECT: Can be passed as a build variable. +- name: 'node:24' + entrypoint: 'bash' + args: + - '-c' + - | + npm run system-test + dir: 'handwritten/bigquery' + env: + - 'GCLOUD_PROJECT=${_GCP_PROJECT_ID}' # Pass project ID via build variable + # If you need specific credentials from Secret Manager, uncomment these: + # - 'GOOGLE_APPLICATION_CREDENTIALS=/secrets/sa-key.json' + id: 'run-system-tests' + waitFor: ['install-dependencies'] + # For Secret Manager, uncomment these (adjust secret name and volume path as needed): + # secretEnv: ['SA_KEY'] + # volumes: + # - name: 'sa-keys' + # path: '/secrets' + +# 3. (Optional) Code Coverage Reporting +- name: 'node:24' + entrypoint: 'bash' + args: + - '-c' + - | + # Check if nyc is installed and run report + if [ -f ./node_modules/nyc/bin/nyc.js ]; then + ./node_modules/nyc/bin/nyc.js report || true # `|| true` prevents build failure if nyc report itself exits non-zero + else + echo "nyc not found, skipping coverage report." + fi + # The original codecov.sh script from Kokoro needs to be made available to GCB. + # Options: + # a) Commit codecov.sh into your repo (e.g., .kokoro/codecov.sh) and call it: + # if [ -f .kokoro/codecov.sh ]; then . ./.kokoro/codecov.sh; fi + # b) Replicate its functionality directly in this step. + # c) Store it in a GCS bucket and fetch it. + echo "Codecov reporting (if desired) would be integrated here." + dir: 'handwritten/bigquery' + id: 'coverage-report' + waitFor: ['run-system-tests'] + +# If you use Secret Manager for credentials, uncomment and configure: +# availableSecrets: +# secretManager: +# - versionName: projects/${PROJECT_ID}/secrets/YOUR_SERVICE_ACCOUNT_KEY_SECRET_NAME/versions/latest +# env: 'SA_KEY' # This env var will hold the secret value. Use it as GOOGLE_APPLICATION_CREDENTIALS in step 3 if needed. + +# Define a substitution variable for your project ID +# Replace 'long-door-651' with the actual GCP Project ID your system tests should run against. +substitutions: + _GCP_PROJECT_ID: 'long-door-651' + +timeout: '10800s' From 47354c2caf80b5887d01c56f75555a755995516a Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 19 Jun 2026 17:21:28 -0400 Subject: [PATCH 2/5] Reduce timeout --- handwritten/bigtable/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handwritten/bigtable/cloudbuild.yaml b/handwritten/bigtable/cloudbuild.yaml index 23c64be391e1..e7651238d94f 100644 --- a/handwritten/bigtable/cloudbuild.yaml +++ b/handwritten/bigtable/cloudbuild.yaml @@ -71,4 +71,4 @@ steps: substitutions: _GCP_PROJECT_ID: 'long-door-651' -timeout: '10800s' +timeout: '3600s' From a1e15a9ffffeb6611bf36753547ece6e9b33f11b Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 22 Jun 2026 10:38:39 -0400 Subject: [PATCH 3/5] increase the timeout - no bigtable changes --- handwritten/bigtable/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handwritten/bigtable/cloudbuild.yaml b/handwritten/bigtable/cloudbuild.yaml index e7651238d94f..23c64be391e1 100644 --- a/handwritten/bigtable/cloudbuild.yaml +++ b/handwritten/bigtable/cloudbuild.yaml @@ -71,4 +71,4 @@ steps: substitutions: _GCP_PROJECT_ID: 'long-door-651' -timeout: '3600s' +timeout: '10800s' From 49578afc994575437eb9cd9d00f9efca5719a17f Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 22 Jun 2026 10:39:25 -0400 Subject: [PATCH 4/5] Reset the timeout to one hour --- handwritten/bigquery/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handwritten/bigquery/cloudbuild.yaml b/handwritten/bigquery/cloudbuild.yaml index a5d37a3d9539..80a1f9f447a0 100644 --- a/handwritten/bigquery/cloudbuild.yaml +++ b/handwritten/bigquery/cloudbuild.yaml @@ -71,4 +71,4 @@ steps: substitutions: _GCP_PROJECT_ID: 'long-door-651' -timeout: '10800s' +timeout: '3600s' From a20e4103f1322ec6830a64a62e69f93bfdbfde71 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 22 Jun 2026 10:39:25 -0400 Subject: [PATCH 5/5] test: run the bigquery system tests in google cloud build --- handwritten/bigquery/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handwritten/bigquery/cloudbuild.yaml b/handwritten/bigquery/cloudbuild.yaml index a5d37a3d9539..80a1f9f447a0 100644 --- a/handwritten/bigquery/cloudbuild.yaml +++ b/handwritten/bigquery/cloudbuild.yaml @@ -71,4 +71,4 @@ steps: substitutions: _GCP_PROJECT_ID: 'long-door-651' -timeout: '10800s' +timeout: '3600s'