From 07c454b2d22ad691b16715e7a4e5a54d8f7bc2b0 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Fri, 15 Oct 2021 17:29:04 -0700 Subject: [PATCH] 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 --- bots/report-bundle-size.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bots/report-bundle-size.js b/bots/report-bundle-size.js index 5d422483909..75cc461c150 100644 --- a/bots/report-bundle-size.js +++ b/bots/report-bundle-size.js @@ -47,6 +47,7 @@ async function reportSizeStats(stats, replacePattern) { ); const collection = datastore.getBinarySizesCollection(store); + // Collect the current sizes for main branch only. if (GITHUB_REF === 'main') { // Ensure we only store numbers greater than zero. const validatedStats = Object.keys(stats).reduce((validated, key) => { @@ -65,6 +66,8 @@ async function reportSizeStats(stats, replacePattern) { validatedStats, ); } + } else if (GITHUB_REF.endsWith('-stable')) { + console.log(`Skipping bundle size reporting for branch: ${GITHUB_REF}`); } else { const document = await datastore.getLatestDocument(collection);