Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sizebot not working due to missing auth token #26423

Merged
merged 1 commit into from
Mar 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,33 @@ jobs:
- setup_node_modules
- run:
name: Download artifacts for base revision
# TODO: The download-experimental-build.js script works by fetching
# artifacts from CI. CircleCI recently updated this endpoint to
# require an auth token. This is a problem for PR branches, where
# sizebot needs to run, because we don't want to leak the token to
# arbitrary code written by an outside contributor.
#
# This only affects PR branches. CI workflows that run on the main
# branch are allowed to access environment variables, because only those
# with push access can land code in main.
#
# As a temporary workaround, we'll fetch the assets from a mirror.
# Need to figure out a longer term solution for this.
#
# Original code
#
# command: |
# git fetch origin main
# cd ./scripts/release && yarn && cd ../../
# scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main) --allowBrokenCI
# mv ./build ./base-build
#
# Workaround. Fetch the artifacts from react-builds.vercel.app. This
# is the same app that hosts the sizebot diff previews.
command: |
git fetch origin main
cd ./scripts/release && yarn && cd ../../
scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main) --allowBrokenCI
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
mv ./build ./base-build

- run:
# TODO: The `download-experimental-build` script copies the npm
# packages into the `node_modules` directory. This is a historical
Expand Down