Summary:
With the migration to GHA, we can remove all the duplicated jobs from CircleCI.
These are the only 4 jobs remained to migrate
## Changelog:
[Internal] - Remove all the jobs already migrated to GHA
Pull Request resolved: https://github.com/facebook/react-native/pull/45219
Test Plan: CCI is green
Reviewed By: cortinico
Differential Revision: D59156888
Pulled By: cipolleschi
fbshipit-source-id: 193f1f8fa7484154d5295ac36a63bb81a159da6e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43533
Switch to the new unified release workflow by default, now that this has been validated on the `0.74-stable` branch.
- Remove `--use-new-workflow` flag and remove legacy logic.
- Remove legacy `prepare_package_for_release` CI job, and use `run_new_release_workflow` -> `run_release_workflow` as new workflow condition match.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D55027120
fbshipit-source-id: 7c05cdff95ac369ce6cd1201ccfc5718798c4da6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43518
This is a minimum approach to achieve a **single-command publish flow** for React Native, unifying the previous `yarn bump-all-updated-packages` and `yarn trigger-react-native-release` workflow entry points.
This diff aims to change as little as possible to achieve the above — introducing a new job that merges operations to create the versioning commit. The triggered publish jobs are unchanged. In future, we may follow this change with further simplifications down the workflow tree.
**Key changes**
- Adds a new CircleCI workflow, `prepare_release_new`, which versions **all packages** and writes a single release commit.
- This replaces `yarn bump-all-updated-packages`, now implemented with the newer `set-version` script.
- Wires this up as an experiment within `trigger-react-native-release.js`, conditionally running the new workflow when `--use-new-workflow` is passed.
**Not changed**
- The single release commit written will continue to trigger both of the existing CI workflows on push (`publish_release` and `publish_bumped_packages`), which are unchanged.
- The commit summary now includes the `#publish-packages-to-npm` marker, in order to trigger `publish_bumped_packages`.
- Usage: Release Crew members will continue to use the existing local script entry point (as [documented in the releases repo](https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-process.md#step-7-publish-react-native)), with the opt in flag.
```
yarn trigger-react-native-release --use-new-workflow [...args]
```
After we're happy with the E2E behaviour of this workflow in the next 0.74 RC, I will follow up by dropping the `--use-new-workflow` flag and removing the old scripts (T182533699).
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D54956345
fbshipit-source-id: 35fd7af8f3e60a39507b5d978ccd97472bf03ddb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43516
As titled. This seems dangerous — removing with the motivation that we'd prefer this script to fail during execution than to succeed in publishing `9999`.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D54956661
fbshipit-source-id: 23f8d49abd300385dde74871b6d2492ef63f058e
Summary:
This PR fixes typo in CircleCI config
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [FIXED] - Typo in circleci config
Pull Request resolved: https://github.com/facebook/react-native/pull/41727
Test Plan: CI Green
Reviewed By: cipolleschi
Differential Revision: D51748329
Pulled By: cortinico
fbshipit-source-id: 99f54c5b9ec4113205642076c010b748ab6229f6
Summary:
This PR removes some jobs we don't need right now
## Changelog:
[Internal] - remove unnecessary jobs
Pull Request resolved: https://github.com/facebook/react-native/pull/41453
Test Plan: CircleCI stays green
Reviewed By: NickGerleman
Differential Revision: D51257788
Pulled By: cipolleschi
fbshipit-source-id: e348a7ef7af469ba019b2ccc33feed79a9d4febe
Summary:
Instruction to install node on Debiam machine [has changed](https://github.com/nodesource/distributions#new-update-%EF%B8%8F) and the previous script cannot be used anymore.
This change updates it.
## Changelog:
[Internal] - Fix CI
Pull Request resolved: https://github.com/facebook/react-native/pull/41274
Test Plan: CircleCI is green
Reviewed By: rshest
Differential Revision: D50879481
Pulled By: cipolleschi
fbshipit-source-id: a1d2a3b06c42587e168d66746e2ccb2959c0f9e0
Summary:
## Changelog:
[Internal] - Run all the tests in CI when not on a PR
Reviewed By: cortinico
Differential Revision: D50220596
fbshipit-source-id: be1a30d713e9d427858cf22bd3ca9549ad513057
Summary:
CircleCI does not run jobs on tags by default. However, when we release a new version of React Native, we push a tag and we want to create a release from that tag only ([CircleCI Docs](https://circleci.com/docs/workflows/#executing-workflows-for-a-git-tag)).
The release job is already configured to run on tag. However, in August, we moved to the CircleCI continuation APIs and the starting job of the pipeline was not set up to run
also on tags.
This change fixes the issue, making the Choose CI Job run also on tags.
## Changelog:
[Internal] - Make the Choose CI Job run also on tags
Pull Request resolved: https://github.com/facebook/react-native/pull/39776
Test Plan:
Tested manually on CircleCI in a separate branch with a test tag (which have been then removed).
See commit history in this PR: https://github.com/facebook/react-native/pull/39774
Reviewed By: dmytrorykun
Differential Revision: D49863095
Pulled By: cipolleschi
fbshipit-source-id: 89c4eaa9903c02322056a4b57f56a24865a58b46
Summary:
Right now, every PR runs the whole test suite. For example, a changelog PR, will run all the tests. As of last month, that meant quite a few $s per single run.
With this PR, we are going to leverage dynamic configuration and file filtering to create a config.yml on the flight, depending on the files changed by the commit/pr.
They way it works is the following:
- It starts a setup workflow in CircleCI.
- This workflow fetch the list of files that have been changed in the current commit.
- It executes a bunch of filtering and computation to understand which tests makes sense to run.
- It creates a config on the flight to run those.
- It continue the pipeline on that config.
Currently, the way it works is the following:
- If a `.md` file has been modified => run nothing
- If only files in the `ReactAndroid` folder are modified => run tests for android only
- If only files in the `React` folder are modified or `ruby` files are modified => run only iOS tests
- If only js files, not in the scripts folder are modified => run only JS tests
- if only files in the e2e folder are modified => run only e2e tests
- else => run everything.
Of course, we can play and modify those filters t make sure that they reflect the work and the tests to the best we can.
bypass-github-exports-checks
## Changelog:
[Internal] - Split circleci config and run test selectively.
Pull Request resolved: https://github.com/facebook/react-native/pull/39042
Test Plan:
- [X] Tested on the local branch for general sanity check.
- [X] Import it in fbsource
- [x] Create a stacked diff which changes only a md file => verify that no tests are run.
- [x] Create a stacked diff which changes only files in ReactAndroid => verify that only android tests run.
- [x] Create a stacked diff which changes only files in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only ruby files => verify that only iOS tests run.
- [x] Create a stacked diff which changes ruby files and file in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only files JS not in the script folder => verify that JS tests run.
- [x] Create a stacked diff which changes only JS files in the script folder => verify that the whole suite starts.
- [x] Create a stacked diff which changes only files in the E2E folder => verify that only E2E files runs.
- [x] Trigger a nightly pipeline => verify that parameters are passed to the generated config.
Reviewed By: NickGerleman
Differential Revision: D48394437
Pulled By: cipolleschi
fbshipit-source-id: 771f3e68daa8318d2b73dd91ce85a41488110c04
Summary:
We figured that android e2e tests are a bit flakier than needed. This change add a retry mechanism to rerun the tests up to 3 times in order to try and reduce the flakyness there.
## Changelog:
[Internal] - Add retry to Android e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/39068
Test Plan: CircleCI stays green
Reviewed By: cortinico
Differential Revision: D48463517
Pulled By: cipolleschi
fbshipit-source-id: cdf3dca047dce89cc5d2dccc9b847283b93bbd36
Summary:
Right now, every PR runs the whole test suite. For example, a changelog PR, will run all the tests. As of last month, that meant quite a few $s per single run.
With this PR, we are going to leverage dynamic configuration and file filtering to create a config.yml on the flight, depending on the files changed by the commit/pr.
They way it works is the following:
- It starts a setup workflow in CircleCI.
- This workflow fetch the list of files that have been changed in the current commit.
- It executes a bunch of filtering and computation to understand which tests makes sense to run.
- It creates a config on the flight to run those.
- It continue the pipeline on that config.
Currently, the way it works is the following:
- If a `.md` file has been modified => run nothing
- If only files in the `ReactAndroid` folder are modified => run tests for android only
- If only files in the `React` folder are modified or `ruby` files are modified => run only iOS tests
- If only js files, not in the scripts folder are modified => run only JS tests
- if only files in the e2e folder are modified => run only e2e tests
- else => run everything.
Of course, we can play and modify those filters t make sure that they reflect the work and the tests to the best we can.
bypass-github-export-checks
## Changelog:
[Internal] - Split circleci config and run test selectively.
Pull Request resolved: https://github.com/facebook/react-native/pull/38793
Test Plan:
- [X] Tested on the local branch for general sanity check.
- [X] Import it in fbsource
- [x] Create a stacked diff which changes only a md file => verify that no tests are run.
- [x] Create a stacked diff which changes only files in ReactAndroid => verify that only android tests run.
- [x] Create a stacked diff which changes only files in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only ruby files => verify that only iOS tests run.
- [x] Create a stacked diff which changes ruby files and file in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only files JS not in the script folder => verify that JS tests run.
- [x] Create a stacked diff which changes only JS files in the script folder => verify that the whole suite starts.
- [x] Create a stacked diff which changes only files in the E2E folder => verify that only E2E files runs.
- [x] Trigger a nightly pipeline => verify that parameters are passed to the generated config.
Reviewed By: rshest
Differential Revision: D48118162
Pulled By: cipolleschi
fbshipit-source-id: 73c8071a7e80cd930fe538f77d7bb5de75f22ab7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38911
Flipper is going to be deprecated in 0.73. So we can decide to remove the CircleCI tests that run Flipper:
- test_ios_template-NewArch-Debug-WithFlipper-Hermes-StaticLibraries
- test_ios_template-NewArch-Debug-WithFlipper-JSC-StaticLibraries
- test_ios_template-OldArch-Debug-WithFlipper-JSC-StaticLibraries
Changelog:
[Internal] [Changed] - Remove Flipper jobs from Circle CI
Reviewed By: cipolleschi
Differential Revision: D48209184
fbshipit-source-id: f43613d17093c4cc883409d4f083c577da924b78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38992
This Diff publishes the Hermes dSYMs to Maven while doing a release.
These were missing and so the Stack traces can't be fully symbolicated when a crash occurs.
## Changelog:
[Internal] - Publish dSYM to Maven
Reviewed By: cortinico
Differential Revision: D48309198
fbshipit-source-id: a5514e544587daadd0a0d7614f25a30fccd16a5b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38983
Creates the dSYMs and store them as artifact in CircleCI
## Changelog:
[Internal] - Create the dSYM archive and upload it to CircleCI
Reviewed By: cortinico
Differential Revision: D48301851
fbshipit-source-id: 49c447b41573dcc567b3e62ad0b2a519562942c2
Summary:
This local change adds a script to poll Maven automatically after the release has happened.
This should allow the Release Crew not to repeatedly and manually refresh Maven urls in order to see whether the artifacts are there or not.
As soon as this job is green, artifacts are out!
Cost wise, we are using a small machine, which costs 5 credits per minute.
## Changelog:
[Internal] -Add script and CI job to poll for maven after a release.
Pull Request resolved: https://github.com/facebook/react-native/pull/38985
Test Plan:
Tested locally, running the JS script.
[Verified that the CI job can execute it.](https://app.circleci.com/pipelines/github/facebook/react-native/29634/workflows/5966d5f9-12ca-40b1-9185-758fe98d3aee/jobs/944107)
We can only test this for real while doing a proper release.
Reviewed By: cortinico
Differential Revision: D48309874
Pulled By: cipolleschi
fbshipit-source-id: 5c38b588c29c1311b1fa4e4ca44785583db0b701
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38987
As now we do have the buildTools version 34 in the docker container,
I'm bumping compileSdkVersion for all the targets to 34.
I'm also cleaning up the `test_windows` setup as it had old references
of NDK 20, build tools 33 and was installing the Android SDK but not
actually using it.
Changelog:
[Android] [Changed] - Bump Android compile-sdk to 34
Reviewed By: cipolleschi
Differential Revision: D48311828
fbshipit-source-id: c5b1d20a6183b577fba520af95b33e7656477101
Summary:
This change stores artifacts in CI only when it runs in main or in a stable branch
## Changelog:
[Internal] - Store CI artifacts only on main or on stable branches
Pull Request resolved: https://github.com/facebook/react-native/pull/38954
Test Plan: CircleCI stays green and we don't store anything on pr branch
Reviewed By: cortinico
Differential Revision: D48267659
Pulled By: cipolleschi
fbshipit-source-id: 6257270948c770e09492691c995cbe84d7a085ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38885
We do have several Gradle Properties that are used to configure the build.
I've refactored them all and moved them inside the PropertyUtils file:
https://github.com/facebook/react-native/blob/main/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PropertyUtils.kt
Specifically properties should be 'scoped' under `react.` if public, and `react.internal.` if for internal usage.
Property that I cleaned up are:
- REACT_NATIVE_MAVEN_LOCAL_REPO becomes react.internal.mavenLocalRepo
- REACT_WINDOWS_BASH becomes react.internal.windowsBashPath
- GROUP becomes react.internal.publishingGroup
I've also added support for scoping for public properties with backward compat (so both the scoped and unscoped properties are accepted):
- react.newArchEnabled
- react.hermesEnabled
- react.nativeArchitectures
Changelog:
[Android] [Changed] - Cleanup and scope all the Gradle Properties
Reviewed By: mdvacca
Differential Revision: D48188310
fbshipit-source-id: 1a92d31105270a4c2f80029b7d36bcb33916d0fb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38969
As we migrate java to kotlin I noticed that we've introduced few warnings here and there.
In this diff I'm enabling allWarningsAsErrors in the CI
The reasoning is that we are just starting with Kotlin and I believe we should enable 'allWarningsAsErrors' for CI android builds to make sure the codebase grow healthy, this will also help us to cleanup apis. e.g. create APIs for
deprecated java APIs.
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D48239603
fbshipit-source-id: dd7a5df98cea82bf9bab6b26c4b1baa9f743ccbf
Summary:
Removing the `test_ios_rntester` jobs for the following config:
- (OldArch, JSC, StaticLibraries)
- (OldArch, Hermes, StaticLibraries)
As this job just test that this configuration can be built and we have two other jobs (`test_ios-Hermes` and `test_ios-JSC`) which builds the same configs (so the test is duplicated) and they run unit and integration tests on top of these.
bypass-github-export-checks
## Changelog:
[Internal] - Remove duplicated `test_ios_rntester` jobs
Reviewed By: cortinico
Differential Revision: D48264664
fbshipit-source-id: 6dbf0edb9aba9ca8340b7c722b4f5c189c961577
Summary:
Removing this job as the e2e test does basically the same work and run some e2e tests on top of that.
bypass-github-export-checks
## Changelog:
[Internal] - Remove Xcode<-->Hermes integration as it is dupicated by the e2e_ios
Reviewed By: cortinico
Differential Revision: D48229891
fbshipit-source-id: dbc8ef0f62c8839773232d5b07385b1006c601ce
Summary:
CircleCI is broken because we deleted a command but forgot to remove one last usage of it.
bypass-github-export-checks
## Changelog:
[Internal] - Remove last usage of setup_artifacts
Pull Request resolved: https://github.com/facebook/react-native/pull/38943
Test Plan: CircleCI is green
Reviewed By: Andjeliko, rshest, GijsWeterings
Differential Revision: D48263252
Pulled By: cipolleschi
fbshipit-source-id: 2f169952479389e476dfab0f88474c759728d3b4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38901
This step is really necessary or if the folders will be created on the fly.
Changelog:
[Internal] [Changed] - Remove setup_artifacts as unnecessary
Reviewed By: mdvacca
Differential Revision: D48197595
fbshipit-source-id: ed2455dfdb9dcb4ce9219fc27d496d6faca4ddc2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38905
For the `build_hermesc_linux` job we don't need xlarge resources.
The current average usage for `build_hermesc_linux` is around 25%.
We can also downscale to medium in few days if this scales well.
**Insights Dashboard :**
`build_hermesc_linux`
{F1067213827}
Changelog:
[Internal] [Changed] - Downscale build_hermesc_linux job to Large
Reviewed By: cipolleschi
Differential Revision: D48200659
fbshipit-source-id: 2642d5d527e9e55cfe5c4498ea00c25915bbc883
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38894
This diff introduces a script `run_with_retry` that we can apply to single commands in order to mitigate the flakiness.
This can be useful when networking is involved, to retry installing some dependencies, or for example with some e2e/integration tests.
The diff applies this rerun to the iOS tests so we mitigate failures in CI.
## Changelog:
[Internal] - Add script to retry CI steps and mitigate iOS flakyness.
Reviewed By: cortinico
Differential Revision: D48189365
fbshipit-source-id: a0e115754bcdb8f8353bb5f070163f8cf8f7c9cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38893
This Parameter was false and never set to true. Also, we don't know what that code does and it was not used for more than a year.
## Changelog:
[Internal] - Removing not executed code.
Reviewed By: cortinico, dmytrorykun
Differential Revision: D48189139
fbshipit-source-id: 6a4000f677958aaefadec40d531acb37c98e3ef8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38848
In order to parallelize the Android CI, I've moved most of the building to a `build_android` step which executes before the `build_npm_package` step.
As currently, building Hermes for Android is on the critical path, this should reduce much of the execution time on CI.
Changelog:
[Internal] [Changed] - Introduce a build_android step
Reviewed By: mdvacca
Differential Revision: D48148418
fbshipit-source-id: bfe3175fcc11d96e264eb31d8d5555bd1f83c01d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38902
As now we distribute libraries on Maven Central,
users should be able to use those instead of having to download them from the
React Native CI automatically.
This is already available since React Native 0.71, so we can probably remove this extra step.
Changelog:
[Internal] [Changed] - Do not store Hermes debug symbols on CircleCI
Reviewed By: mdvacca
Differential Revision: D48197732
fbshipit-source-id: 037794ac7167b3b3cc217c76699c83cc1ba9ab60
Summary:
This change adds a step to store the publishing logs as artifacts when the publishing fails, so that we can analyze what happened without relaunching the job
## Changelog:
[Internal] - Add step to upload publishing logs
Pull Request resolved: https://github.com/facebook/react-native/pull/38846
Test Plan: CircleCI stays green
Reviewed By: cortinico
Differential Revision: D48183313
Pulled By: cipolleschi
fbshipit-source-id: 72fa753c094224d4cb3fea952a75591688ea7822
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38889
As we don't really use the commitlies code in CircleCI, I'm cleaning up some of the code used to publish artifacts to the user.
Changelog:
[Internal] [Changed] - Cleanup the commitlies code
Reviewed By: cipolleschi
Differential Revision: D48189398
fbshipit-source-id: c4591ee290eba49224322d44a32052ff292ccbed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38855
For the `test_js_prev_lts` job we don't need xlarge resources.
The current average usage for `test_js_prev_lts` is around 25%.
We can also downscale to medium in few days if this scales well.
**Insights Dashboard:**
`test_js_prev_lts`
{F1065747013}
Changelog:
[Internal] [Changed] - Downscale test_js_prev_lts job to Large
Reviewed By: cortinico, cipolleschi
Differential Revision: D48125886
fbshipit-source-id: 521fac38a1d699e576bc1ce5a3a29a47bc284e76
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38827
For the `test_js` and `find_and_publish_bumped_packages` jobs we don't need xlarge resources.
The current average usage for `test_js` and `find_and_publish_bumped_packages` is around 25%.
We can also downscale to medium in few days if this scales well.
**Insights Dashboard:**
`test_js`
{F1065742668}
`find_and_publish_bumped_packages`
{F1065742888}
Changelog:
[Internal] [Changed] - Downscale test_js and find_and_publish_bumped_packages` jobs to Large
Reviewed By: cortinico
Differential Revision: D48125531
fbshipit-source-id: 004c2306fd224a5798a6b084fb75a79896695b15
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38816
To save resources, we should build only arm64 for PRs and commits to mains.
Our Android ABIs are really similar and we should just build the most popular. For nightlies/releases
instead we'll have to build all the archs.
Changelog:
[Internal] [Changed] - Build only arm64 when building PRs. All archs for nightlies and releases.
Reviewed By: cipolleschi
Differential Revision: D48112361
fbshipit-source-id: 69e172a4ea69f844b344a9fc6ac4ee0471b40c36
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38815
For the template jobs, we don't need xlarge resources but we can probably use medium.
I've checked on the Insights dashboard and the average usage is at 25%
Changelog:
[Internal] [Changed] - Downscale Test Android Template jobs to Large
Reviewed By: cipolleschi
Differential Revision: D48112362
fbshipit-source-id: 3745a90d12b96818430264be43ae2672bb05d436
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38819
The jobs for `analyze_pr` and `analyze_code` are currently running on Android's Docker container on a XL instance. This is costly. As those jobs are relatively small, not on the critical path, and need the Android container only for `java`, I've moved the to the node-broswers CI executor:
https://circleci.com/developer/images/image/cimg/node
Changelog:
[Internal] [Changed] - Downscale and move to a prebuilt-image analyze code/pr
Reviewed By: cipolleschi
Differential Revision: D48116159
fbshipit-source-id: a12782b810fb225ab6916a35054a891e73f3a717
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38821
I've just realized that the caching of 3rd party native dependencies is broken for Android, so we re-download them every time. This fixes it by specifying the correct paths where the zip files are stored.
Changelog:
[Internal] [Changed] - Fix caching paths for Gradle after the monorepo migration
Reviewed By: cipolleschi
Differential Revision: D48116655
fbshipit-source-id: 5a8ba65ef9b006be197b135f8dbf60372483f726
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38814
This change enables the Gradle Daemon on CI.
We noticed some flakyness with the Daemon disabled, so we'll give it a try with the daemon enabled which is the default for Gradle.
Changelog:
[Internal] [Changed] - Enable the Gradle Daemon for CI
Reviewed By: cipolleschi
Differential Revision: D48112363
fbshipit-source-id: 4a7f9bbaad33935a97e4e0ea28ea8f2f22c67d0f
Summary:
Right now we're building by default Android app in New Architecture, so to align this behaviour between platforms - I added `RCT_NEW_ARCH_ENABLED=1` when installing Pods when running E2E tests, to also build iOS app in New Arch.
## Changelog:
[IOS] [CHANGED] - Build iOS app in New Architecture when running E2E tests.
Pull Request resolved: https://github.com/facebook/react-native/pull/38813
Test Plan: App in `test_e2e_ios` job should build in New Architecture
Reviewed By: dmytrorykun
Differential Revision: D48112814
Pulled By: cipolleschi
fbshipit-source-id: f709fe23f7c3ff65f3e39acb304581c4ec0fdea8
Summary:
This PR adds better caching for iOS jobs and the cocoapods dependencies.
The changes takes the proper version of the `podfile.lock`, which depends on the job and several other aspects, to decide which cache to restore.
This can save up to 2 minutes per jobs.
Currently, we have 33 iOS jobs that use cocoapods.
This can save 66 minutes per run, which equates to 4950 credits per run.
## Changelog:
[Internal] - Add Caching for Xcodebuild jobs
Pull Request resolved: https://github.com/facebook/react-native/pull/38687
Test Plan: CircleCI stays green and jobs run faster
Reviewed By: cortinico
Differential Revision: D48063823
Pulled By: cipolleschi
fbshipit-source-id: e56ffdb43a689b5630a8d73c8f5d23ccbf732c27
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38787
This pipeline only contains duplicated work.
It has been removed in [62c9aae](62c9aaea9b) and got back [here](79122abe8a) due to a conflict resolved badly probably.
## Changelog:
[internal] - Remove the package_and_publish_release_dryrun job
## Facebook:
Removing this job saves 2550 $ per month.
Yearly saving: 30600.
Reviewed By: rshest, GijsWeterings
Differential Revision: D48064818
fbshipit-source-id: 65f67d32f252062cc9a52c94eb0cae321e64bf7c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38718
> NOTE: Replaces https://github.com/facebook/react-native/pull/38240
## Context
RFC: Decoupling Flipper from React Native core: https://github.com/react-native-community/discussions-and-proposals/pull/641
## Changes
To support incoming new React Native packages around debugging (including migrating over [`react-native-community/cli-plugin-metro`](https://github.com/react-native-community/cli/tree/main/packages/cli-plugin-metro)) — which target Node.js and require a build step, this PR adds a minimal shared build setup across the `react-native` monorepo.
The setup is closely inspired/based on the build scripts in Jest, Metro, and React Native CLI — and is a simple set of script wrappers around Babel. These are available as build commands at the root of the repo:
- `yarn build` — Builds all configured packages. Functionally, this:
- Outputs a `dist/` directory with built files.
- Rewrites package.json `"exports"` to update every `./src/*` reference to `./dist/*` (source of truth).
- `scripts/build/babel-register.js` — Allows running all Node.js entry points from source, similar to the current setup in [facebook/metro](https://github.com/facebook/metro). (Example entry point file in this PR: `packages/dev-middleware/src/index.js`)
Build configuration (i.e. Babel config) is shared as a set standard across the monorepo, and **packages are opted-in to requiring a build**, configured in `scripts/build.config.js`.
```
const buildConfig /*: BuildConfig */ = {
// The packages to include for build and their build options
packages: {
'dev-middleware': {target: 'node'},
},
};
```
For now, there is a single `target: 'node'` option — this is necessary as `react-native`, unlike the above other projects, is a repository with packages targeting several runtimes. We may, in future, introduce a build step for other, non-Node, packages — which may be useful for things such as auto-generated TypeScript definitions.
{F1043312771}
**Differences from the Metro setup**
- References (and compiles out) repo-local `scripts/build/babel-register.js` — removing need for an npm-published dependency.
## Current integration points
- **CircleCI** — `yarn build` is added to the `build_npm_package` and `find_and_publish_bumped_packages` jobs.
**New Node.js package(s) are not load bearing quite yet**: There are not yet any built packages added to the dependencies of `packages/react-native/`, so this will be further tested in a later PR (and is actively being done in an internal commit stack).
### Alternative designs
**Per-package config file**
Replace `scripts/build/config.js` with a package-defined key in in `package.json`, similar to Jest's [`publishConfig`](1f019afdcd/packages/jest-cli/package.json (L87C3-L89C4)).
```
"buildConfig": {
"type": "node"
},
```
This would be the only customisation required, with a single Babel config still standardised. Another option this might receive in future is `enableTypeScriptCodgeen`.
**Rollup**
More sophisticated build tool for Node.js, used by the React codebase (albeit within a custom script setup as well).
**Lerna and Nx**
- Most sophisticated setup enabling caching and optimised cloud runs.
- Probably the most likely thing we'll move towards at a later stage.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D47760330
fbshipit-source-id: 38ec94708ce3d9946a197d80885781e9707c5841
Summary:
This PR splits the build of Hermes for iOS in multiple jobs.
Before, we were building all the slices of Hermes serially. So, we were:
- building the hermesc
- building hermes for iPhone
- building hermes for iPhonesimulator
- building hermes for Macos
- building hermes for Catalyst
- packaging the framework
This job was taking up to 45-50 minutes.
The the four slices (iPhone, iPhonesimulator, Macos, Catalyst) can be parallelized to harvest a speedup in execution.
The following tables contains the executions before and after this change.
- Full Clean Build -> Before: 51' 35" | After: 17'33" ( 3x improvement)
| BEFORE | AFTER |
| --- | --- |
| <img width="1164" alt="Screenshot 2023-07-28 at 11 48 24" src="https://github.com/facebook/react-native/assets/11162307/49cc519c-16f0-4868-b847-602b1cb21f3e"> | <img width="1120" alt="Screenshot 2023-07-28 at 11 16 32" src="https://github.com/facebook/react-native/assets/11162307/85034cd7-751e-4056-ae4f-ed09ac8343e8"> |
| Total time (critical path): `build_hermes_macos-Debug` = 51' 35" | Total time (critical path): `build_hermesc_apple` (2' 56") + `build_apple_slices_hermes-Debug-macosx` (9'23") + `build_hermes_macos-Debug` (5'14") = 17'33" |
- Fully Cached Build -> Before: 4'35" | After: 32" ( 9x improvement)
| BEFORE | AFTER |
| --- | --- |
| <img width="497" alt="Screenshot 2023-07-28 at 14 38 12" src="https://github.com/facebook/react-native/assets/11162307/978eba4d-3524-45ab-bfa5-d9cb9ba63df1"> | <img width="1099" alt="Screenshot 2023-07-28 at 16 12 17" src="https://github.com/facebook/react-native/assets/11162307/f2a8f0bb-545c-4d6f-9b81-cda87151bb62"> |
| Total Time (critical path): `build_hermes_macos-Debug` (4'35") | Total Time (critical path): `build_hermesc_apple` (7") + `build_apple_slices_hermes-Debug-macosx` (7") + `build_hermes_macos-Debug` (32") = 46" |
## Changelog:
[Internal] - Split hermes build to speedup CI and Release
Pull Request resolved: https://github.com/facebook/react-native/pull/38619
Test Plan:
- CircleCI stays green
- Hermes artifact still works for RNTester and app from the template
Reviewed By: cortinico, dmytrorykun
Differential Revision: D47896833
Pulled By: cipolleschi
fbshipit-source-id: 3b9e8d5de9b2a6fb6671444fda09d77b96123ac2
Summary:
This job is now unnecessary and we can safely remove it as its work is effectively already
executed by the `test_android` job and is causing us just to spent more CI credits.
Changelog:
[Internal] [Changed] - Remove test_android_docker_image
Reviewed By: cipolleschi
Differential Revision: D47716008
fbshipit-source-id: 68ff2b28da8cfb69e013476f84e903cf3001d5d3
Summary:
This PR is small cleanup in scripts in `rn-tester-e2e` package, it creates unified script so that we can easily pass platform as an argument. Context: https://github.com/facebook/react-native/pull/36267#discussion_r1269378065
## Changelog:
[INTERNAL] [CHANGED] - Unify `test-e2e` command in `rn-tester-e2e` package
Pull Request resolved: https://github.com/facebook/react-native/pull/38701
Test Plan: CI Green ✅
Reviewed By: NickGerleman, cipolleschi
Differential Revision: D47949821
Pulled By: cortinico
fbshipit-source-id: 90bbc96281e89dec505999ff5e51db7ca78da6dc