From 6e97ee3c3fb5b496b78ea41f1f7d9d78254841f5 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 09:09:51 -0700 Subject: [PATCH 01/13] add new config method to a few places --- .github/workflows/test-all.yml | 4 +++- .github/workflows/test-changed-auth.yml | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index dd74d2437e4..121f1ddaa0d 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -45,8 +45,10 @@ jobs: with: node-version: 22.10.0 - name: Test setup and yarn install + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - cp config/ci.config.json config/project.json + echo "$PROJECT_CONFIG > config/project.json" yarn - name: yarn build run: yarn build diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index b72c7cd9e2d..7515346245a 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -61,8 +61,10 @@ jobs: with: node-version: 22.10.0 - name: Test setup and yarn install + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - cp config/ci.config.json config/project.json + echo "$PROJECT_CONFIG > config/project.json" yarn - name: build run: yarn build:changed auth @@ -86,8 +88,10 @@ jobs: with: node-version: 22.10.0 - name: Test setup and yarn install + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - cp config/ci.config.json config/project.json + echo "$PROJECT_CONFIG > config/project.json" yarn - name: build run: yarn build:changed auth @@ -110,8 +114,10 @@ jobs: with: node-version: 22.10.0 - name: Test setup and yarn install + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - cp config/ci.config.json config/project.json + echo "$PROJECT_CONFIG > config/project.json" yarn npx playwright install webkit - name: build From afc6b8c56dab2b25e69e1a41428f702e2b17e853 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 09:10:19 -0700 Subject: [PATCH 02/13] touch auth to trigger ci --- packages/auth/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/auth/index.ts b/packages/auth/index.ts index 95e2f453f16..754045bdeec 100644 --- a/packages/auth/index.ts +++ b/packages/auth/index.ts @@ -21,6 +21,8 @@ * limitations under the License. */ +//test + // Public types export * from './src/model/public_types'; From 26ecafb9295660a1957bc143ea9650581e5afdab Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 09:24:47 -0700 Subject: [PATCH 03/13] move quote to right place --- .github/workflows/test-all.yml | 2 +- .github/workflows/test-changed-auth.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 121f1ddaa0d..4f58e8676ac 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -48,7 +48,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG > config/project.json" + echo "$PROJECT_CONFIG" > config/project.json yarn - name: yarn build run: yarn build diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index 7515346245a..9c2d8949b16 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -64,7 +64,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG > config/project.json" + echo "$PROJECT_CONFIG" > config/project.json yarn - name: build run: yarn build:changed auth @@ -91,7 +91,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG > config/project.json" + echo "$PROJECT_CONFIG" > config/project.json yarn - name: build run: yarn build:changed auth @@ -117,7 +117,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG > config/project.json" + echo "$PROJECT_CONFIG" > config/project.json yarn npx playwright install webkit - name: build From a0b81551b633a15275214bccf3baeb35c4b56db2 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 09:34:36 -0700 Subject: [PATCH 04/13] Adjust deploy-if-needed script --- .github/workflows/deploy-config.yml | 1 + scripts/ci-test/deploy-if-needed.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-config.yml b/.github/workflows/deploy-config.yml index 0c3604e4704..a236784f870 100644 --- a/.github/workflows/deploy-config.yml +++ b/.github/workflows/deploy-config.yml @@ -45,3 +45,4 @@ jobs: run: yarn ts-node scripts/ci-test/deploy-if-needed.ts env: FIREBASE_CLI_TOKEN: ${{secrets.FIREBASE_CLI_TOKEN}} + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} diff --git a/scripts/ci-test/deploy-if-needed.ts b/scripts/ci-test/deploy-if-needed.ts index 854d0ca3b0c..90fba13e8ac 100644 --- a/scripts/ci-test/deploy-if-needed.ts +++ b/scripts/ci-test/deploy-if-needed.ts @@ -22,7 +22,6 @@ import { exec } from 'child-process-promise'; const firebaseTools = require('firebase-tools'); const root = resolve(__dirname, '../..'); -const config = require(resolve(root, 'config/ci.config.json')); const git = simpleGit(root); interface DeployOptions { @@ -32,6 +31,11 @@ interface DeployOptions { only?: string; } +let config: { projectId: string }; +if (process.env.PROJECT_CONFIG) { + config = JSON.parse(process.env.PROJECT_CONFIG); +} + /** * Changes to these files require redeployment to the project backend. */ From 11ee7e33e458cd50f9587cdce622df48a395b3b1 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 10:01:48 -0700 Subject: [PATCH 05/13] single quotes? no quotes? --- .github/workflows/e2e-test.yml | 2 +- .github/workflows/test-changed-auth.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 0857860571f..fef9904da0e 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -49,7 +49,7 @@ jobs: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} TEST_ACCOUNT: ${{ secrets.TEST_ACCOUNT }} run: | - echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js + echo 'export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT' > firebase-config.js - name: Poll npm until version to test is available for install run: | echo "Polling npm for firebase@${{ github.event.client_payload.versionOrTag }}" diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index 9c2d8949b16..2063d860f86 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -64,7 +64,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG" > config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: build run: yarn build:changed auth @@ -91,7 +91,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG" > config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: build run: yarn build:changed auth @@ -117,7 +117,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG" > config/project.json + echo $PROJECT_CONFIG > config/project.json yarn npx playwright install webkit - name: build From e3e2845cef4bf44a447dbea3d75127173386317d Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 10:03:23 -0700 Subject: [PATCH 06/13] no quotes --- test.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.json diff --git a/test.json b/test.json new file mode 100644 index 00000000000..0d1db787684 --- /dev/null +++ b/test.json @@ -0,0 +1 @@ +$FIREBASE_CONFIG From 3999ce16ac41a6f4dc5bb049446a8f15508d7389 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 10:05:30 -0700 Subject: [PATCH 07/13] e2e back to double quotes --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index fef9904da0e..0857860571f 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -49,7 +49,7 @@ jobs: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} TEST_ACCOUNT: ${{ secrets.TEST_ACCOUNT }} run: | - echo 'export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT' > firebase-config.js + echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js - name: Poll npm until version to test is available for install run: | echo "Polling npm for firebase@${{ github.event.client_payload.versionOrTag }}" From 52300c93f0b7204be1d3833ddc9c97cf260d7021 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 10:18:53 -0700 Subject: [PATCH 08/13] trigger everything --- .github/workflows/e2e-test.yml | 2 ++ .github/workflows/test-all.yml | 10 ++++++---- .../workflows/test-changed-fcm-integration.yml | 4 +++- .../test-changed-firestore-integration.yml | 4 +++- .github/workflows/test-changed-firestore.yml | 15 ++++++++------- .github/workflows/test-changed-misc.yml | 4 +++- .github/workflows/test-changed.yml | 7 ++++--- packages/auth/index.ts | 2 +- scripts/ci-test/deploy-if-needed.ts | 2 ++ 9 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 0857860571f..fa1d9a03016 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -16,6 +16,8 @@ name: E2E Smoke Tests # Allows REST trigger. Currently triggered by release-cli script during a staging run. on: + #FIXME + pull_request: repository_dispatch: types: [staging-tests,canary-tests] diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 4f58e8676ac..1a278620870 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -70,6 +70,8 @@ jobs: name: (bulk) Node.js and Browser (Chrome) Tests needs: build runs-on: ubuntu-latest + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} steps: # install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo - name: install Chrome stable @@ -87,7 +89,7 @@ jobs: node-version: 22.10.0 - name: Test setup and yarn install run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: Set start timestamp env var run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV @@ -134,7 +136,7 @@ jobs: node-version: 22.10.0 - name: Test setup and yarn install run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: Set start timestamp env var run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV @@ -174,7 +176,7 @@ jobs: node-version: 22.10.0 - name: Test setup and yarn install run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: Set start timestamp env var run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV @@ -215,7 +217,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22.10.0 - - run: cp config/ci.config.json config/project.json + - run: echo $PROJECT_CONFIG > config/project.json - run: yarn - run: yarn build:${{ matrix.persistence }} working-directory: integration/firestore diff --git a/.github/workflows/test-changed-fcm-integration.yml b/.github/workflows/test-changed-fcm-integration.yml index ff6023274a4..2c67a5d0c5f 100644 --- a/.github/workflows/test-changed-fcm-integration.yml +++ b/.github/workflows/test-changed-fcm-integration.yml @@ -43,8 +43,10 @@ jobs: with: node-version: 22.10.0 - name: Test setup and yarn install + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: build run: yarn build:changed fcm-integration diff --git a/.github/workflows/test-changed-firestore-integration.yml b/.github/workflows/test-changed-firestore-integration.yml index 6841bdd47d6..e923a6b520f 100644 --- a/.github/workflows/test-changed-firestore-integration.yml +++ b/.github/workflows/test-changed-firestore-integration.yml @@ -46,8 +46,10 @@ jobs: uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd - name: Terraform Init if: ${{ fromJSON(env.run_terraform_steps) }} + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json cd packages/firestore terraform init continue-on-error: true diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index 46d36059d14..0c01e9cacfa 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -22,6 +22,7 @@ env: artifactRetentionDays: 14 # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} jobs: build: @@ -47,7 +48,7 @@ jobs: sudo apt-get install google-chrome-stable - name: Test setup and yarn install run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: build id: build @@ -99,7 +100,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Test setup and yarn install - run: cp config/ci.config.json config/project.json + run: echo $PROJECT_CONFIG > config/project.json - name: Run compat tests run: cd packages/firestore-compat && yarn run test:ci @@ -127,7 +128,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Test setup and yarn install - run: cp config/ci.config.json config/project.json + run: echo $PROJECT_CONFIG > config/project.json - name: Run tests run: cd packages/firestore && yarn run ${{ matrix.test-name }} env: @@ -186,7 +187,7 @@ jobs: - name: Unzip build artifact run: tar xf build.tar.gz - name: Test setup and yarn install - run: cp config/ci.config.json config/project.json + run: echo $PROJECT_CONFIG > config/project.json - name: Run compat tests run: cd packages/firestore-compat && xvfb-run yarn run test:ci env: @@ -214,7 +215,7 @@ jobs: with: node-version: 22.10.0 - name: Test setup and yarn install - run: cp config/ci.config.json config/project.json + run: echo $PROJECT_CONFIG > config/project.json - name: Run tests run: cd packages/firestore && xvfb-run yarn run ${{ matrix.test-name }} env: @@ -239,7 +240,7 @@ jobs: run: tar xf build.tar.gz - name: Test setup run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json npx playwright install webkit - name: Run compat tests run: cd packages/firestore-compat && yarn run test:ci @@ -270,7 +271,7 @@ jobs: node-version: 22.10.0 - name: Test setup run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json npx playwright install webkit - name: Run tests run: cd packages/firestore && yarn run ${{ matrix.test-name }} diff --git a/.github/workflows/test-changed-misc.yml b/.github/workflows/test-changed-misc.yml index ebcb2d1d366..a79519a8041 100644 --- a/.github/workflows/test-changed-misc.yml +++ b/.github/workflows/test-changed-misc.yml @@ -40,8 +40,10 @@ jobs: sudo apt-get update sudo apt-get install google-chrome-stable - name: Test setup and yarn install + env: + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: build run: yarn build:changed misc diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 948267aa9e7..775f7ba94ea 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -19,6 +19,7 @@ on: pull_request env: # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} jobs: test-chrome: @@ -41,7 +42,7 @@ jobs: sudo apt-get install google-chrome-stable - name: Test setup and yarn install run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: build run: yarn build:changed core @@ -65,7 +66,7 @@ jobs: run: npx @puppeteer/browsers install firefox@stable - name: Test setup and yarn install run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: build run: yarn build:changed core @@ -90,7 +91,7 @@ jobs: node-version: 22.10.0 - name: Test setup and yarn install run: | - cp config/ci.config.json config/project.json + echo $PROJECT_CONFIG > config/project.json yarn npx playwright install webkit - name: build diff --git a/packages/auth/index.ts b/packages/auth/index.ts index 754045bdeec..24ac96570b7 100644 --- a/packages/auth/index.ts +++ b/packages/auth/index.ts @@ -21,7 +21,7 @@ * limitations under the License. */ -//test +// FIXME test // Public types export * from './src/model/public_types'; diff --git a/scripts/ci-test/deploy-if-needed.ts b/scripts/ci-test/deploy-if-needed.ts index 90fba13e8ac..36d4fa9adc7 100644 --- a/scripts/ci-test/deploy-if-needed.ts +++ b/scripts/ci-test/deploy-if-needed.ts @@ -34,6 +34,8 @@ interface DeployOptions { let config: { projectId: string }; if (process.env.PROJECT_CONFIG) { config = JSON.parse(process.env.PROJECT_CONFIG); + // FIXME + console.log(config); } /** From bbf2a05cc4fdbc89f6f80a5a5f67c066a15e744a Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 10:18:59 -0700 Subject: [PATCH 09/13] trigger everything --- config/karma.base.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/karma.base.js b/config/karma.base.js index c49b1246ed6..887783f6147 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -20,6 +20,8 @@ const path = require('path'); const webpackTestConfig = require('./webpack.test'); const { argv } = require('yargs'); +// FIXME + function determineBrowsers() { const supportedBrowsers = ['ChromeHeadless', 'WebkitHeadless', 'Firefox']; From f08ae30fcc48b71e544a632ebf97743b8581f036 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 10:59:00 -0700 Subject: [PATCH 10/13] trigger CI From 2ea6212c727d6ada4691eae5ef86c6754ebaa24a Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 11:27:50 -0700 Subject: [PATCH 11/13] remove quotes --- .github/workflows/test-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 1a278620870..115f270b983 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -48,7 +48,7 @@ jobs: env: PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | - echo "$PROJECT_CONFIG" > config/project.json + echo $PROJECT_CONFIG > config/project.json yarn - name: yarn build run: yarn build From 9e516f5a886e90cd6d73d5d3093c38affd38b196 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Thu, 3 Apr 2025 12:33:41 -0700 Subject: [PATCH 12/13] trigger CI From dc2224e87e18582838a206e0ae9094551dfa9a7e Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 7 Apr 2025 09:31:38 -0700 Subject: [PATCH 13/13] set env var at top of test-all.yml --- .github/workflows/test-all.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 115f270b983..5425be679f8 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -28,6 +28,7 @@ env: artifactRetentionDays: 14 # Bump Node memory limit NODE_OPTIONS: "--max_old_space_size=4096" + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} jobs: build: @@ -45,8 +46,6 @@ jobs: with: node-version: 22.10.0 - name: Test setup and yarn install - env: - PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} run: | echo $PROJECT_CONFIG > config/project.json yarn @@ -70,8 +69,6 @@ jobs: name: (bulk) Node.js and Browser (Chrome) Tests needs: build runs-on: ubuntu-latest - env: - PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} steps: # install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo - name: install Chrome stable