Commit Graph

19 Commits

Author SHA1 Message Date
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Riccardo Cipolleschi d16793dbe0 Update publishing to Sonatype for double publishing (#40781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40781

## Changelog:
[Internal] - Allow Sonatype to double publish SNAPSHOTS

Reviewed By: cortinico

Differential Revision: D49914824

fbshipit-source-id: 830e20eb51ffdf5b7c4452972c436ca0cb4da5a9
2023-10-11 10:09:57 -07:00
Riccardo Cipolleschi f6197cd846 Download artifacts from CI to speed up testing (#37971)
Summary:
Testing releases takes a lot of time because we have to build locally several configurations.
However, the artifacts that we build locally are also built in CI.

The goal of this PR is to implement a mechanism to download those artifacts from the CI instead of build locally, so that testing the release locally can take much less time.

As an example, the full test cycle can take more than 2 hours given that we need to repackage and rebuilt the app from the template.

My plan is to add a table with the time saved once the PR is done

### TODO:
- [x] Download Hermes tarball for RNTester iOS
- [x] Download Hermes APK for RNTester Android
- [x] Download JSC APK for RNTester Android
- [x] Download Packaged version of React Native to create a new app
- [x] Use the downloaded React Native to initialize an app from the template
- [x] Download Maven Local prebuilt in CI and use it for Template Android app

### Time Savings

| Setup | Before [s] | After [s] | Notes |
| --- | --- | --- | --- |
| iOS RNTester Hermes | 339.68 | 194.86 | Time saved by downloading Hermes rather then building it |
| iOS RNTester JSC | 129.80 | 123.35 | Not significant, expected as this workflow did not change
| Android RNTester Hermes | 1188.82 | 5.28 | Huge improvement: we download the APK rather then build |
| Android RNTester JSC | 103.10  | 6.28 | Huge improvement: we download the APK rather then build  |
| Creating the RNTestProject | 2074.82  | 191.16 | We download Maven, the packaged version of RN and Hermes instead of building from scratch |

## Changelog:
[Internal] - Speed up Release testing by downloading the CircleCI artifacts

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

Test Plan: - Tested the script locally

Reviewed By: cortinico, dmytrorykun

Differential Revision: D46859120

Pulled By: cipolleschi

fbshipit-source-id: 8878ebaccf6edb801f8e9884e2bf3946380aa748
2023-07-21 07:15:53 -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
Lorenzo Sciandra 7e17d26060 fix(scripts): remove leftover code for tmpPublishingFolder (#35528)
Summary:
When this was done https://github.com/facebook/react-native/commit/ad43deca232b208956f44d46151571ba8064dd68 (most likely because the scripts folder is not type-checked) some references to this script were left lying around.

This PR takes care of it.

## 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] - remove leftover code for tmpPublishingFolder

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

Test Plan: Running  `yarn test-e2e-local` doesn't insta-fail.

Reviewed By: cortinico

Differential Revision: D41656151

Pulled By: GijsWeterings

fbshipit-source-id: 5fcf7fabce30076f90d92087a4f1e429903dfc0b
2022-12-01 16:38:42 -08:00
Riccardo 8b8f4f3efd Bypass tag check in dry run (#35428) (#35470)
Summary:
When dry-run in stable branch, the tag already exists. We are bypassing the tag-existence check when in a dry-run to have the CI pass

## Changelog

[General] [Fixed] - Bypass tag version check when dry-run

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

Test Plan:
CircleCI
It worked for RC1 and RC2

Reviewed By: cortinico

Differential Revision: D41529648

Pulled By: cipolleschi

fbshipit-source-id: d4d7f5534f86c2cf10b05e0d4cab950e4902d8df
2022-11-25 10:53:14 -08:00
Lorenzo Sciandra c4959b9806 fix(e2e script): backport from 71 fixes to the E2E script (#35477)
Summary:
Because the /scripts folder for some reason is not typechecked at all, some changes broke the script and went undetected until we tried running it. This is a backport of those fixes:
* https://github.com/facebook/react-native/commit/67c373ff3a4ab0dfaaa752f08f6cc22657d4dadc
* https://github.com/facebook/react-native/commit/6107793fda11a85297b3a3e2b8f259930d6c0f41
* https://github.com/facebook/react-native/commit/6107793fda11a85297b3a3e2b8f259930d6c0f41

Also, it's backporting an improvement to the e2e local script clean to remove the hermes-engine pod cache which has been proven annoyingly in the way while testing:
* https://github.com/facebook/react-native/commit/9979e38c7093ba78db5d5b4b11456c78592ea8c5

## Changelog

[Internal] [Fixed] - Fix e2e script not working and augment clean script

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

Test Plan: Works on 0.71 ;)

Reviewed By: dmytrorykun

Differential Revision: D41530272

Pulled By: jacdebug

fbshipit-source-id: d45650d919ad5ef08438b307f122817d72771f46
2022-11-25 03:26:20 -08:00
Riccardo Cipolleschi 850f855eb6 chore: fail prepare package for release if tag exists (#35305)
Summary:
This PR makes sure that the `preapre_package_for_release` script fail fast if there is already a tag for the desired version
on github.

## Changelog

[General] [Added] - Make the `prepare_package_for_release` fail if there is already a git tag with that version

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

Test Plan:
Tested manually. The script is currently only invoked during the release process.
<img width="1238" alt="Screenshot 2022-11-10 at 12 24 03" src="https://user-images.githubusercontent.com/11162307/201090947-274c1b1c-0b6a-4619-bc85-fa60e5eaeee1.png">

Reviewed By: cortinico

Differential Revision: D41403159

Pulled By: cipolleschi

fbshipit-source-id: fb87df345b14568c750482e5c68be53551a9acbb
2022-11-21 07:12:56 -08:00
Nicola Corti 55b1670aa6 Void the Maven coordinates for react-native and hermes-engine (#35379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35379

This diff moves the publishing coordinates from:
```
com.facebook.react:react-native
com.facebook.react:hermes-engine
```

to

```
com.facebook.react:react-android
com.facebook.react:hermes-android
```

I've picked those they are the most layout friendly when building from source, but we can discuss if we want others.
I've updated the Gradle plugin to have a dependencySubstitution rule + update the template with those changes.

It should now be possible to still use `implementation("com.facebook.react:react-native:+")` inside libraries
on 0.71+ and RNGP will resolve dependencies correctly.

Changelog:
[Android] [Changed] - Void the Maven coordinates for react-native and hermes-engine

Reviewed By: cipolleschi

Differential Revision: D41380525

fbshipit-source-id: 91e059fa261acb89bee7ca0c79c30c3d856a2c80
2022-11-18 04:46:16 -08:00
Nicola Corti 90b6735c3b Invoke closeAndReleaseSonatypeStagingRepository in the publish gradle invocation (#35272)
Summary:
This PR ports back into main the changes required to properly close the SonaType repository on Maven

## Changelog

[General] [Fixed] - Close the Maven repository properly

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

Test Plan: We tested these changed in 0.71-stable branch when releasing 0.71.0-RC.0

Reviewed By: christophpurrer

Differential Revision: D41154965

Pulled By: cipolleschi

fbshipit-source-id: 74dd46e8fabf3baef544342282829c70d92f671f
2022-11-10 08:57:07 -08:00
Héctor Ramos ad43deca23 Remove unused saveFilesToRestore function
Summary:
The method that would restore these files was removed in https://github.com/facebook/react-native/pull/34846. The action performed by `saveFilesToRestore` is no longer necessary (thanks kelset for pointing this out).

Changelog: [internal]

Reviewed By: cortinico

Differential Revision: D41003911

fbshipit-source-id: bbc057ac450e7f134c4664173291ca56c18f1b17
2022-11-03 23:37:45 -07:00
Lorenzo Sciandra c540ff7bd1 fix(local-e2e-script): add logic to handle maven local for iOS and Android accordingly (#35104)
Summary:
This PR is a follow up of https://github.com/facebook/react-native/pull/35075 and https://github.com/facebook/react-native/commit/1546666a6d713ef756b2f11de9581e3b2bbe08dc to ensure that even in the local e2e testing scenario the new maven approach is followed - without this, RNTestProject on Android won't work, like so:
<img width="1905" alt="Screenshot 2022-10-27 at 12 15 38" src="https://user-images.githubusercontent.com/16104054/198334105-30fb2037-4e7c-4814-8c3f-2412ba0bd49f.png">

And iOS will always build everything from source every time.

This PR addresses both by generating the artifacts locally, and passing them to RNTestProject as if they were coming from a url (mimicking as closely as possible the behaviour for the final user)

In doing so, there's been some refactoring to prep the ground for follow up work.
* refactor CI to rely less on scripts directly in the CircleCI config, but invoke .js ones
* we should be able to trigger more the "manual" artifacts generation so that it will only happen once between RNTester and RNTestProject, and we can pass existing artifacts to the other flows.
* once all of this in place, a very good improvement would be to be able to download the maven artifacts kind of like nightlies and stables do. This will only be viable by checking that there's no local changes, after which there needs to be logic to pull down from CircleCI the artifacts based on git commit <-> circleCI job references.
 ---

While at it, I've also fixed the hermes-engine podspec logic for detecting if it's on CI: basically the local e2e script needs to align with the changes done here: https://github.com/facebook/react-native/commit/4b512077354eb4702ce144e9958d7513c1607275

but as you can see there, the condition was actually inconsistent across the various files, so realigned to `CI === 'true'`. We probably didn't catch that so far 'cause the other condition in the hermes podspect (existence of `hermestag_file`) is only true on release branches and this new logic has not been in any release branches yet.

## 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] - add logic to local e2e script to handle maven local for iOS and Android accordingly

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

Test Plan:
Run ` yarn test-e2e-local -t RNTestProject -p Android` successfully.

Run ` yarn test-e2e-local -t RNTestProject -p iOS` successfully. On the pod install stage, you will see `[Hermes] Using pre-built Hermes binaries from local path.`

Reviewed By: dmytrorykun

Differential Revision: D40893239

Pulled By: cipolleschi

fbshipit-source-id: a31217ec4f177383c62292d00fabc4cbe4391cfd
2022-11-02 08:23:50 -07:00
Nicola Corti 76f7084957 Gate the Maven Central publishing to 0.x version. (#35109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35109

This is just a safety check to make sure we don't accidentally
publish a 1.x or a 1000.x version on Maven Central by mistake.

Changelog:
[Internal] [Changed] - Gate the Maven Central publishing to 0.x version.

Reviewed By: mdvacca

Differential Revision: D40767782

fbshipit-source-id: 58f2906c3b01bfd0fd388a300ba303b289633d4e
2022-10-27 20:47:44 -07:00
Nicola Corti 92d41c5e96 Remove the --dry-run gate from publishing to Sonatype
Summary:
This remove a flag to effectively go publishing to Sonatype.
The idea was to protect us against accidentally publishing a nightly as a stable release.
We need to remove this before RC0

Changelog:
[Internal] [Changed] - Remove the --dry-run gate from publishing to Sonatype

Reviewed By: cipolleschi

Differential Revision: D40687038

fbshipit-source-id: e6821905f41899430813f9575f17a5068b05a9bb
2022-10-26 13:05:23 -07:00
Nicola Corti c96c76eb91 Update the template to use RNGP (#35075)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075

This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab

Changelog:
[Android] [Changed] - Update the template to use RNGP

Reviewed By: cipolleschi

Differential Revision: D40673732

fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
2022-10-25 13:13:14 -07:00
Nicola Corti 3d05bac587 Unbreak Nightly job by providing a GPG key as base64 encoded.
Summary:
It seems like CircleCI is not handling well env variables with \n in it.
I'm moving it over to a base64 encoded string and I'm extending the publish
scripts to base64 decode the key.

Changelog:
[Internal] [Changed] - Unbreak Nightly job by providing a GPG key as base64 encoded.

Reviewed By: cipolleschi

Differential Revision: D40426438

fbshipit-source-id: a60a7e7ad71580e81e675c84008d2712712e42a6
2022-10-17 04:07:37 -07:00
Nicola Corti 5d8a712fd5 Configure CircleCI to publish artifacts to Maven Central (#34983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34983

This sets up our CircleCI logic to publish artifacts to Maven Central.
I will check if tomorrow's nightly successfully landed on Maven Central
Snapshot repository.

I've added a --dry-run to the the close and release step of the publishing
to avoid accidentally publishing to Maven Central. We'll remove this if
we decide to go with the Maven Central publishing.

Changelog:
[Internal] [Changed] - Configure CircleCI to publish artifacts to Maven Central

Reviewed By: jacdebug, huntie

Differential Revision: D40377691

fbshipit-source-id: 36a74074ea95097bb7268352e40f4d2670f3cd65
2022-10-14 07:30:29 -07:00
Lorenzo Sciandra 8486b4c5ee chore: re-add fixes from Kudo's PR 34846 (#34861)
Summary:
I'm not sure why, but my commit https://github.com/facebook/react-native/commit/97f5ef05e6396e9694e4b021e830b71c5900cd3c landed despite the PR still having a couple of merge conflicts from after Kudo's PR https://github.com/facebook/react-native/issues/34846 being merged.

What happened is that basically it just "overwrote" those chances, so this PR is just a fix for that.

## 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] [Changed] - re-adding Kudo's fix for nightly build

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D40059290

Pulled By: cortinico

fbshipit-source-id: 38e495a0dbecd39e836d15aa2a1a30e7354d9813
2022-10-04 09:06:01 -07:00
Lorenzo Sciandra 97f5ef05e6 infra(e2e): rework local E2E script (#34513)
Summary:
This is a long time coming effort to improve the situation around the local e2e script that in the release crew: the current bash-based script is quirky at best, and what you end up generating as a sample project is not really a true sample project. This is where this PR comes in: it migrates the flow from `./scripts/test-manual-e2e.sh` to `yarn test-e2e-local <options>`.

Here's the current shape of the options:

```sh
Options:
  --help          Show help                                            [boolean]
  --version       Show version number                                  [boolean]
  -t, --target      [choices: "RNTester", "RNTestProject"] [default: "RNTester"]
  -p, --platform                    [choices: "iOS", "Android"] [default: "iOS"]
  -h, --hermes                                         [boolean] [default: true]
```

The idea is to change it so that you can just run the script, and it will do that one specific thing "well", without the tester needing to do anything aside from actually testing the app once it's open.

Some of the key changes:
* tries to stick to the patterns of the other established *.js based scripts, in terms of tooling and approach (and even refactor parts that can be shared with other scripts) - like the android artifacts generation
* no need to start the android emulator on the side
* no need to start Metro on the side
* RNTester iOS will open up on the simulator (no Xcode open that then you need to press)

Things that still need work:
* see the #fixme and #todo in comments
* because we rely on exec, the output sent back is not formatted/shaped correctly so it's a bit more noisy/chaotic - but can't handle it right now because the package we use doesn't allow it - see https://github.com/shelljs/shelljs/issues/86

## 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] [Changed] - Migrate bash E2E local testing script to new JS based command

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

Test Plan:
To test the script, you can run it passing the options showed above; this is the current situation:
* RNTester iOS Hermes 
* RNTester Android Hermes 
* RNTester iOS JSC 
* RNTester Android JSC 
* RNTestProject Android Hermes 
* RNTestProject iOS Hermes 
* RNTestProject Android JSC 
* RNTestProject iOS JSC 

Reviewed By: cortinico

Differential Revision: D39814692

Pulled By: cortinico

fbshipit-source-id: d4791798aaad764c6a3757269b7636f847ccf2ca
2022-10-04 04:56:44 -07:00