Граф коммитов

388 Коммитов

Автор SHA1 Сообщение Дата
Ruslan Lesiutin 4b6b706680 Update paths in a new setup to fix nightlies (#36535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36535

Changelog: [Internal]

- We should be copying `/packages/react-native/package.json`, not root `package.json`
- Updating CircleCI config's target directory where hermes artifacts should be copied

Reviewed By: cortinico

Differential Revision: D44214309

fbshipit-source-id: af84897df3931c6a2d6a902b33c71b665c3fcefc
2023-03-20 07:05:52 -07:00
Nicola Corti 5cbabe30d3 Use the default `build` task rather than `buildAll`
Summary:
We can now use the `build` lifecycle task rather than a custom buildAll.
This task will also run linters and other checks on our builds.

Speficially I realized we were missing some permission in the manifest of RN-Tester
which were missed once we bumped to SDK 33.

Changelog:
[Internal] [Changed] - Use the default `build` task rather than `buildAll`

Reviewed By: cipolleschi

Differential Revision: D44055845

fbshipit-source-id: c9adbbeaaaf7ab8a8000fc1dce84ec39427fb26e
2023-03-17 10:26:34 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Dmitry Rykun b07cf33279 Use RN Build Utils for Building Hermes Artifacts
Summary:
We moved Hermes some build utils from [Hermes repo](https://github.com/facebook/hermes/tree/main/utils) to [React Navtie repo](https://github.com/facebook/react-native/tree/main/sdks/hermes-engine/utils) a while ago to have more control over them. However some paths on the CI were not updated. We continued to use old build scripts for Hermes prebuilds. Some unfortunate side effects are:
- `HERMES_ENABLE_DEBUGGER` is [hardcoded to true](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L65). That makes Hermes much slower in Release configuration.
- BUILD_TYPE is [set to Release](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L10) instead of `MinSizeRel` which inreases Hermes binary size.

This diff copies these build utils from RN to Hermes source directory before we perform Hermes build.

Changelog
[Internal]

Reviewed By: cipolleschi

Differential Revision: D44066721

fbshipit-source-id: f45ad6a31fb01c10199f69cc7bbcbbc83b793d34
2023-03-15 11:13:17 -07:00
Riccardo Cipolleschi 50068d0070 Improve robustness of iOS CircleCI Pipelines (#36419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36419

After migrating to Xcode 14.2.0, some contributors were receiving CircleCI Machines that were not able to install Ruby 3.2.0.

This change should improve the robustness of the pipelines, ensuring that `ruby-build` can always find the version of Ruby it needs

## Changelog:
[internal] - Make sure CircleCI always find the right version of Ruby

Reviewed By: cortinico

Differential Revision: D43944878

fbshipit-source-id: 89d9fcc6ae346003e96c2a8f4103a83a7d2f3204
2023-03-09 08:40:05 -08:00
Riccardo Cipolleschi f264fe12df Bump Xcode to 14.2.0 in circleCI (#36388)
Summary:
In CricleCI we are still using Xcode 14.0.1.
This version will be removed from CircleCI this Thursday, so we have to update it.

## Changelog
[Internal] - Bump xcode in CircleCI to 14.2.0

Pull Request resolved: https://github.com/facebook/react-native/pull/36388

Test Plan: CircleCI should be Green

Reviewed By: dmytrorykun

Differential Revision: D43873750

Pulled By: cipolleschi

fbshipit-source-id: 8b796c0961647fce103d2659036bf5f9037fe90a
2023-03-07 08:45:22 -08:00
Riccardo Cipolleschi aac71507fa Add tests with more recent Rubies (#36376)
Summary:
This change add more tests for iOS, using different versions of Ruby

## Changelog
[iOS][Added] - Added smoke tests for iOS with Ruby 2.7.7 and 3.2.0

Pull Request resolved: https://github.com/facebook/react-native/pull/36376

Test Plan: CircleCI must be green.

Reviewed By: blakef

Differential Revision: D43825344

Pulled By: cipolleschi

fbshipit-source-id: 8d3f5a2d9688f4d58f0ad5573d7b21e059cab523
2023-03-06 02:56:26 -08:00
Riccardo Cipolleschi b6f8210811 Use Ruby 2.6.10 in CI (#36361)
Summary:
Starting from RN 0.72, we would like to be more permissive in which version of Ruby our users can use. This means that we have to make sure that our pipeline works with various
versions of Ruby, especially the lowest one, which is 2.6.10.

This change make sure that we run all the CI jobs with version 2.6.10

## Changelog

[IOS] [CHANGED] - Use Ruby 2.6.10 in CI

Pull Request resolved: https://github.com/facebook/react-native/pull/36361

Test Plan: CircleCI must be green

Reviewed By: blakef

Differential Revision: D43824143

Pulled By: cipolleschi

fbshipit-source-id: ecbeb66667a29d9ed07b86c099ad424380a934a7
2023-03-06 02:56:26 -08:00
Riccardo Cipolleschi 0f56cee8e1 Update Gemfile to require Cocoapods 1.12.0 (#36321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36321

This change bumps Cocoapods to 1.12.0. This last release fixes a bug for which cocoapods was not working with Ruby 3.2.0

## Changelog
[iOS][Changed] - Bumbed version of Cocoapods to support Ruby 3.2.0

Reviewed By: blakef

Differential Revision: D43655787

fbshipit-source-id: 6954ac8271daa7894e57f6d6104ed4d549490695
2023-02-28 07:14:02 -08:00
Nicola Corti 81dd3afe0b Bump Gradle to 8.x (#36269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36269

This bumps our project to build on Gradle 8.x
All the necessary issues have already been resolved so everything should be green.
Gradle version has been bumped also inside the template and RNGP.

Changelog:
[Android] [Changed] - Bump Gradle to 8.x

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D43534184

fbshipit-source-id: ca1fd6799ff6d776743de2b2d809fc54bc533440
2023-02-27 13:47:09 -08:00
Riccardo Cipolleschi 23eb380f65 Enable CircleCI tests for Use_Frameworks with the New Arch (#36148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36148

This change enables 4 noew tests to make sure that `use_frameworks!` with the New Architecture don't break

Note: We may have to publish the codegen to make this work on CircleCI properly

## Changelog:
[iOS][Added] - Added tests for use_frameworks! with the new architecture

Reviewed By: cortinico, dmytrorykun

Differential Revision: D43271625

fbshipit-source-id: fe1fa4be660f933e0113f44a0467eaa1fa3669ca
2023-02-20 11:50:10 -08:00
Blake Friedman ed8a3e08e2 brew should overwrite existing python links (#36192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36192

Builds are failing on CI because brew bails out when it tries installing Python 3.1. The image already has an existing version of Python 3, which we should overwrite.

{F876436464}

This seems to be a known issue [1] with Brew. In this case it seems safe to overwrite.

Changelog:
[General][Changed] - Brew overwrites system Python 3.

[1] https://github.com/actions/setup-python/issues/577#issuecomment-1431468702

Reviewed By: cipolleschi

Differential Revision: D43391941

fbshipit-source-id: 9b0cb234eeb0b7473b17b5ebfa6ed12c6448760f
2023-02-17 08:08:39 -08:00
Blake Friedman 2cfb34f6bb log out brew install messages (#36191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36191

Brew commands used to be piped to /dev/null. We weren't able to investigate brew install failures because of this.

# Changelog:

[General][Changed] - log out brew stdout messages in CircleCI

Reviewed By: robhogan, cortinico

Differential Revision: D43389785

fbshipit-source-id: 4dc56125ef5fb87b181ad0b8f9069995ad896812
2023-02-17 05:43:22 -08:00
Saad Najmi 7208cd6384 Switch to xcbeautify (#36131)
Summary:
`xcpretty` is no longer maintained. Let's switch to `xcbeautify`, which is faster and is maintained. I'm also biased because `xcpretty` hid an error from me that `xcbeautify` did not.

## Changelog

[INTERNAL] [CHANGED] - Move CI from `xcpretty` to `xcbeautify`

Pull Request resolved: https://github.com/facebook/react-native/pull/36131

Test Plan:
Locally yarn `yarn test-ios` and got output that looks like this:

<img width="1245" alt="Screenshot 2023-02-11 at 9 34 07 PM" src="https://user-images.githubusercontent.com/6722175/218291538-07760f94-7e52-4919-b603-8a35a623fc9a.png">

I also confirmed a junit report that looks like this was generated:
```xml
<testsuites name="Selected tests" tests="193" failures="0">
    <testsuite name="RCTLoggingTests" tests="1" failures="0">
        <testcase classname="RCTLoggingTests" name="testLogging" time="0.175" />
    </testsuite>
    <testsuite name="RCTUIManagerScenarioTests" tests="3" failures="0">
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddRemoveAndMove" time="0.001" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddViews" time="0.000" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToRemoveViews" time="0.001" />
    </testsuite>
    ...
```

Reviewed By: cortinico

Differential Revision: D43232774

Pulled By: cipolleschi

fbshipit-source-id: fda4e217d4df55b5088026d6911d3dc6c8c9e824
2023-02-15 04:20:20 -08:00
Ruslan Lesiutin 28d8f25c76 fix: update executor for packages publishing workflow (#36146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36146

Changelog: [Internal]

- While working on 0.71.3, it was discovered that `react-native-codegen` package is being published almost empty (without `lib` folder)
- The reason for it is that `prepare` script is not being executed
- The main reason for it is npm v6, which requires adding `unsafe-perm` flag for it: https://www.vinayraghu.com/blog/npm-unsafe-perm
- Instead of using this flag, changing executor to `nodelts`, which has node v18 and npm v8
- Also adding `run_yarn` before running the script, because `react-native/codegen` uses external dependencies (such as rimraf) for its build scripts

Reviewed By: cipolleschi

Differential Revision: D43248175

fbshipit-source-id: d12b93decbf408713e309fe8be75d8d5ec994868
2023-02-14 07:06:53 -08:00
Nicola Corti 9eaf6f5bdb Move test-docker-android from GH Actions to CircleCI (#36093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36093

The Test Docker Android job is flaky as sometimes fetching artifacts from remote
returns different hashes.
I'm moving the job to CircleCI (so it's faster) + I'm using the `buck_fetch.sh`
script we already have which has a retry logic.

Changelog:
[Internal] [Changed] - Move test-docker-android from GH Actions to CircleCI

Reviewed By: javache

Differential Revision: D43121477

fbshipit-source-id: 1df114fd3ad9445a4a5dc7834bf811c3476322cd
2023-02-08 12:51:09 -08:00
Nicola Corti 2607602b8a Reduce flakyness by not downloading extra packages (#36077)
Summary:
Yesterday CircleCI was extremely flaky due to us trying to `apt install` extra packages. This mitigates one scenario where we try to redownload `jq` and `shellcheck`.

I've moved to use a container which contains those packages already

## Changelog

[INTERNAL] - Reduce flakyness by not downloading extra packages

Pull Request resolved: https://github.com/facebook/react-native/pull/36077

Test Plan: Will wait for a green CI

Reviewed By: cipolleschi

Differential Revision: D43080349

Pulled By: cortinico

fbshipit-source-id: 6527c5ad129f47d8b5f02bf207e1af67a095afa1
2023-02-07 07:22:30 -08:00
Nicola Corti 9e4b4ef2d5 Remove the `react-native-bot` context from CircleCI
Summary:
While working on T143721371 I've noticed that we still have an exposed context
for `react-native-bot` which gives access to `PAT_TOKEN` and `PAT_USERNAME`.
As those two variables are unused, we can fully clean this us.

Changelog:
[Internal] [Changed] - Remove the `react-native-bot` context from CircleCI

Reviewed By: cipolleschi

Differential Revision: D42886196

fbshipit-source-id: 4eba7a53557fe7af7d87650052630eea2d2d3934
2023-01-31 08:00:08 -08:00
Riccardo Cipolleschi 8056cd7f05 Add Tests in CircleCI to check dynamic frameworks with the old arch (#36003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36003

This diff adds 4 tests in CircleCI to make sure we don't regress in the support of Dynamic Frameworks for the old architecture.

## Changelog
[iOS][Fixed] - Add CircleCI tests for dynamic frameworks with the Old Architecture.

Reviewed By: cortinico

Differential Revision: D42829895

fbshipit-source-id: 5669be45d4f55161a11a6ece161b2a2aa384a644
2023-01-30 04:25:26 -08:00
Nicola Corti d30bd1bb21 Migrate nightly from scheduled workflow to scheduled pipeline (#35977)
Summary:
I'm moving nightlies from scheduled workflow to scheduled pipeline.
We're not able to manually retrigger nightlies as they're a scheduled workflow and don't expose a parameter. Here I'm cleaning it up.

Plus I'm:
1. Removing the `main_only` reference which is unused
2. Setting up the `run_release_workflow` and `run_nightly_workflow` parameters.

## Changelog

[INTERNAL] - Migrate nightly from scheduled workflow to scheduled pipeline

Pull Request resolved: https://github.com/facebook/react-native/pull/35977

Test Plan: Will wait for CI results.

Reviewed By: cipolleschi

Differential Revision: D42776969

Pulled By: cortinico

fbshipit-source-id: d4ef9654d23cb91f85ce2b38e75e27dc0c575e95
2023-01-27 01:33:21 -08:00
Nicola Corti 477f546d1b Bump CMake to 3.22.1 to properly honor CMAKE_BUILD_TYPE (#35857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35857

It seems like there is an incompatibility between NDK 23 (shipped in 0.71)
and the usage of custom `CMAKE_BUILD_TYPE` we do for Hermes.

Specifically the `-DCMAKE_BUILD_TYPE=Release` we specify for the debug
variant of Hermes is partially ignored by the new Android native build toolchain.
See https://github.com/android/ndk/issues/463 for mentions on how the
toolchains requires CMake 3.20+

As AGP 7.3 defaults to use CMake 3.18 unless specified, and NDK 23 unless specified.
AGP 7.4 defaults to use CMake 3.22 unless specified, and NDK 23 unless specified.
See: https://developer.android.com/studio/releases/gradle-plugin#7-4-0

Here I'm:
1. Bumping the docker image to an image that contains the CMake 3.22
2. Updating the logic for building `react-native` & `hermes-engine` to use 3.22
3. Provide fallbacks if the user specified `CMAKE_VERSION`

Template tests will run on AGP 7.3 and will still use CMake 3.18, but I forecast
no problem there as the user is not supposed to specify custom `CMAKE_BUILD_TYPE`.
This is only a problem as we build `hermes-engine` with custom build types.

Changelog:
[Android] [Fixed] - Bump CMake to 3.22.1 to properly honor CMAKE_BUILD_TYPE

Reviewed By: cipolleschi

Differential Revision: D42544864

fbshipit-source-id: efd0f51120370fb808337c201df31d71f4ddfdbc
2023-01-18 09:49:27 -08:00
Riccardo Cipolleschi 4c5fa6e372 fix: use properly exclude parameter of matrix (#35794)
Summary:
Update the CircleCI configuration to use the proper `exclude` parameter of matrix rather then bootstrap a machine and then kill it.

## 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
-->
## Changelog
[Internal] - Use the `exclude` parameter of matrices to avoid spinning up unnecessary machines

Pull Request resolved: https://github.com/facebook/react-native/pull/35794

Test Plan: The number of jobs on CircleCI should decrease.

Reviewed By: dmytrorykun

Differential Revision: D42475445

Pulled By: cipolleschi

fbshipit-source-id: 3d733ac459a3bc9747440a62cb2caecb7a235fec
2023-01-12 07:36:45 -08:00
Nicola Corti 573734f4e6 Remove PAT_TOKEN and PAT_USERNAME from CircleCI (#35808)
Summary:
This is a cleanup change needed after the CircleCI security incident.
We should be using the `Authorization: Bearer` header to trigger `rn-diff-purge` instead of using username & password authentication.

Source: https://docs.github.com/rest/reference/repos#create-a-repository-dispatch-event

## Changelog

[INTERNAL] - Remove PAT_TOKEN and PAT_USERNAME from CircleCI

Pull Request resolved: https://github.com/facebook/react-native/pull/35808

Test Plan:
I've tested this locally with:

```
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
                    -H "Accept: application/vnd.github.v3+json" \
                    -H "Authorization: Bearer [...]" \
                    -d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"test.test.test\" }}"
```

and the run was succesfully fired by react-native-bot:
https://github.com/react-native-community/rn-diff-purge/actions/runs/3894079133

Reviewed By: lunaleaps

Differential Revision: D42456065

Pulled By: cortinico

fbshipit-source-id: 475e9ca80760522cc08bad37d85c5af6727922d3
2023-01-11 10:58:25 -08:00
Ruslan Lesiutin ec28c5bbaa feat(react-native-github): a script to automate patch version bumping of packages (#35767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35767

Changelog: [Internal]

Introducing a script, which can be used to identify all packages inside `/packages`, which contain any changes after the last time its version was changed

How it works step by step:

```
check that no git changes are present

for each package:
    if package is private -> skip

    grep id of the last commit that changed package
    grep id of the last commit that changed version of the package

    if these ids are different:
        bump package patch version

commit changes if required
```

Can be executed only in git environment and by running: `node ./scripts/bump-all-updated-packages`

 ---

Also adding a separate script `align-package-versions.js`, which can be used to update versions of packages inside consumer packages

```
check that no git changes are present

for each package x:
   for each package y:
       if y has x as dependency:
           validate that y uses the latest version of x

if some changes were made:
   run yarn
```

 ---

Q: Why `run_yarn` step was removed from CircleCI flow?
A: For *-stable branches, there are no yarn workspaces and all packages are specified as direct dependencies, so if we update `react-native/assets-registry` to the next version, we won't be able to run `yarn` for react-native root package, because updated version is not yet published to npm

To avoid this, we first need publish new versions and then update them in consumer packages

 ---
The final flow:
1. Developer uses `node ./scripts/bump-all-updated-packages` to bump versions of all updated packages.
2. Commit created from step 1 being merged or directly pushed to `main` or `*-stable` branches
3. A workflow from CircleCI publishes all updated versions to npm
4. Developer can use `align-package-versions.js` script to create required changes to align all packages versions

Reviewed By: cortinico

Differential Revision: D42295344

fbshipit-source-id: 54b667adb3ee5f28d19ee9c7991570451549aac2
2023-01-10 13:23:06 -08:00
Nicola Corti 97e844fad0 Update fingerprint for SSH deploy key (#35791)
Summary:
Rotating a private SSH key we had left to rotate.

## Changelog

[INTERNAL] - Update fingerprint for SSH deploy key

Pull Request resolved: https://github.com/facebook/react-native/pull/35791

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D42413025

Pulled By: cortinico

fbshipit-source-id: 571f304e8cc2dad19c41e5413ed3c7d4c078ba60
2023-01-09 04:34:41 -08:00
Nicola Corti 44cb07b40a Remove unused .netrc file from CircleCI (#35785)
Summary:
Removing a stale configuration that was configuring username/password before publishing to NPM. This is effectively unused + the Github Token there is invalid therefore can be removed.

## Changelog

[INTERNAL] - Remove unused .netrc file from CircleCI

Pull Request resolved: https://github.com/facebook/react-native/pull/35785

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D42385163

Pulled By: cortinico

fbshipit-source-id: 0dbbf44459d59f792da4221d6100800a2f4efda2
2023-01-06 07:19:02 -08:00
Riccardo Cipolleschi cb9eaa6db0 Refactor hermes logic to make it branch agnostic (#35709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35709

This change refactors the logic to choose which version of hermes we have to pick

## Changelog:
[iOS][Changed] - Refactor hermes choosing logic

Reviewed By: cortinico, dmytrorykun

Differential Revision: D42211405

fbshipit-source-id: d19c0f2c523c5596d18a1f904e3b26d96ea1a77a
2023-01-05 06:58:38 -08:00
Ruslan Lesiutin 7f29357c7c refactor(scripts): use forEachPackage instead of `yarn workspaces info` (#35633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35633

Changelog: [Internal]

These changes add usage of `forEachPackage` as a replacement for `yarn --json workspaces info`.

This is because at some point in release cycle there is a script which removed `workspaces` block from react-native's `package.json`, so `yarn --info workspaces info` produces an error

Reviewed By: cortinico

Differential Revision: D41996732

fbshipit-source-id: 2c62c1a5eb41d711c563f9f7b0de3d67fc11823d
2022-12-14 03:04:06 -08:00
Ruslan Lesiutin 83afdafae4 feat(react-native-github): automate publishing bumped packages via circleci (#35621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35621

Changelog: [Internal]

1. Added `for-each-package.js` script. This can be used to iterate through all of the packages inside `/packages` with the access to package manifest. This soon can be used as a replacement for `yarn workspaces --info`
2. Added `find-and-publish-all-bumped-packages.js` script. This script iterates through all the packages and detects if the version was changed via `git log -p` (same as `git diff`). If so, it tries to publish it to npm.
3. Added corresponding job and workflow to CircleCI config, which will use this script

Reviewed By: cortinico

Differential Revision: D41972733

fbshipit-source-id: c5d0ed5b852b744a699ecb88861ea3e82200e1f3
2022-12-14 02:17:16 -08:00
Dmitry Rykun 65e0f79f69 Backport fix: update CircleCI config to use the RN version in Hermes workspace caching (#35617)
Summary:
This is a backport of 0edcbc30c8. It fixes inconsistencies in caching strategies of Hermes tarball and Hermes workspace on CircleCI.

## Changelog

[INTERNAL] [FIXED] - Update CircleCI config to use the RN version in Hermes workspace caching.

Pull Request resolved: https://github.com/facebook/react-native/pull/35617

Test Plan:
1. Create and push a new branch.
2. Change version in. react-native/package.json
3. Push those changes.

Before:
CircleCI restores cached Hermes workspace for the old version.

After:
CircleCI creates new workspace for the new version.

Reviewed By: cipolleschi

Differential Revision: D41970943

Pulled By: dmytrorykun

fbshipit-source-id: 7e343b7a8d4b1c5a63016ec53538abe4ad7808cc
2022-12-13 04:19:43 -08:00
Blake Friedman d9666962f7 Fix test_windows by caching choco deps (#35399)
Summary:
A flakey CDN is 404'ing the Java dep.  Caching the Choco dependencies should stop this.

## Changelog

[Internal] [Fixed] - Cache Choco dependencies to stop erratic 404s on Java 8 install.

Pull Request resolved: https://github.com/facebook/react-native/pull/35399

Test Plan: Bump the PR to see if it's caching.

Reviewed By: huntie

Differential Revision: D41684462

Pulled By: blakef

fbshipit-source-id: f3eac9e8a00be33f7c3f0996f35abb63146cb3c4
2022-12-02 07:32:30 -08:00
Thibault Malbranche dc3355920d chore: rename normalize-color to normalize-colors (umbrella 480) (#34571)
Summary:
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - Rename normalize-color to normalize-colors as part of https://github.com/react-native-community/discussions-and-proposals/pull/480

Pull Request resolved: https://github.com/facebook/react-native/pull/34571

Reviewed By: cortinico

Differential Revision: D39235696

Pulled By: hoxyq

fbshipit-source-id: b6d5fcae9fb5c953c2f7b48f73a95cd883ff8f63
2022-12-01 08:46:57 -08:00
Riccardo Cipolleschi 4e8526c829 Add CircleCI tests for use frameworks (#35497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35497

In 0.71.0-RC.2, we had a regression in `use_frameworks!`.

This adds some CircleCI jobs to make sure we do not regress on those. It also updates the template to support these tests.

## Changelog
[iOS][Added] - CircleCI jobs to keep the use_framework! setup in check for the Old Arch

Reviewed By: cortinico

Differential Revision: D41551288

fbshipit-source-id: 531fabb1a7b6aceab2926bb83cf2887129df1776
2022-11-29 08:53:50 -08:00
shivenmian b7a85b59b5 chore: renamed react-native-codegen to @react-native/codegen (#34804)
Summary:
Renamed react-native-codegen package to react-native/codegen and updated references, without changing the folder name; part of RFC480 (https://github.com/facebook/react-native/issues/34692). Follow-up from https://github.com/facebook/react-native/pull/34578

## Changelog

[General] [Changed] - Renamed react-native-codegen package to react-native/codegen and updated references

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Pull Request resolved: https://github.com/facebook/react-native/pull/34804

Reviewed By: cortinico

Differential Revision: D39883584

Pulled By: hoxyq

fbshipit-source-id: 0ef384b75c6edd248b31e37b8f05f64b4d39ca6f
2022-11-28 08:28:51 -08:00
Ruslan Lesiutin 6f11b10a88 refactor(react-native-gradle-plugin): rename react-native-gradle-plugin to @react-native/gradle-plugin (#35480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35480

Changelog:
[General][Changed] - rename react-native-gradle-plugin to react-native/gradle-plugin

Reviewed By: cipolleschi

Differential Revision: D41532746

fbshipit-source-id: 67b936a211ec8b91a2a96ca22145cbea94ba3e8c
2022-11-25 10:29:36 -08:00
LeoTM f75b92a12b Bump node version from 16 to 18 (#35443)
Summary:
Node 18: https://nodejs.org/de/blog/announcements/v18-release-announce/

Node 16 EOL: 2023-09-11
https://nodejs.org/en/blog/announcements/nodejs16-eol/

Node 18 EOL: 2025-04-30

Follow-up
- https://github.com/facebook/react-native/pull/34171
- https://github.com/facebook/react-native/pull/32980

Ref
- https://github.com/react-native-community/docker-android/pull/187

cc ramonmedel cortinico gengjiawen

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[JavaScript] [Changed] - Bump node version from 16 to 18

Pull Request resolved: https://github.com/facebook/react-native/pull/35443

Test Plan: Everything builds and runs as expected

Reviewed By: cipolleschi

Differential Revision: D41531161

Pulled By: cortinico

fbshipit-source-id: 305888f55ed179f75bef34548aebf22fc2951308
2022-11-25 06:44:21 -08:00
Adam Foxman 5aead70e80 eslint config & plugin packages - prep for monorepo RFC (#34581)
Summary:
The [monorepo RFC](https://github.com/react-native-community/discussions-and-proposals/pull/480) calls for renaming:

* `react-native-community/eslint-config` -> `react-native/eslint-config`
* `react-native-community/eslint-plugin` -> `react-native/eslint-plugin`

It also calls for the versions to be aligned with the rest of main -- currently `0.72.0`.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General][Changed] - Renamed `react-native-community/eslint-config` to `react-native/eslint-config` v0.72.0 to align with other packages
[General][Changed] - Renamed `react-native-community/eslint-plugin` to `react-native/eslint-plugin` v0.72.0 to align with other packages

Pull Request resolved: https://github.com/facebook/react-native/pull/34581

Test Plan:
First test is to run `yarn lint`, and verify that output matches before and after this change.

Second test is to change the ESLint config to use the "old" packages (under `react-native-commnuity`) and run `yarn lint` to make sure that they work as expected. This is what customers will experience, until they manually move to the new ESLint packages.

Reviewed By: cortinico

Differential Revision: D41520500

Pulled By: hoxyq

fbshipit-source-id: a61e5ae15d5aaf11f0143a3b0257a60a03b1550b
2022-11-25 05:44:17 -08:00
Riccardo Cipolleschi 319631f003 fix: update CircleCI config to use the RN version in tarball caching (#35471)
Summary:
This PR updates the Cache strategy for the tarballs to include the React Native version we are building. In this way, when we publish a new Release/RC we are sure that we are going to rebuild a nmew
tarball. This should fix caching problems like:

- we have misconfigured the build script for the Hermes tarball, we then fix it, but we distribute the wrong cached artifacts
- the cached artifact has the wrong version

## Changelog

[Internal] - Fixed Hermes Tarball Cache Logic

Pull Request resolved: https://github.com/facebook/react-native/pull/35471

Test Plan:
1. CircleCI
The real way to check this is in the next RC cycle or in the next nightly.

Reviewed By: cortinico

Differential Revision: D41530651

Pulled By: cipolleschi

fbshipit-source-id: 45e8fd3b62c8e108d393d9463ff6762dfc6d3ec8
2022-11-25 05:14:42 -08:00
Ruslan Lesiutin 6a45f2ce79 refactor(circleci/template): publish all packages to Verdaccio before template initialization (#35459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35459

Changelog:
[Internal] [Changed] - now bootstrapping Verdaccio before template app initialization, this is required because react-native migh depend on some package which version is not yet published to npm

Reviewed By: cipolleschi

Differential Revision: D41521496

fbshipit-source-id: 6183ab02c697d9d08e9dca5b323bd7a11a749c3a
2022-11-24 13:56:09 -08:00
Nicola Corti 50c6ee40ea Build RNTester Release inside buildAll (#35464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35464

This extends the buildAll task to build both RNTester Debug and Release
We can finally do this now as debug and release are fully isolated
and don't clash on each other.

Changelog:
[Internal] [Changed] - Build RNTester Release inside buildAll

Reviewed By: cipolleschi

Differential Revision: D41521995

fbshipit-source-id: 37ec5e3b55080372f01f2736c1bb020b3776b193
2022-11-24 11:22:54 -08:00
Nicola Corti 09843a0094 Store RN Tester and Template APKs for Android on CI (#35463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35463

This will allow us to easily retrieve debug/release APK for
both RN-Tester and the Template jobs for every run of the CI.

Changelog:
[Internal] [Changed] - Store RN Tester and Template APKs for Android on CI

Reviewed By: cipolleschi

Differential Revision: D41521977

fbshipit-source-id: e2ed60921fd005425d3915323b18dde2851e7fc2
2022-11-24 10:21:57 -08:00
Nicola Corti 0c6a4f8c59 Remove AVD code from Android CI
Summary:
We don't really run AVD (Emulators on CI) so those steps
are entirely unnecessary and skipped every time. I'm removing them.

Changelog:
[Internal] [Changed] - Remove AVD code from Android CI

Reviewed By: cipolleschi

Differential Revision: D41521976

fbshipit-source-id: 2737ef0dfc84198ab9b837819c16ae46280ba43f
2022-11-24 10:21:57 -08:00
Ruslan Lesiutin e11cfe98e9 feat(react-native/template): use verdaccio to publish local packages before testing template app (#35444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35444

Changelog:
[Internal][Changed] - now using Verdaccio to publish necessary packages for template app

- Adds script `/scripts/template/install-dependencies.js`, which incapsulates the logic of installing dependencies of template app
- The idea of the script is to run verdaccio and publish all necessary packages to node_modules, since these packages might not yet be present on npm
- This should also potentially resolve some template app test failures on CircleCI related to package-ifying Animated, VirtualizedList, FlatList modules

Reviewed By: cortinico

Differential Revision: D41498086

fbshipit-source-id: 48fbbb1c9334e7a9e7657e6275b7b04f9ce290b5
2022-11-23 13:20:00 -08:00
Riccardo Cipolleschi f12b12c999 Improve version checks to avoid mistakes in the versioning (#35296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35296

This change adds some version checks and enforces that every version matches some specific format based on the build type we are trying to run.

## Changelog
[General][Changed] - Improve version checks

Reviewed By: cortinico

Differential Revision: D41161756

fbshipit-source-id: 4172195c5e031c1eaf7b33bb74f381c04e9adaf5
2022-11-21 10:52:17 -08:00
Riccardo Cipolleschi e36c492ace Remove version from the tarball (#35285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35285

While doing the release 0f 0.71.0-RC0, we noticed that having the RN version in the hermes tarball was causing more harm than good.

With the version in the name, we ended up with multiple tarballs for debug and release and we were not able to explicitly pick the right tarball given a build.

This change remove the version from the tarball name.

## Changelog
[General][Changed] - Remove React Native version from Hermes tarball name

Reviewed By: lunaleaps

Differential Revision: D41156353

fbshipit-source-id: 8899d5e1e1555bc728d923f3b78d1261e6ff09c7
2022-11-14 08:31:30 -08:00
Oleksandr Melnykov 394486eec5 Bump OSS Android build to SDK 33 (#35196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35196

Changelog:
[Android][Changed] - Bump Android compile and target SDK to 33

Reviewed By: cortinico

Differential Revision: D41007003

fbshipit-source-id: e7866107fdcfafa778faa6c7f31835b8dd15647a
2022-11-08 19:12:02 -08:00
Lorenzo Sciandra cfa25e0a4a fix(release scripts): backport fixes from 0.71 into main (#35258)
Summary:
This PR backport two fixes we did in 0.71 to unblock the release process:
* the change in `publish-npm` is needed because of the introduction of .strict() from 4f3ca8facf
* the removal of the other script (added originally here e4b5d3eec9) is because:
  1) that step is not needed anymore (we don't publish/upload hermes artifacts to the GH release)
  2) by the time this job gets run the release crew has already setup the GH release
  3) the logic for the versioning was broken and even on the 0.71-rc pipeline it was tagging stuff as 1000.0.0

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Fixed] - Fix release scripts for "release" pipeline scenario

Pull Request resolved: https://github.com/facebook/react-native/pull/35258

Test Plan: The fact that 0.71-rc0 was released is the  for this.

Reviewed By: jacdebug

Differential Revision: D41120888

Pulled By: cipolleschi

fbshipit-source-id: 06d108f0659ad1db53c6324fe1d735f52c34a3c5
2022-11-08 10:03:29 -08:00
Riccardo Cipolleschi ddba780c0c fix: Change checkout cache strategy (#35259)
Summary:
This PR updates he cache strategy for the `checkout_with_cache command`.

The previous strategy was using three keys in descending priority order to restore from the cache:
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}`
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}`
*`<< parameters.checkout_base_cache_key >>-{{ arch }}`

When it saves, it always saves using the first key.

The restore works as it follows:
1. It tries to restore the cache using the first key
2. If it fails, it checks whether there is a cache hit for a key that matches the second key as a pattern
3. If it fails, it checks whether there is a cache hit for a key that matches the third pattern
4. Otherwise, it is a cache miss.

This does not work well. Imagine that you submit some code in commit `xxxx` for branch `abc`.
The CI run the first time, it misses all the three keys and checks out the code normally.
Then, it stores the checked out code in the `checkout_key-abc-xxxx` key.

Then, you submit a commit `yyyy` in the same branch.
The CI starts, it tries with the key `checkout_key-abc-yyyy` but it misses
It tries with the key `checkout_key-abc` and it finds the cache for `checkout_key-abc-xxxx` and it restores it, forgetting about your changes.

While doing the release, we created a tag in a commit X. Then we manually had to remove it, but the CI had a cached version of .git with the tag for
the `0.71-stable` branch. And the release failed because the tag was already existing.

### Why this should work

With this solution, we are going to cache using the commit. If there is no cache for a specific commit, it will be a miss. It won't try to be smart and
retrieve the code from previous caches.

This should prevent stale caches and if we manually remove a tag, and then we do a new commit, it should work.

This is a good trade-off that allows to pay the checkout cost only for the first batch of jobs of the pipeline.

**NOTE:** This still won't work if we don't do a new commit.

## Changelog

[General] [Fixed] - Change Cache strategy to avoid cache bumps in Release

Pull Request resolved: https://github.com/facebook/react-native/pull/35259

Test Plan: 1. CircleCI must be green

Reviewed By: jacdebug

Differential Revision: D41120895

Pulled By: cipolleschi

fbshipit-source-id: 2b45da01803197dbe4a25a313a9dfc53a976d096
2022-11-08 06:50:25 -08:00
Nicola Corti 6a43fafd78 Cleanup the template documentation after RNGP & hermesEnabled to gradle.properties (#35108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35108

I've rewritten the comment in the android/app/build.gradle.
They were really old, contained wrong links and most of the people ignored it.

I've also moved the enabling of Hermes to the `gradle.properties` file.
RNGP still supports the old method, but we must be sure that we notify
library authors if they were reading project.ext.react.enableHermes in the past
(also the website needs to be updated).

I've also cleaned up the CircleCI setup as now we can specify Hermes enabled/disabled
via the CLI (this will also make easier to do e2e testing).

Changelog:
[Android] [Changed] - Cleanup the template documentation after RNGP & hermesEnabled to gradle.properties

Reviewed By: cipolleschi

Differential Revision: D40762872

fbshipit-source-id: 2c09245e0a923faac53cc6c8a89e99788ae47f8a
2022-10-27 14:40:27 -07:00
Nicola Corti 8b8a5e06ce Bump the Android Docker image to 6.0 (for NDK 23) (#35079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35079

This bumps the Docker image for React Native Android to 6.0
shipping the NDK 23 with it, finalizing all the work needed
to support NDK 23.

Changelog:
[Internal] [Changed] - Bump the Android Docker image to 6.0 (for NDK 23)

Reviewed By: cipolleschi

Differential Revision: D40675449

fbshipit-source-id: 5fb53080ce796263cd592dbc489743e6295060ba
2022-10-25 13:20:03 -07:00