Skip to content

Pull project config from Github secret #8894

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

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .github/workflows/deploy-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -46,7 +47,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: yarn build
run: yarn build
Expand Down Expand Up @@ -85,7 +86,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
Expand Down Expand Up @@ -132,7 +133,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
Expand Down Expand Up @@ -172,7 +173,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
Expand Down Expand Up @@ -213,7 +214,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
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/test-changed-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-changed-fcm-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-changed-firestore-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/test-changed-firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-changed-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions config/karma.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down
2 changes: 2 additions & 0 deletions packages/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* limitations under the License.
*/

// FIXME test

// Public types
export * from './src/model/public_types';

Expand Down
8 changes: 7 additions & 1 deletion scripts/ci-test/deploy-if-needed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -32,6 +31,13 @@ interface DeployOptions {
only?: string;
}

let config: { projectId: string };
if (process.env.PROJECT_CONFIG) {
config = JSON.parse(process.env.PROJECT_CONFIG);
// FIXME
console.log(config);
}

/**
* Changes to these files require redeployment to the project backend.
*/
Expand Down
1 change: 1 addition & 0 deletions test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$FIREBASE_CONFIG
Loading