Skip to content

Commit 07c454b

Browse files
committed
OSS CI: skip bundle size reporting for *-stable branches
Summary: The size information is currently not used for release branches. Further, the CI step failed because there is no PR associated with commits in RC branch. This commit fixed that error by skipping the entire work altogether. Sample error: https://app.circleci.com/pipelines/github/facebook/react-native/10161/workflows/3625732a-531f-435d-83b6-1dbc638e1bab/jobs/215405/parallel-runs/0/steps/0-125 In theory, we should be storing RC bundle sizes as well, but the current backing Firebase DB has not been configured with proper index: ``` Error [FirebaseError]: The query requires an index. ... ``` Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D31705912 fbshipit-source-id: 26757174f7937cb23d8e55066b833ae15ec011e3
1 parent ed8e5e5 commit 07c454b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bots/report-bundle-size.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ async function reportSizeStats(stats, replacePattern) {
4747
);
4848
const collection = datastore.getBinarySizesCollection(store);
4949

50+
// Collect the current sizes for main branch only.
5051
if (GITHUB_REF === 'main') {
5152
// Ensure we only store numbers greater than zero.
5253
const validatedStats = Object.keys(stats).reduce((validated, key) => {
@@ -65,6 +66,8 @@ async function reportSizeStats(stats, replacePattern) {
6566
validatedStats,
6667
);
6768
}
69+
} else if (GITHUB_REF.endsWith('-stable')) {
70+
console.log(`Skipping bundle size reporting for branch: ${GITHUB_REF}`);
6871
} else {
6972
const document = await datastore.getLatestDocument(collection);
7073

0 commit comments

Comments
 (0)