Skip to content

Commit f0d08e8

Browse files
committed
Update sizbot to pull artifacts from public mirror
We can't use the normal download-build script in sizebot because it depends on the CircleCI artifacts API, which was recently changed to require authorization. And we can't pass an authorization token without possibly leaking it to the public, since we run sizebot on PRs from external contributors. As a temporary workaround, this job will pull the artifacts from a public mirror that I set up. But we should find some other solution so we don't have to maintain the mirror.
1 parent a013cc9 commit f0d08e8

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

.circleci/config.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,19 @@ jobs:
126126
docker: *docker
127127
environment: *environment
128128
steps:
129-
- checkout
130-
- run: yarn workspaces info | head -n -1 > workspace_info.txt
131-
- *restore_node_modules
132129
- run:
133130
name: Download artifacts for base revision
131+
# TODO: We can't use the normal download-build script here because it
132+
# depends on the CircleCI artifacts API, which was recently changed to
133+
# require authorization. And we can't pass an authorization token
134+
# without possibly leaking it to the public, since we run sizebot on
135+
# PRs from external contributors. As a temporary workaround, this job
136+
# will pull the artifacts from a public mirror that I set up. But we
137+
# should find some other solution so we don't have to maintain
138+
# the mirror.
134139
command: |
135-
git fetch origin main
136-
cd ./scripts/release && yarn && cd ../../
137-
scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main)
138-
mv ./build ./base-build
139-
- run:
140-
# TODO: The `download-experimental-build` script copies the npm
141-
# packages into the `node_modules` directory. This is a historical
142-
# quirk of how the release script works. Let's pretend they
143-
# don't exist.
144-
name: Delete extraneous files
145-
command: rm -rf ./base-build/node_modules
140+
curl -L --retry 60 --retry-delay 10 --retry-max-time 600 https://react-builds.vercel.app/api/commits/$(git merge-base HEAD origin/main)/artifacts/build.tgz | tar -xz
141+
mv ./build ./base-build
146142
147143
- persist_to_workspace:
148144
root: .

0 commit comments

Comments
 (0)