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

Update sizebot to new workflow #20719

Merged
merged 7 commits into from
Feb 3, 2021

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Feb 2, 2021

Replaces the two separate sizebot jobs (one for each channel, stable and experimental) with a single combined job that outputs size information for all bundles in a single GitHub comment.

I didn't attempt to simplify the output at all, but we should. I think what I would do is remove our custom Rollup sizes plugin, and read the sizes from the filesystem instead. We would lose some information about the build configuration used to generate each artifact, but that can be inferred from the filepath. For example, the filepath fb-www/ReactDOM-dev.classic.js already tells us everything we need to know about the artifact. Leaving this for a follow up.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 2, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 2, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@sizebot
Copy link

sizebot commented Feb 2, 2021

Warnings
⚠️ Failed to read build artifacts. It's possible a build configuration has changed upstream. Try pulling the latest changes from the main branch.

Generated by 🚫 dangerJS against f24da1c

@acdlite acdlite force-pushed the update-sizebot-to-new-workflow branch 6 times, most recently from ba4aafb to 72b4a92 Compare February 3, 2021 01:54
@facebook facebook deleted a comment from sizebot Feb 3, 2021
@acdlite acdlite force-pushed the update-sizebot-to-new-workflow branch 8 times, most recently from 8a3614c to bffa377 Compare February 3, 2021 03:13
@acdlite acdlite changed the title [WIP] Update sizebot to new workflow Update sizebot to new workflow Feb 3, 2021
@acdlite acdlite marked this pull request as ready for review February 3, 2021 03:22
@facebook facebook deleted a comment from sizebot Feb 3, 2021
- run:
name: Download artifacts for base revision
# TODO: Commit sha is hardcoded until required changes land in main
# branch. Once they do, replace with `merge-base HEAD origin/master`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll un-hardcode the base sha before landing. Need to land in two stages.

@acdlite acdlite force-pushed the update-sizebot-to-new-workflow branch 2 times, most recently from ca6bd97 to 2242ed6 Compare February 3, 2021 03:39
@facebook facebook deleted a comment from sizebot Feb 3, 2021
git fetch origin master
echo "$(git merge-base HEAD origin/master)"
cd ./scripts/release && yarn && cd ../../
scripts/release/download-experimental-build.js --commit=4783999
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So long as we remember to change this.

Alternative to parsing an arbitrary package's version number, or
its `build-info.json`.
I think this only reason we needed this was to support passing any
job id to `--build`, instead of requiring the `process_artifacts` job.
And to do that you needed to use the workflows API endpoint, which
requires an API token.

But now that the `--commit` argument exists and automatically finds the
correct job id, we can just use that.
Uses download-experimental script and places the base artifacts into
a top-level folder.
@acdlite acdlite force-pushed the update-sizebot-to-new-workflow branch from 2242ed6 to 9d0ee0b Compare February 3, 2021 16:20
Replaces the two separate sizebot jobs (one for each channel, stable and
experimental) with a single combined job that outputs size information
for all bundles in a single GitHub comment.

I didn't attempt to simplify the output at all, but we should. I think
what I would do is remove our custom Rollup sizes plugin, and read the
sizes from the filesystem instead. We would lose some information about
the build configuration used to generate each artifact, but that can be
inferred from the filepath. For example, the filepath
`fb-www/ReactDOM-dev.classic.js` already tells us everything we need to
know about the artifact. Leaving this for a follow up.
The download script will poll the CircleCI endpoint until the build job
is complete; it should also poll the GitHub status endpoint if the
build job hasn't been spawned yet.
@facebook facebook deleted a comment from sizebot Feb 3, 2021
@acdlite acdlite merged commit b936ab6 into facebook:master Feb 3, 2021
@gaearon
Copy link
Collaborator

gaearon commented Feb 5, 2021

I think something is wrong.

#20746 is supposed to increase the size, but it shows a decrease.

The summary (0% change) also doesn't match what the table is reporting.

koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
* build-combined: Fix bundle sizes path

* Output COMMIT_SHA in build directory

Alternative to parsing an arbitrary package's version number, or
its `build-info.json`.

* Remove CircleCI environment variable requirement

I think this only reason we needed this was to support passing any
job id to `--build`, instead of requiring the `process_artifacts` job.
And to do that you needed to use the workflows API endpoint, which
requires an API token.

But now that the `--commit` argument exists and automatically finds the
correct job id, we can just use that.

* Add CI job that gets base artifacts

Uses download-experimental script and places the base artifacts into
a top-level folder.

* Migrate sizebot to combined workflow

Replaces the two separate sizebot jobs (one for each channel, stable and
experimental) with a single combined job that outputs size information
for all bundles in a single GitHub comment.

I didn't attempt to simplify the output at all, but we should. I think
what I would do is remove our custom Rollup sizes plugin, and read the
sizes from the filesystem instead. We would lose some information about
the build configuration used to generate each artifact, but that can be
inferred from the filepath. For example, the filepath
`fb-www/ReactDOM-dev.classic.js` already tells us everything we need to
know about the artifact. Leaving this for a follow up.

* Move GitHub status check inside retry loop

The download script will poll the CircleCI endpoint until the build job
is complete; it should also poll the GitHub status endpoint if the
build job hasn't been spawned yet.

* Only run get_base_build on main branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants