Commit Graph

99 Commits

Author SHA1 Message Date
Luna Ruan f534cc6ea4
[DevTools] Add --replaceBuild option to Older React Builds Download Script (#24621)
This PR adds a `--replaceBuild` option to the script that downloads older React version builds. If this flag is true, we will replace the contents of the `build` folder with the contents of the `build-regression` folder and remove the `build-regression` folder after, which was the original behavior.

However, for e2e tests, we need both the original build (for DevTools) and the new build (for the React Apps), so we need both the `build` and the `build-regression` folders. Not adding the `--replaceBuild` option will do this.

This PR also modifies the circle CI config to reflect this change.
2022-05-31 12:23:44 -04:00
Luna Ruan a2505792ed
[DevTools] Add CircleCI Chron Job For DevTools Regression Tests (#24601)
This PR adds an hourly chron job on Circle CI that runs regression tests on the most recent DevTools build for React v16.0, v16.5, v16.8 v17.0 and v18.0.
2022-05-24 09:46:22 -04:00
Andrew Clark a412d787e9
Remove dependency on build artifacts mirror (#24575)
This reverts #24106.

There was a regression in CircleCI's artifacts API recently where you
could no longer access artifacts without an authorization token. This
broke our size reporting CI job because we can't use an authorization
token on external PRs without potentially leaking it. As a temporary
workaround, I changed the size reporting job to use a public mirror of
our build artifacts.

The CircleCI API has since been fixed to no longer require
authorization, so we can revert the workaround.
2022-05-18 11:13:19 -04:00
Andrew Clark ba5dc6ccde
Add authorization header to artifacts request (#24106)
* Add authorization header to artifacts request

CircleCI's artifacts API was updated; it now errors unless you're
logged in. This affects any of our workflows that download
build artifacts.

To fix, I added an authorization header to the request.

* 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.
2022-03-15 23:10:23 -04:00
dan cd4eb116cf
Revert "update node.js version for CI (#23236)" (#23239)
This reverts commit 1d7728bf9d.
2022-02-07 03:55:57 +00:00
sunderls 1d7728bf9d
update node.js version for CI (#23236) 2022-02-07 01:10:37 +00:00
Brian Vaughn 9724e18004
Run DevTools e2e tests on Circle CI (#23019) 2022-01-04 10:28:03 -05:00
Andrew Clark 29d2bef9f5
Bump beta -> rc 2021-12-08 10:51:41 -05:00
Andrew Clark 06f403481f
Add CI job to check npm dependencies (#22881)
Checks that if one React package depends on another, the current
version satisfies the given dependency range.

That way we don't forget to bump dependencies when we release a
new version.
2021-12-07 23:09:00 -08:00
Andrew Clark a52d76b877
Bump 18 from alpha to beta (#22766) 2021-11-15 10:26:30 -08:00
Andrew Clark 9db8713f9d
Pin CI to Node 14 (#22665)
CI starting running Node 16, which breaks some of our tests because
the error message text for undefined property access has changed.

We should pin to Node 14 until we are able to update the messages.
2021-10-31 18:01:39 -07:00
Andrew Clark 7034408ff7
Follow-up improvements to error code extraction infra (#22516)
* Output FIXME during build for unminified errors

The invariant Babel transform used to output a FIXME comment if it
could not find a matching error code. This could happen if there were
a configuration mistake that caused an unminified message to
slip through.

Linting the compiled bundles is the most reliable way to do it because
there's not a one-to-one mapping between source modules and bundles. For
example, the same source module may appear in multiple bundles, some
which are minified and others which aren't.

This updates the transform to output the same messages for Error calls.

The source lint rule is still useful for catching mistakes during
development, to prompt you to update the error codes map before pushing
the PR to CI.

* Don't run error transform in development

We used to run the error transform in both production and development,
because in development it was used to convert `invariant` calls into
throw statements.

Now that don't use `invariant` anymore, we only have to run the
transform for production builds.

* Add ! to FIXME comment so Closure doesn't strip it

Don't love this solution because Closure could change this heuristic,
or we could switch to a differnt compiler that doesn't support it. But
it works.

Could add a bundle that contains an unminified error solely for the
purpose of testing it, but that seems like overkill.

* Alternate extract-errors that scrapes artifacts

The build script outputs a special FIXME comment when it fails to minify
an error message. CI will detect these comments and fail the workflow.

The comments also include the expected error message. So I added an
alternate extract-errors that scrapes unminified messages from the
build artifacts and updates `codes.json`.

This is nice because it works on partial builds. And you can also run it
after the fact, instead of needing build all over again.

* Disable error minification in more bundles

Not worth it because the number of errors does not outweight the size
of the formatProdErrorMessage runtime.

* Run extract-errors script in CI

The lint_build job already checks for unminified errors, but the output
isn't super helpful.

Instead I've added a new job that runs the extract-errors script and
fails the build if `codes.json` changes. It also outputs the expected
diff so you can easily see which messages were missing from the map.

* Replace old extract-errors script with new one

Deletes the old extract-errors in favor of extract-errors2
2021-10-31 15:37:32 -07:00
Andrew Clark 8fcfdfff7e
Scrape warning messages in CI (#22393)
There's a downstream workflow that runs the `print-warnings` command. We
can make it faster by scraping the warnings in CI and storing the
result as a build artifact.
2021-09-21 19:03:01 -07:00
Andrew Clark ba07042c86
Fix sizebot mistakenly detecting deleted files (#22394) 2021-09-21 18:55:47 -07:00
Andrew Clark cf07c3df12
Delete all but one `build2` reference (#22391)
This removes all the remaining references to the `build2` directory
except for the CI job that stores the artifacts. We'll keep the
`build2` artifact until downstream scripts are migrated to `build`.
2021-09-21 13:15:41 -07:00
Andrew Clark 2375670a91
Delete unused CI jobs
These were replaced by the `build_combined` job.
2021-09-21 15:06:09 -04:00
Andrew Clark e3c9cd9f41
Add COMMIT_SHA to build directory 2021-09-21 13:41:58 -04:00
Andrew Clark 0c81d347b6 Write artifacts to `build` instead of `build2`
Now that all the CI jobs have been migrated to the new build script,
we can start renaming the `build2` directory to `build`.

Since there are lots of scripts that reference `build2`, including
downstream scripts that live outside this repo, I'm going to keep
the `build2` directory around as a copy of `build`.

Then once all the references are updated, I will delete the copy.
2021-09-21 12:23:48 -04:00
Andrew Clark baff3f2005
Move build_devtools_and_process_artifacts (#22388)
This is the last CI job that needs to be migrated to the new workflow.
2021-09-21 08:51:51 -07:00
Andrew Clark 7c6049695f
Move lint job to new, combined CI workflow (#22386)
* Move lint job to new, combined CI workflow

Moves the lint job our new, combined CI workflow.

After this, there is only one job remaining to be migrated. Then we
can delete the old workflow and build script.

* Remove "stable" CI workflow

This workflow is now empty so we can remove it
2021-09-21 08:16:26 -07:00
Andrew Clark fc57432966
Move DOM fixtures test job to main CI workflow (#22385)
Moves the RELEASE_CHANNEL_stable_yarn_test_dom_fixtures job to our new,
combined CI workflow.

After this, there are only two jobs remaining to be migrated. Then we
can delete the old workflow and build script.
2021-09-21 08:00:28 -07:00
Brian Vaughn f4161c3ec7
[DRAFT] Import scheduling profiler into DevTools Profiler (#21897) 2021-07-22 13:58:57 -04:00
Andrew Clark 81346764bb
Run persistent tests in more configurations in CI (#21880)
I noticed that `enableSuspenseLayoutEffectSemantics` is not fully
implemented in persistent mode. I believe this was an oversight
because we don't have a CI job that runs tests in persistent mode and
with experimental flags enabled.

This adds additional test configurations to the CI job so we don't miss
stuff like this again. It doesn't fix the failing tests — I'll address
that separately.
2021-07-14 08:40:20 -07:00
Brian Vaughn 6bf111772a
Install nested packages from Yarn cache before running build tests (#21779) 2021-07-01 11:37:56 -04:00
Brian Vaughn d483463bc8
Updated scripts and config to replace "master" with "main" branch (#21768) 2021-06-29 14:26:24 -04:00
Andrew Clark 6bbe7c3446 Remove space from tag arguments 2021-06-08 11:40:34 -04:00
Andrew Clark 48a11a3efc
Update next React version (#21647)
This does not mean that a release of 18.0 is imminent, only that the
main branch includes breaking changes.

Also updates the versioning scheme of the `@next` channel to include
the upcoming semver number, as well as the word "alpha" to indicate the
stability of the release.

- Before:       0.0.0-e0d9b28999
- After:        18.0.0-alpha-e0d9b28999
2021-06-08 08:26:22 -07:00
Andrew Clark b770f75005
lint-build: Infer format from artifact filename (#21489)
Uses the layout of the build artifact directory to infer the format
of a given file, and which lint rules to apply.

This has the effect of decoupling the lint build job from the existing
Rollup script, so that if we ever add additional post-processing, or
if we replace Rollup, it will still work.

But the immediate motivation is to replace the separate "stable" and
"experimental" lint-build jobs with a single combined job.
2021-05-12 10:14:45 -07:00
Andrew Clark dd8552ae0d
yarn test: Default to bleeding edge configuration (#21238)
My personal workflow is to develop against the www-modern release
channel, with the variant flags enabled, because it encompasses the
largest set of features. Then I rely on CI to run the tests against
all the other configurations.

So in practice, I almost always run

```
yarn test -r=www-modern --variant TEST_FILE
```

instead of

```
yarn test TEST_FILE
```

So, I've updated the `yarn test` command to use those options
by default.
2021-04-12 09:49:26 -07:00
Andrew Clark 9e8f3c8955
[CI] Use constant commit sha (#20828)
When running the publish workflow, either via the command line or
via the daily cron job, we should use a constant SHA instead of
whatever happens to be at the head of the main branch at the time the
workflow is run.

The difference is subtle: currently, the SHA is read at runtime,
each time the workflow is run. With this change, the SHA is read right
before the workflow is created and passed in as a constant parameter.

In practical terms, this means if a workflow is re-run via the CircleCI
web UI, it will always re-run using the same commit SHA as the original
workflow, instead of fetching the latest SHA from GitHub, which may
have changed.

Also avoids a race condition where the head SHA changes in between the
Next publish job and the Experimental publish job.
2021-02-16 08:31:24 -08:00
Andrew Clark 6f8843837c
[CI] Publish to release channels sequentially (#20827)
npm will sometimes fail if you try to concurrently publish two different
versions of the same package, even if they use different dist tags.

So instead of publishing to the Next and Experimental channels
simultaneously, we'll do them one after the other.

If we did want to speed up these publish workflows, we could paralellize
by package instead of by release channel.
2021-02-15 22:04:13 -08:00
Andrew Clark b593a6f778
CI job to check that forks are in sync (#20795)
We don't always keep the reconciler forks in sync (otherwise it we
wouldn't have forked it) but during periods when they are meant to be in
sync, we use this job to confirm there are no differences.
2021-02-10 16:09:20 -08:00
Andrew Clark 9e9be6c6b3
Parallelize Flow in CI (#20794)
* Parallelize Flow in CI

We added more host configs recently, and we run all the checks in
sequence, so sometimes Flow ends up being the slowest CI job.

This splits the job across multiple processes.

* Fix environment variable typo

Co-authored-by: Ricky <rickhanlonii@gmail.com>

Co-authored-by: Ricky <rickhanlonii@gmail.com>
2021-02-10 17:54:58 -06:00
Andrew Clark a703c3f7e8 Fix cron syntax
Let's try this again?
2021-02-04 10:07:39 -06:00
Andrew Clark 365080f4f5 Autopublish prereleases using head of main branch
Instead of using pipeline parameter. Fixes copypasta from the other
workflow, which accepts the SHA parameter via an API call.
2021-02-04 09:34:12 -06:00
Andrew Clark f58ad2ad8e
Auto-publish prereleases every weekday (#20733)
Sets up a cron trigger to publish prereleases at 16:00 UTC (11 am
Eastern, 8 am Pacific) on every weekday (Monday through Friday).
2021-02-03 21:08:34 -08:00
Andrew Clark c64d6d21be
Implement CI job that publishes prereleases (#20732)
PR #20728 added a command to initiate a prerelease using CI, but it left
the publish job unimplemented. This fills in the publish job.

Uses an npm automation token for authorization, which bypasses the need
for a one-time password. The token is configured via CircleCI's
environment variable panel.

Currently, it will always publish the head of the main branch. If the
head has already been published, it will exit gracefully.

It does not yet support publishing arbitrary commits, though we could
easily add that. I don't know how important that use case is, because
for PR branches, you can use CodeSandbox CI instead. Or as a last
resort, run the publish script locally.

Always publishing from main is nice because it further incentivizes us
to keep main in a releasable state. It also takes the guesswork out of
publishing a prerelease that's in a broken state: as long as we don't
merge broken PRs, we're fine.
2021-02-03 20:57:31 -08:00
Andrew Clark 85f489a129
Add publish workflow, triggerable via API request (#20726)
Adds a new CircleCI workflow, which I will use to publish prereleases
(`next` and `experimental`) for a given commit.

The CircleCI API doesn't yet support triggering a specific workflow, but
it does support triggering a pipeline. So as a workaround you can
triggger the entire pipeline and use parameters to disable everything
except the workflow you want. CircleCI recommends this workaround here:
https://support.circleci.com/hc/en-us/articles/360050351292-How-to-trigger-a-workflow-via-CircleCI-API-v2-

Eventually we can set this workflow to trigger on a cron schedule (once
per week, for example).
2021-02-03 12:17:29 -08:00
Andrew Clark 0935a1db3d
Delete consolidateBundleSizes script (#20724)
This was ported to the new workflow by #20720
2021-02-03 08:45:29 -08:00
Andrew Clark b936ab660a
Update sizebot to new workflow (#20719)
* 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
2021-02-03 08:29:51 -08:00
Andrew Clark e6ed2bcf42
Update package.json versions as part of build step (#20579)
Fixes issue in the new build workflow where the experimental packages do
not include "experimental" in the version string. This was because the
previous approach relied on the RELEASE_CHANNEL environment variable,
which we are no longer setting in the outer CI job, since we use the
same job to build both channels. To solve, I moved the version
post-processing into the build script itself.

Only affects the new build workflow. Old workflow is unchanged.

Longer term, I would like to remove version numbers from the source
entirely, including the package.jsons. We should use a placeholder
instead; that's mostly how it already works, since the release script
swaps out the versions before we publish to stable.
2021-01-13 09:54:03 -08:00
Andrew Clark b99ac3d6df
Migrate remaining tests to combined workflow (#20577) 2021-01-12 10:58:49 -08:00
Andrew Clark 9a6a41d108
Migrate build tests to combined workflow (#20574) 2021-01-12 09:50:38 -08:00
Andrew Clark eb0fb38230
Build stable and experimental with same command (#20573)
The goal is to simplify our CI pipeline so that all configurations
are built and tested in a single workflow.

As a first step, this adds a new build script entry point that builds
both the experimental and stable release channels into a single
artifacts directory.

The script works by wrapping the existing build script (which only
builds a single release channel at a time), then post-processing the
results to match the desired filesystem layout. A future version of the
build script would output the files directly without post-processing.

Because many parts of our infra depend on the existing layout of the
build artifacts directory, I have left the old workflows untouched.
We can incremental migrate to the new layout, then delete the old
workflows after we've finished.
2021-01-12 09:32:32 -08:00
Ricky 6b28eb6175
Add workspaces hash to yarn cache key (#20154)
* Add branch to yarn cache key

* Add checksum check for workspace info

* Fix yaml

* Try moving the command

* How about here

* Just inline it

* i hate it here

* try reverting back

* Add run

* idk

* try inlining the command everywhere

* Create workspace_info.txt when we create the cache

* Delete the timestamp
2020-11-03 15:02:06 -05:00
Sebastian Markbåge c3e20f18fe
Add Relay specific React Native build of Flight (#20149)
This adds a new dimension similar to dom-relay. It's different from
"native" which would be Flight for RN without Relay.

This has some copy-pasta that's the same between the two Relay builds but
the key difference will be Metro and we're not quite sure what other
differences there will be yet.
2020-11-02 18:49:48 -08:00
Ricky 880587366d
Deprecate old test script commands (#19893)
* Deprecate old test script commands

* Update PR template test script

* Add test-stable and test-www-classic

* Update circle test names

* Rename test-www-classic to test-classic

* Missed some job renames

* Missed some more job renames
2020-10-14 08:54:34 -04:00
E-Liang Tan 04e21efd09
Add scheduling profiler deployment CI job (#19874)
* Add vercel to scheduling profiler dev deps
* Add vercel.json
* Add CD job
* Add CD setup instructions
2020-09-22 08:34:06 -04:00
E-Liang Tan 6d73063ddf
Enable building of DevTools and scheduling profiler in CI (#19691)
Re-enables building of main DevTools in CI and add new CI target for building the scheduling profiler.
2020-09-21 11:49:07 -04:00
Ricky c8d9b8878a
Speed up yarn cache in circle (#19566) 2020-08-11 14:05:15 -04:00