Skip to content

Commit 89f6bf2

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix-auth-event-cancel-bug
2 parents 2895722 + 503ca1e commit 89f6bf2

File tree

186 files changed

+6400
-3854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+6400
-3854
lines changed

.github/workflows/canary-deploy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,15 @@ jobs:
7676
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
7777
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
7878
CI: true
79+
- name: Launch E2E tests workflow
80+
# Trigger e2e-test.yml
81+
run: |
82+
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
83+
VERSION_OR_TAG=`node -e "${VERSION_SCRIPT}"`
84+
OSS_BOT_GITHUB_TOKEN=${{ secrets.OSS_BOT_GITHUB_TOKEN }}
85+
curl -X POST \
86+
-H "Content-Type:application/json" \
87+
-H "Accept:application/vnd.github.v3+json" \
88+
-H "Authorization:Bearer $OSS_BOT_GITHUB_TOKEN" \
89+
-d "{\"event_type\":\"canary-tests\", \"client_payload\":{\"versionOrTag\":\"$VERSION_OR_TAG\"}}" \
90+
https://api.github.com/repos/firebase/firebase-js-sdk/dispatches

.github/workflows/e2e-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: E2E Smoke Tests
33
# Allows REST trigger. Currently triggered by release-cli script during a staging run.
44
on:
55
repository_dispatch:
6-
types: [staging-tests]
6+
types: [staging-tests,canary-tests]
77

88
jobs:
99
test:
@@ -62,6 +62,8 @@ jobs:
6262
- name: Tests succeeded
6363
if: success()
6464
run: node scripts/ci/notify-test-result.js success
65+
# we don't want THIS step erroring to trigger the failure notification
66+
continue-on-error: true
6567
env:
6668
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
6769
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}

.github/workflows/test-all.yml

Lines changed: 172 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
env:
88
# make chromedriver detect installed Chrome version and download the corresponding driver
99
DETECT_CHROMEDRIVER_VERSION: true
10+
artifactRetentionDays: 14
1011

1112
jobs:
12-
test:
13-
name: Node.js and Browser (Chrome) Tests
13+
build:
14+
name: Build the SDK
1415
runs-on: ubuntu-latest
15-
1616
steps:
17-
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
17+
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
18+
# setting up the repo. This must be done to build and execute Auth properly.
1819
- name: install Chrome stable
1920
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
2021
# Temporary: Auth team will explore what's going wrong with the auth tests.
@@ -36,11 +37,99 @@ jobs:
3637
yarn
3738
- name: yarn build
3839
run: yarn build
40+
- name: Archive build
41+
if: ${{ !cancelled() }}
42+
run: |
43+
tar -cf build.tar .
44+
gzip build.tar
45+
- name: Upload build archive
46+
if: ${{ !cancelled() }}
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: build.tar.gz
50+
path: build.tar.gz
51+
retention-days: ${{ env.artifactRetentionDays }}
52+
53+
# Auth and Firestore are built and executed in their own jobs in an attempt to reduce flakiness.
54+
test-the-rest:
55+
name: (bulk) Node.js and Browser (Chrome) Tests
56+
needs: build
57+
runs-on: ubuntu-latest
58+
steps:
59+
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
60+
- name: install Chrome stable
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install google-chrome-stable
64+
- name: Download build archive
65+
uses: actions/download-artifact@v3
66+
with:
67+
name: build.tar.gz
68+
- name: Unzip build artifact
69+
run: tar xf build.tar.gz
70+
- name: Set up Node (16)
71+
uses: actions/setup-node@v3
72+
with:
73+
node-version: 16.x
74+
- name: Bump Node memory limit
75+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
76+
- name: Test setup and yarn install
77+
run: |
78+
cp config/ci.config.json config/project.json
79+
yarn
80+
- name: Set start timestamp env var
81+
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
82+
- name: Run unit tests
83+
# Ignore auth and firestore since they're handled in their own separate jobs.
84+
run: |
85+
xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' --concurrency 4 test:ci
86+
node scripts/print_test_logs.js
87+
env:
88+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
89+
- name: Generate coverage file
90+
run: yarn ci:coverage
91+
- name: Run coverage
92+
uses: coverallsapp/github-action@master
93+
with:
94+
github-token: ${{ secrets.GITHUB_TOKEN }}
95+
path-to-lcov: ./lcov-all.info
96+
continue-on-error: true
97+
98+
test-auth:
99+
name: (Auth) Node.js and Browser (Chrome) Tests
100+
needs: build
101+
runs-on: ubuntu-latest
102+
steps:
103+
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
104+
- name: install Chrome stable
105+
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
106+
# Temporary: Auth team will explore what's going wrong with the auth tests.
107+
run: |
108+
sudo apt-get update
109+
sudo apt-get install wget
110+
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_110.0.5481.177-1_amd64.deb
111+
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
112+
- name: Download build archive
113+
uses: actions/download-artifact@v3
114+
with:
115+
name: build.tar.gz
116+
- name: Unzip build artifact
117+
run: tar xf build.tar.gz
118+
- name: Set up Node (16)
119+
uses: actions/setup-node@v3
120+
with:
121+
node-version: 16.x
122+
- name: Bump Node memory limit
123+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
124+
- name: Test setup and yarn install
125+
run: |
126+
cp config/ci.config.json config/project.json
127+
yarn
39128
- name: Set start timestamp env var
40129
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
41130
- name: Run unit tests
42131
run: |
43-
xvfb-run yarn test:ci
132+
xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/auth*'
44133
node scripts/print_test_logs.js
45134
env:
46135
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
@@ -52,3 +141,81 @@ jobs:
52141
github-token: ${{ secrets.GITHUB_TOKEN }}
53142
path-to-lcov: ./lcov-all.info
54143
continue-on-error: true
144+
145+
test-firestore:
146+
name: (Firestore) Node.js and Browser (Chrome) Tests
147+
needs: build
148+
runs-on: ubuntu-latest
149+
steps:
150+
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
151+
- name: install Chrome stable
152+
run: |
153+
sudo apt-get update
154+
sudo apt-get install google-chrome-stable
155+
- name: Download build archive
156+
uses: actions/download-artifact@v3
157+
with:
158+
name: build.tar.gz
159+
- name: Unzip build artifact
160+
run: tar xf build.tar.gz
161+
- name: Set up Node (16)
162+
uses: actions/setup-node@v3
163+
with:
164+
node-version: 16.x
165+
- name: Bump Node memory limit
166+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
167+
- name: Test setup and yarn install
168+
run: |
169+
cp config/ci.config.json config/project.json
170+
yarn
171+
- name: Set start timestamp env var
172+
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
173+
- name: Run unit tests
174+
run: |
175+
xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/firestore*'
176+
node scripts/print_test_logs.js
177+
env:
178+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
179+
- name: Generate coverage file
180+
run: yarn ci:coverage
181+
- name: Run coverage
182+
uses: coverallsapp/github-action@master
183+
with:
184+
github-token: ${{ secrets.GITHUB_TOKEN }}
185+
path-to-lcov: ./lcov-all.info
186+
continue-on-error: true
187+
188+
test-firestore-integration:
189+
name: Firestore Integration Tests
190+
needs: build
191+
runs-on: ubuntu-latest
192+
steps:
193+
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
194+
- name: install Chrome stable
195+
run: |
196+
sudo apt-get update
197+
sudo apt-get install google-chrome-stable
198+
- name: Download build archive
199+
uses: actions/download-artifact@v3
200+
with:
201+
name: build.tar.gz
202+
- name: Unzip build artifact
203+
run: tar xf build.tar.gz
204+
- name: Set up Node (16)
205+
uses: actions/setup-node@v3
206+
with:
207+
node-version: 16.x
208+
- name: Bump Node memory limit
209+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
210+
- name: Test setup and yarn install
211+
run: |
212+
cp config/ci.config.json config/project.json
213+
yarn
214+
- name: Set start timestamp env var
215+
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
216+
- name: Run unit tests
217+
run: |
218+
xvfb-run yarn lerna run --concurrency 4 test:ci --scope firebase-firestore-integration-test
219+
node scripts/print_test_logs.js
220+
env:
221+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}

common/api-review/auth.api.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export function applyActionCode(auth: Auth, oobCode: string): Promise<void>;
8181
// @public
8282
export interface Auth {
8383
readonly app: FirebaseApp;
84+
authStateReady(): Promise<void>;
8485
beforeAuthStateChanged(callback: (user: User | null) => void | Promise<void>, onAbort?: () => void): Unsubscribe;
8586
readonly config: Config;
8687
readonly currentUser: User | null;
@@ -550,7 +551,7 @@ export function parseActionCodeURL(link: string): ActionCodeURL | null;
550551

551552
// @public
552553
export interface ParsedToken {
553-
[key: string]: any;
554+
[key: string]: unknown;
554555
'auth_time'?: string;
555556
'exp'?: string;
556557
'firebase'?: {
@@ -681,7 +682,7 @@ export interface RecaptchaParameters {
681682
//
682683
// @public
683684
export class RecaptchaVerifier implements ApplicationVerifierInternal {
684-
constructor(containerOrId: HTMLElement | string, parameters: RecaptchaParameters, authExtern: Auth);
685+
constructor(authExtern: Auth, containerOrId: HTMLElement | string, parameters?: RecaptchaParameters);
685686
clear(): void;
686687
// Warning: (ae-forgotten-export) The symbol "ReCaptchaLoader" needs to be exported by the entry point index.d.ts
687688
//

common/api-review/database.api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class DataSnapshot {
3333
child(path: string): DataSnapshot;
3434
exists(): boolean;
3535
exportVal(): any;
36-
forEach(action: (child: DataSnapshot) => boolean | void): boolean;
36+
forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean;
3737
hasChild(path: string): boolean;
3838
hasChildren(): boolean;
3939
get key(): string | null;
@@ -85,6 +85,12 @@ export function goOnline(db: Database): void;
8585
// @public
8686
export function increment(delta: number): object;
8787

88+
// @public
89+
export interface IteratedDataSnapshot extends DataSnapshot {
90+
// (undocumented)
91+
key: string;
92+
}
93+
8894
// @public
8995
export function limitToFirst(limit: number): QueryConstraint;
9096

0 commit comments

Comments
 (0)