Skip to content

Commit 8d9e9cb

Browse files
committed
[Danger] Improve the lookup for previous -> current build to also include the environment
1 parent 56379cb commit 8d9e9cb

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

dangerfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ const {markdown, danger} = require('danger');
1111
const fetch = require('node-fetch');
1212

1313
const {generateResultsArray} = require('./scripts/rollup/stats');
14-
const currentBuildResults = require('./scripts/rollup/results.json');
14+
const {readFileSync} = require('fs');
15+
16+
const currentBuildResults = JSON.parse(
17+
readFileSync('./scripts/rollup/results.json')
18+
);
1519

1620
/**
1721
* Generates a Markdown table

scripts/circleci/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
# accurate.
88
curl -o scripts/rollup/results.json http://react.zpao.com/builds/master/latest/results.json
99

10-
yarn build
10+
yarn build --extract-errors
1111
# Note: since we run the full build including extracting error codes,
1212
# it is important that we *don't* reset the change to `scripts/error-codes/codes.json`.
1313
# When production bundle tests run later, it needs to be available.

scripts/rollup/stats.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function generateResultsArray(current, prevResults) {
4646
return current.bundleSizes
4747
.map(result => {
4848
const prev = prevResults.bundleSizes.filter(
49-
res => res.filename === result.filename
49+
res =>
50+
res.filename === result.filename &&
51+
res.bundleType === result.bundleType
5052
)[0];
5153
if (result === prev) {
5254
// We didn't rebuild this bundle.

0 commit comments

Comments
 (0)