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

168 Коммитов

Автор SHA1 Сообщение Дата
Alex Hunt 166fdc5125 Create wrapper class for Hermes CDPAgent + CDPDebugAPI (#43352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43352

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Adds the `HermesRuntimeAgentDelegateNew` class to provide a swap-in replacement for the existing `HermesRuntimeAgentDelegate` when we enable this via an incoming feature flag.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53810356

fbshipit-source-id: c63684252230a747ecf0bd8cbb6f4e22052ed9bf
2024-03-08 07:29:22 -08:00
D N f043c832d1 chore: [Github Actions] Update actions/stale to the latest version (#43312)
Summary:
- Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/stale@v5. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
  - from last run: https://github.com/facebook/react-native/actions/runs/8136278191

## Changelog:

[INTERNAL] [CHANGED] - [Github Actions] Update actions/stale to the latest version

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

Test Plan: Run workflow once

Reviewed By: cortinico

Differential Revision: D54506678

Pulled By: arushikesarwani94

fbshipit-source-id: 530ed1f0ff5571ee124bc78bac11c6584a9af60c
2024-03-05 03:43:32 -08:00
Luna Wei 9f85a249fa Link to releases repo for upgrade issues (#43295)
Summary:
Changelog: [Internal]

We're moving upgrade issues to https://github.com/reactwg/react-native-releases/issues/new/choose

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

Reviewed By: cortinico, cipolleschi

Differential Revision: D54442540

Pulled By: lunaleaps

fbshipit-source-id: a079935a290f56d2932c5fc588e96a68e1c13f9a
2024-03-04 08:55:00 -08:00
Riccardo Cipolleschi eca78c30c7 Add hermes commit to github action cache (#43067)
Summary:
The test_ios_rntester-Hermes which runs in github actions was created to make sure that recent commits on Hermes/main won't be breaking React Native
However, we discovered that the job was using a cached version of hermes and it was't really downloading the latest hermes every time.

With this change, the cocoapods cache will be invalidated whenever there is a commit on hermes/main, forcing the job to reinstall the dependencies when that happens.

bypass-github-export-checks

## Changelog:
[internal] - Fixed GH Action job to properly refetch newest version on Hermes when it changes.

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

Test Plan:
Github Actions must be green and the action should show that a new version of Hermes is downloaded.

The commit is downloaded here:
 {F1457505882}

And it is used here, notice the last hash:
 {F1457505989}

Reviewed By: motiz88

Differential Revision: D53853963

Pulled By: cipolleschi

fbshipit-source-id: 7a65dd72a21b6da12b826273d1c92bb90b678652
2024-02-16 06:59:10 -08:00
m-nakamura145 dd4f15bf08 chore: Bump actions/checkout (#42952)
Summary:
GitHub is [planning to upgrade to Node 20](https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/). Versions prior to actions/checkout v3 use an outdated version of node, so we will upgrade to actions/checkout v4, where [Node 20 is the default](https://github.com/actions/checkout/releases/tag/v4.0.0).

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

chore: Bump actions/checkout

Pick one each for the category and type tags:

[INTERNAL] [FIXED] - chore: Bump actions/checkout

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [FIXED] - chore: Bump actions/checkout

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

Reviewed By: cipolleschi

Differential Revision: D53655117

Pulled By: cortinico

fbshipit-source-id: 7c05e6ac2cb71c9d20c0b28b183cada6856f0a2d
2024-02-12 02:12:40 -08:00
Blake Friedman 9c0fe734fb constrain on github.actor
Summary: Currently rejecting all users, use the [github.actor](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context:~:text=The%20username%20of%20the%20user%20that%20triggered,run%20(github.triggering_actor)%20has%20different%20privileges.)

Reviewed By: hoxyq

Differential Revision: D53275232

fbshipit-source-id: 54bbbdb857db6c642814953832e0ffdc55505deb
2024-01-31 13:12:47 -08:00
Blake Friedman 82e9a5e4f7 Add Github Action to mirror partner's nightly CI results (#42744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42744

This adds a nightlies-feedback workflow, which our partners can get permission to mirror the results of their nightlies CI workflows.  We do this to use our internal tools that are restricted to Meta owned Github projects.

The benefit to partners is that they can add this step to their workflow:

```
      - if: ${{ success() || failure() }}
        env:
          OUTCOME: ${{ contains(steps.*.conclusion, 'failure') && 'fail' || 'pass' }}
        run: |
          curl -X POST \
               -H "Accept: application/vnd.github.v3+json" \
               -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
               https://api.github.com/repos/facebook/react-native/actions/workflows/nightlies-feedback.yml/dispatches \
               -d "$(printf '{"ref":"main","inputs":{"outcome":"%s","stage":"needs_an_action","link":"http://github.com/some/action","version":"%s"}}' "$OUTCOME" "${{ inputs.version }}" )"

```

### Feedback:
It's complicated, but there are ways to simplify this for our users.  I'd like to prove out that it's valuable first with Expo.

### Limits:

There's certainly a lot of room for improvement, which we could provide with a published action (populate the ref correctly, simplify gathering the outcome, labelling of failing step correctly, etc...).

### Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53229996

fbshipit-source-id: 10e4ba5b5fd85935b1b03aaafa41ef8b96d2faca
2024-01-31 09:49:08 -08:00
Nicola Corti 38d07eb284 Adds "Needs: Author Feedback" if "Needs: Repro" is applied
Summary:
As the title says, if we discover that an issue needs a repro, then we should also apply
the "Needs: Author Feedback" as that will make the issue stale quicker (30 days) rather than (90)

Changelog:
[Internal] [Changed] - Adds "Needs: Author Feedback" if "Needs: Repro" is applied

Reviewed By: NickGerleman

Differential Revision: D51895945

fbshipit-source-id: 3ed651aec96795ada3e7c28b0f1e68d68f7fc870
2023-12-07 02:56:49 -08:00
Nicola Corti bdcc9d0937 Refresh the New Issue template (#41800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41800

I've cleaned up the new issue template:
1. Added Expo to the template selector list
2. Added a short blurb with relevant links at the beginning of every issue template
3. I've added a dedicated field for reproducer and one for extra
4. I've added rendering to the react-native info block
5. I've added another rendered blog for stacktraces.
6. I've added a drop-down item for affected platform

Changelog:
[Internal] [Changed] - Refresh the New Issue template

Reviewed By: GijsWeterings

Differential Revision: D51847659

fbshipit-source-id: 565a2dcab4913825f441e2315ae9b4dd34fd2f4f
2023-12-05 08:18:51 -08:00
Riccardo Cipolleschi 19945ad83b Add Github Action to add a commit with #run-e2e-tests (#41311)
Summary:
https://github.com/facebook/react-native/issues/41308 introduce the possibility to run e2e tests if a commit contains #run-e2e-tests in the commit message.
This PR builds on top of that, and let users to run e2e tests by adding a comment with with #run-e2e-tests

## Changelog:
[Internal] - Allow to run e2e tests from comments

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

Test Plan: Not sure it can be tested until the PR is merged... ¯\_(ツ)_/¯

Reviewed By: dmytrorykun

Differential Revision: D51111543

Pulled By: cipolleschi

fbshipit-source-id: e6c55950552f03830fa35c89d385ab9b17f8facb
2023-11-09 05:53:47 -08:00
Riccardo Cipolleschi 475b835e43 Add Hermes Xcode integration test to GH Actions (#41187)
Summary:
After disabling the E2E tests, we lost a test that was verifying that Hermes works well with the latest version of React Native for iOS
This change introduce this test back in GH actions

## Changelog:
[Internal] Add tests for Hermes-Xcode integration to GH Actions

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

Test Plan: CI is green 🤞

Reviewed By: NickGerleman

Differential Revision: D50737860

Pulled By: cipolleschi

fbshipit-source-id: f4bc09be879af7aba0ca42f1b7e407a5d5dc0986
2023-10-31 09:37:24 -07:00
kacperkapusciak 54d70cf0c6 Prevent check-for-reproducer action trigger on Umbrella and old issues (#38664)
Summary:
This PR resolves problems with too spammy `check-for-reproducer` action triggering on very old and most prominently the Umbrella issues.

Also, it brings back triggering on edited issues removed in https://github.com/facebook/react-native/pull/38634

Related to https://github.com/facebook/react-native/issues/35591

## Changelog:

[INTERNAL] [FIXED] - Prevent check-for-reproducer action trigger on Umbrella and old issues

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

Test Plan: <img width="470" alt="image" src="https://github.com/facebook/react-native/assets/39658211/1d840145-1e4f-43c5-a3ea-bc16e61071ef">

Reviewed By: cipolleschi

Differential Revision: D47868536

Pulled By: cortinico

fbshipit-source-id: fd78c38145c76f3867a41439aee5d087f38c85d2
2023-07-28 08:50:35 -07:00
Nicola Corti ad91518fed Let check-for-reproducer run only on newly created issues. (#38634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38634

To reduce the noise of the `check-for-reproducer` bot, this restricts the event
that trigger the bot to only the issue creation.

Changelog:
[Internal] [Changed] - Let check-for-reproducer run only on newly created issues

Reviewed By: cipolleschi

Differential Revision: D47792374

fbshipit-source-id: 738a9342899e234022029e94f43b0dccebc21819
2023-07-26 03:53:59 -07:00
Nicola Corti bae0016dc9 Properly split the "Too Old Version of React Native" message
Summary:
The bot message is split in a wrong way:
https://github.com/facebook/react-native/issues/38603#issuecomment-1648749441
I'm updating it to use `<br/><br/>` instead which renders correctly inside tables.

Changelog:
[Internal] [Changed] - Properly split the "Too Old Version of React Native" message

Reviewed By: NickGerleman

Differential Revision: D47764363

fbshipit-source-id: 7a80f03b4228a3f0c69d718b8eb60ecd4ac60a2b
2023-07-25 21:49:41 -07:00
kacperkapusciak 3f78fa953a Fix checkForReproducer action not adding Missing Repro comment (#38531)
Summary:
This PR fixes a bug where GitHub Actions bot didn't add a comment when "Needs: Repro" label was present in an issue.

When a maintainer adds the label manually the bot comments with "Missing Reproductible Example" as normally.

It seems like the problem occurred because of a difference in a sandbox repository and the proper facebook/react-native repo environment.

My sandbox that I used to test https://github.com/facebook/react-native/pull/38338 had an "bot" account with Personal Access Token setup to reply to issues. Turns out that bots using PAT have more permissions and can trigger one action from the other.

**The solution is to send the comment directly from the `checkForReproducer` action.** This won't collide with other actions but sadly will duplicate the sending logic into two actions.

This PR also makes the bot respect when a maintainer removes and adds a label by hand and won't alter the maintainer decision.

Related to ☂️ https://github.com/facebook/react-native/issues/35591

## Changelog:

[INTERNAL] [FIXED] - Message

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

Test Plan: ![image](https://github.com/facebook/react-native/assets/39658211/b956416f-9834-4c61-981f-fe6c17a5eec5)

Reviewed By: cipolleschi

Differential Revision: D47666922

Pulled By: cortinico

fbshipit-source-id: 4a6a471cb11c6ed9b48263d18bf8e283577a14bb
2023-07-21 08:46:03 -07:00
kacperkapusciak 5705661d1f Fix issue bot triggering on PRs (#38525)
Summary:
This PR fixes a bug with an issue labeling bot issues triggering on comments to pull requests. The action doesn't trigger when a pull request is open (but other actions add comments immediately).

From [GitHub docs](https://docs.github.com/en/webhooks-and-events/events/issue-event-types):

> GitHub's REST API considers every pull request to be an issue, but not every issue is a pull request. [...] Pull requests have a **`pull_request` property in the `issue` object.**

☝️ Which is a way to differentiate between an issue and a pull request

Relates to a bug introduced in https://github.com/facebook/react-native/pull/38338 and links to ☂️https://github.com/facebook/react-native/issues/35591

## Changelog:

[INTERNAL] [FIXED] - Prevent issue bot triggering on pull requests

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

Test Plan:
This PR makes use of  `github.event.issue.pull_request` object which is null on issues and comments in issues:

![image](https://github.com/facebook/react-native/assets/39658211/e0a64039-5fb7-4ad3-95aa-65cb7c9f0a4b)

and truthy on comments on pull requests

![image](https://github.com/facebook/react-native/assets/39658211/9df69d00-c792-4c00-bfc2-9ee832551d16)

With a change from PR bot skips execution on comments on pull requests

![image](https://github.com/facebook/react-native/assets/39658211/f02687fb-f81b-4278-8d0e-9b23651229c1)

Reviewed By: ryancat

Differential Revision: D47628330

Pulled By: cortinico

fbshipit-source-id: 63e7180bb57ffd34904414a702c02019e18a042b
2023-07-21 03:10:12 -07:00
kacperkapusciak 42a2898617 Add check-for-reproducer action (#38338)
Summary:
This PR adds a "check-for-reproducer" GitHub action proposed in https://github.com/facebook/react-native/issues/35591.
This GitHub action automatically labels an issue with when no link to GitHub repository under the authors name or link to Snack is present either in the issue body or in the comments.

## 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] [ADDED] - Add check-for-reproducer GitHub action

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

Test Plan:
This action was tested on a private repro mimicking on how GitHub actions are set-up in `facebook/react-native` repository. If you'd want to play around with the action on this private repo just ask for access - provided you're a maintainer.

### Regarding issue body

1. Labels "Needs: Repro" when no link to Expo Snack or a Github repo under the author's name is present in the issue body:

![image](https://github.com/facebook/react-native/assets/39658211/b8e6d4aa-bc9a-471d-99b8-3b551f2c46c6)

2. Removes the "Needs: Repro" label and deletes the Missing Repro comment when the author edits the issue and provides a link to GitHub repo under their name

![image](https://github.com/facebook/react-native/assets/39658211/2dc13fae-b6ca-432f-88a2-f5c340f28c86)

3. Removes the "Needs: Repro" label and deletes the Missing Repro comment when the author edits the issue and provides a valid link to Expo Snack

![image](https://github.com/facebook/react-native/assets/39658211/e82e744e-b2fb-4979-84de-08f95686feb3)

### Regarding comments

3. Removes the "Needs: Repro" label and deletes the Missing Repro comment when there's a comment with a link to reproduction under issue author's name

![image](https://github.com/facebook/react-native/assets/39658211/eefb5978-29d3-4486-8bd7-878fb2c07c05)

4. Removes the "Needs: Repro" label and deletes the Missing Repro comment when there's a comment with a link to Expo Snack

![image](https://github.com/facebook/react-native/assets/39658211/5769ff77-0d9f-4dac-bb36-6d257e6c2a35)

### Regarding false-positives

5. Adds a "Needs: Repro" label when a link to reprository isn't under the issue author's name

![image](https://github.com/facebook/react-native/assets/39658211/01c93ea3-88b9-4920-a8f8-bcd123d214de)

6. Adds a "Needs: Repro" label when a link to Expo Snack's homepage was sent

![image](https://github.com/facebook/react-native/assets/39658211/568c9824-67af-402a-b102-c1c355651d21)

7. Adds a "Needs: Repro" label when a random link was sent

![image](https://github.com/facebook/react-native/assets/39658211/23bb58b3-cc07-4284-a562-6651f2077a3c)

Reviewed By: NickGerleman

Differential Revision: D47511745

Pulled By: cortinico

fbshipit-source-id: 2c0e5a989f52b4e50992a3954283f122b14153e0
2023-07-19 02:38:28 -07:00
Pranav Yadav 28dfdb22eb Auto close issue if version is too old (#38041)
Summary:
*Auto-close* an issue when the version of React Native specified is **TOO OLD**.
Applies `Type: Too Old Version` label and closes such issues using `actOnLabel` workflow.

## Changelog:

[GENERAL] [ADDED] - Auto close issue if version is too old.

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

Test Plan: - Should *auto-close* an issue with `Type: Too Old Version` label

Reviewed By: NickGerleman

Differential Revision: D47331471

Pulled By: cortinico

fbshipit-source-id: 516468299d6923ce72e073a3b7b8b8715d15d6e0
2023-07-10 08:17:16 -07:00
Alex Hunt f8f59881a3 Add Metro repo link to new GitHub issue flow (#38072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38072

Changelog: None

Reviewed By: cortinico

Differential Revision: D47024223

fbshipit-source-id: c29ae1fe7b17cd0182cb865aa398c870d86cf80d
2023-06-27 07:41:12 -07:00
Pranav Yadav e944bd7115 Bump `autorebase.yml` to `v1.8` (#37584)
Summary:
`cirrus-actions/rebase` `v.1.8` fixes number of bugs.
`v1.8` Changelog: https://github.com/cirrus-actions/rebase/releases/tag/1.8
See: https://github.com/cirrus-actions/rebase

## Changelog:

[GENERAL] [SECURITY] - [Actions] Bump `autorebase.yml` to `v1.8`

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

Test Plan: - `/rebase` comment should rebase the PR as usual.

Reviewed By: rshest

Differential Revision: D46264711

Pulled By: cipolleschi

fbshipit-source-id: 49974e5c1841c0af3637cf5bdbcde9e79ea0e671
2023-06-07 04:42:32 -07:00
Aymane Missouri 805604d1e3 use TripleEqual instead of doubleEqual when comparing two string (#37673)
Summary:
It is generally recommended to use "===" instead of "==" when comparing two strings

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

Test Plan:
## Changelog:
[Internal] [Changed] - use TripleEqual instead of doubleEqual when comparing two string

Reviewed By: cipolleschi

Differential Revision: D46434681

Pulled By: cortinico

fbshipit-source-id: 70522a28799699854d2a4ab814e34ce796082025
2023-06-05 02:19:26 -07:00
Pranav Yadav 50992be405 Remove `greet.yml` action (#37587)
Summary:
This (`greet.yml`) action requires some _changes_ to "repo" settings which are _out of maintainers' controls_.
So, instead of wasting compute; let's just delete this action :(
🤗🌏

## Changelog:

[GENERAL] [REMOVED] - [Actions] Remove `greet.yml` action

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

Test Plan: - Not needed.

Reviewed By: cortinico

Differential Revision: D46275607

Pulled By: cipolleschi

fbshipit-source-id: 80880568cbae1158006445e078e638e4e375cb73
2023-05-30 07:14:25 -07:00
Pranav Yadav 16712473d3 Add greet action 🎉 (#37499)
Summary:
Currently we do _not_ greet; **"First Time Contributors"**.
It is important to greet every first time contributor keep the OSS community thriving. 😊

This PR; Adds a greet action `greet.yml` 🎉, which comments under First Time Contributors PRs, greeting them as well suggesting some basic steps/guidelines.

## Changelog:

[GENERAL] [ADDED] - [Actions] Add greet action 🎉

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

Test Plan: - Should greet 1st time contributors

Reviewed By: cortinico

Differential Revision: D46142126

Pulled By: cipolleschi

fbshipit-source-id: 5a619a485409fda6fe895feffb736e878fb206ee
2023-05-24 04:28:39 -07:00
Nicola Corti fa0d403ae0 Do not stale issues with "Issue: Author Provided Repro" (#37469)
Summary:
I'm making sure we don't stale issues where the repro has been provided.
I'm also moving the bot to run every 10 minutes at 5AM so it will do a pass once overnight, rathern than running 4x during the day.

## Changelog:

[INTERNAL] - Do not stale issues with "Issue: Author Provided Repro"

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D45953855

Pulled By: cortinico

fbshipit-source-id: 299aef0844ce1bc872e3156419adeff675ae2a68
2023-05-22 06:58:59 -07:00
Olga Zinoveva b6f269e8a3 Enhance labeling workflow (#37324)
Summary:
This PR does two things:
1. Improves the labeling workflow in cases where the user is on a supported version but a higher patch number is available. Now, the label name will be friendlier ('Newer Patch Available') and we will report the version they should consider upgrading to in the message body. Once this change is merged, I can also rename all existing versions of this label for consistency.
2. Moves the addDescriptiveLabels.js script to the workflow-scripts folder for consistency with the other workflow scripts.

## Changelog:

[INTERNAL] [CHANGED] - Enhancing issue triage workflow for patch versioning

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

Test Plan: See some examples of the workflow run in my fork: https://github.com/SlyCaptainFlint/react-native/issues

Reviewed By: cipolleschi

Differential Revision: D45680812

Pulled By: NickGerleman

fbshipit-source-id: 7ab07fcf52fe372d2e449bb43d6618b1c98e9245
2023-05-09 10:19:47 -07:00
Héctor O. Ramos Ortiz 41c6f0f6d1 Remove stale CODEOWNERS (#36199)
Summary:
The [code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) configuration for this repository is stale, as most of the code owners no longer have write access to this repository. To my understanding, the code owners definition is not taken into account in the open source workflow for this repository. Therefore, instead of assigning new code owners, I'm removing it in this PR.

> **Note:** This has the side effect of no longer assigning me as a reviewer for PRs on this repository that touch the filepaths covered here.

<img width="1212" alt="Screenshot 2023-02-17 at 9 33 56 AM" src="https://user-images.githubusercontent.com/165856/219713156-816c293b-5568-49b6-ac56-06334cb00ca2.png">

## Changelog

[INTERNAL] - Remove CODEOWNERS. This is a GitHub-only change.

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

Test Plan: N/A

Reviewed By: rshest

Differential Revision: D45274456

Pulled By: cortinico

fbshipit-source-id: baaca77f0bc9f64f93fcd24ddb86424d3ad50a43
2023-04-25 09:36:21 -07:00
Nicola Corti e242a65c5b Update actOnLabel to include the official reproducer (#37023)
Summary:
I'm adding a reference to our official template in the Needs: Repro label response

## Changelog:

[INTERNAL] - Update actOnLabel to include the official reproducer

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

Test Plan: n/a

Reviewed By: mdvacca

Differential Revision: D45183426

Pulled By: cortinico

fbshipit-source-id: cd97981eda49ff7123f6beb05b6eb64b4899ded0
2023-04-21 09:35:16 -07:00
Pranav Yadav abddf14bf1 chore: bump `actions/checkout` to `v3` (#36937)
Summary:
A recent [Rebase run](https://github.com/facebook/react-native/actions/runs/4724279197/jobs/8381306851) gave following warning:
>Node.js 12 actions are *deprecated*. Please update the following actions to use Node.js 16: actions/checkout@v2. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

So, it makes sense to upgrade to `actions/checkout@v3`.

## Changelog:

[GENERAL] [SECURITY] - Bump `actions/checkout` to `v3`

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

Test Plan: - ci should be green + the `/rebase` command works as usual.

Reviewed By: rshest

Differential Revision: D45079793

Pulled By: cortinico

fbshipit-source-id: 49e654cf15f6ae7208bf8b277a194ace3fa62aa0
2023-04-18 06:49:37 -07:00
Olga Zinoveva ad4a857d3a Fix occasional failures of triage-issue job (#36846)
Summary:
I added a new step to the triage-issue job last week, to add descriptive labels to issues based on their title. This job has occasionally be failing, [like this](https://github.com/facebook/react-native/actions/runs/4630279135/jobs/8191646900). This happens when no applicable labels are found, and we send up an empty array to the add labels endpoint. Adding an array length check to protect against this case.

## Changelog:
[INTERNAL] [FIXED] - Fixed occasional failures in the issue triage pipeline related to issue labeling

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

Test Plan:
Repro run in my repository before the fix: https://github.com/SlyCaptainFlint/react-native/actions/runs/4631843716 (note that the error is the same as in the example failure listed in the description)
And here is a success on the same issue after the fix: https://github.com/SlyCaptainFlint/react-native/actions/runs/4631920441

Reviewed By: cipolleschi

Differential Revision: D44866639

Pulled By: cortinico

fbshipit-source-id: ace6ebece46d7a160f8be39a6099121e11201318
2023-04-11 11:33:10 -07:00
Nicola Corti de2f01d9d7 Do not store scripts inside .github/workflows (#36811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36811

Editing frequently the `.github/workflow` folder makes harder to use the
`/rebase` command as it fails if there are edits to such folder in the middle
of a rebase.
I'm moving the .js files outside of that folder.

Changelog:
[Internal] [Changed] - Do not store scripts inside .github/workflows

Reviewed By: sshic

Differential Revision: D44705878

fbshipit-source-id: a8007d6c126dbda2a1ee9d8cb0397df5df43fd63
2023-04-05 05:25:35 -07:00
Olga Zinoveva d038e4e3bf Add github workflow for automatic API, topic, and component labeling of issues (#36712)
Summary:
Adding a new github workflow script, which will run as part of the existing triage job that is triggered when an issue is  labeled with the "Needs: Triage" label (this typically happens automatically when the issue is created).
This script will add an extensive list of possible labels corresponding to APIs, components, and topics (see the code for the full list).
The motivation for this change is to replace the last bit of meaningful functionality performed by react-native-bot, which will allow us to decommission that bot in favor of using github workflows for all issue and PR automation.

## Changelog:

[INTERNAL] [CHANGED] - Updated API, topic, component labeling on issues to run from a GH workflow rather than an external bot action

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

Test Plan:
For examples of issues being labeled by this new script, see the open issues here: https://github.com/SlyCaptainFlint/react-native/issues
I did not test every possible label, but I tested at least one from each category (API, component, topic), and a combination of one or two of each.

Reviewed By: cortinico, cipolleschi

Differential Revision: D44593658

Pulled By: SlyCaptainFlint

fbshipit-source-id: 93758d05a70d02bed76ab0b6149271e757e0a12f
2023-04-04 15:49:01 -07:00
Riccardo Cipolleschi 3ac7a5ef4e Fix: Adapt template to new rules (#36705)
Summary:
Recently, we changed the logic to verify the body of a PR so that it is more compatible internally and externally, in both ways. But we forgot to update the template, so right
now, all the created PR are incompatible with the internal PR checker.
The required change is to have `:` after the Changelog title.
For consistency, I added the `:` after ALL the titles.

## Changelog:

[Internal] - Changed the PR template to align it to the new rules

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

Test Plan: No danger errors nor internal linter errors

Reviewed By: christophpurrer

Differential Revision: D44503519

Pulled By: cipolleschi

fbshipit-source-id: 43963c3cf774d19d6de8e86b18b684e76dd0fe87
2023-03-29 09:17:53 -07:00
Nicola Corti 574653319a Add labels to bypass stale bot (#36365)
Summary:
Tweaking stale bot to have labels that bypass the stale bot.

## Changelog

[INTERNAL] - Add labels to bypass stale bot

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D43771191

Pulled By: cortinico

fbshipit-source-id: 55962a9fe4480e962f94cb0456501e09d88f00da
2023-03-03 10:09:00 -08:00
Lorenzo Sciandra 1d8a6e3dc6 chore(stalebot): set the stale bot to start from oldest (#36337)
Summary:
We realized lately that the bot has "too much to eat" and because by default it starts from the most recent things ([see default here](https://github.com/actions/stale#ascending)), I'm fixing the settings so that it would start from oldest.

This should make it start from [very old and inactive issues](https://github.com/facebook/react-native/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-asc+) such as such as https://github.com/facebook/react-native/issues/1693 (last comment from Aug 2020) or https://github.com/facebook/react-native/issues/10027 (last activity in May 2019) and make it do significant progress on the repo clean up :)

## 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] [CHANGED] - set the stale bot to start from oldest

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D43694724

Pulled By: cipolleschi

fbshipit-source-id: a7cc07e4669b1d7f5e0bfc31ff313767790e1f0f
2023-03-01 06:25:08 -08:00
Nicola Corti d56bd115fa Do not attempt to comment on PRs when on forks (#36316)
Summary:
I'm gating this workflow to run only upstream as I'm receiving notifications that it fails on my fork. We don't want to run this workflow on forks at all hence we can add a `if:` there.

## Changelog

[INTERNAL] - Do not attempt to comment on PRs when on forks

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

Test Plan: If Github Actions UI is green, we're good to go

Reviewed By: cipolleschi

Differential Revision: D43657315

Pulled By: cortinico

fbshipit-source-id: 8fb260d142a43375bd9a3b10eac235550a6aecb0
2023-02-28 07:36:06 -08:00
Olga Zinoveva 26b2bb5343 Add automatic RN version checking workflow (#36075)
Summary:
Adding automatic RN version checking github workflow, which will verify the version of RN listed on all new issues filed in the repository.
Additionally, this change refactors the existing labeler workflow to make it re-usable by the version check workflow. The change also creates a logical place to add future automatic detection checks, like auto-verification of repro, template, etc.
This is technically not new functionality, as the react-native-bot does this _sometimes_, but this should be a lot more reliable.
The logic for valid release checking follows what is listed in the documentation - valid versions are current and N-2 minors, with the highest available patches.

## Changelog

[INTERNAL] [FIXED] - Made the automated RN version checking workflow more reliable

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

Test Plan:
I have verified a variety of different versions on issues here: https://github.com/SlyCaptainFlint/react-native/issues
I have also re-verified all the tags that were previously handled by the labeler workflow, since I have refactored it. Please take a look at both the open and closed issues in the linked repo for examples.

Reviewed By: cortinico

Differential Revision: D43089150

Pulled By: SlyCaptainFlint

fbshipit-source-id: 7da67f5cb2a4875f22e1f9e46d7ca07d43f3e135
2023-02-22 21:26:36 -08:00
Nicola Corti ee9465f058 Stale issues more frequently (4 times a day) (#36130)
Summary:
Our stale bot is at capacity and reaches quota, resulting in marking as stale 2/3 issues a day.
I'm increasing the frequency of the bot to 4 times a day.

## Changelog

Changelog:
[Internal] [Changed] - Stale issues more frequently (4 times a day)

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

Test Plan: nothing to test

Reviewed By: cipolleschi

Differential Revision: D43207979

Pulled By: cortinico

fbshipit-source-id: 1de45315e724ddf9afdb9426eddc639875ba0b24
2023-02-13 06:30:22 -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
Blake Friedman 62fa6d9dac ci: Add `Type: Expo` label action (#36069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36069

This PR adds a github action to auto closes an issue labelled with `Type: Expo`.

Changelog:

[Internal][Added] - Support `Type: Expo` label action

Reviewed By: cortinico

Differential Revision: D43041449

fbshipit-source-id: 8ac29487b172acd5798c8c36f5ef89cf60e69d04
2023-02-06 08:18:54 -08:00
Blake Friedman 2430d1fcf3 ci: Fix wording on stale bot for Author Feedback
Summary:
Fix wording to make it clear that the issue / PR is marked stale because of inaction.
Changelog:
[Internal] - Fix wording that was meant to go in on D42531703 (474c0edafe)

Reviewed By: cortinico

Differential Revision: D42547980

fbshipit-source-id: 01e624ae66348d2528fa1f5bbbc2aacb24ddd865
2023-01-17 09:11:53 -08:00
Blake Friedman 474c0edafe ci: Add `unsupported-version` label action (#35849)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35849

Users will provide issues or examples that use unsupported versions of React Native. Provide label to track and ask them to update example / issue to currently mainted version.

Changelog:

[Internal] - Support 'unsupported version' tag comment

Reviewed By: cortinico

Differential Revision: D42531703

fbshipit-source-id: 5577943a329e17147269b9e5a5da2b2c16a6ae3e
2023-01-17 04:21:57 -08:00
Lorenzo Sciandra e509007f57 fix(internal, dangerfile): fix changelog entries for dangerfiles and PR template (#35541)
Summary:
A few days back leotm pointed out how the dangerfile was disaligned with the docs around the valid changelog entries for categories and types here: https://github.com/facebook/react-native/pull/35443#issuecomment-1327449113

I dug a bit deeper into the whole thing and went to the source of truth, which is the changelog generator, in particular here: https://github.com/microsoft/rnx-kit/blob/main/incubator/rn-changelog-generator/src/utils/getChangeDimensions.ts

So I've updated the dangerfile to respect the options listed there. Also did a parallel PR on the website side: https://github.com/facebook/react-native-website/pull/3447

So now all comms will be aligned.

## 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 changelog entries for dangerfiles and PR template

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

Test Plan: N/A

Reviewed By: sammy-SC

Differential Revision: D41686913

Pulled By: cortinico

fbshipit-source-id: 2297b4a3209188bda4a609b60860de35c5e7e6df
2022-12-05 02:38:42 -08:00
SlyCaptainFlint 46fe963c4e Move close-pr workflow from react-native-bot to actions/github-script@v6 (#35500)
Summary:
This change adds a new action and workflow that will run whenever a commit is pushed that closes a PR via its message. When this happens, the corresponding PR will be labeled with "Merged" and a comment will be added with the name of the committer and the sha of the commit that resolved the PR.
This is not new functionality - it merely replaces a portion of the react-native-bot's functionality with a GitHub action.

## Changelog

[Internal] [Changed] - Moved close PR actions to a GitHub action

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

Test Plan:
Tested the golden path here ("Merged" label and comment added): https://github.com/SlyCaptainFlint/react-native/pull/27
Tested the case where a PR already labeled with Merged was processed and no new comment was left on it (simulates the case where react-native-bot, which is still going to be running, got to the PR and processed it before the new GitHub action did): https://github.com/SlyCaptainFlint/react-native/pull/26

Reviewed By: cipolleschi

Differential Revision: D41567047

Pulled By: SlyCaptainFlint

fbshipit-source-id: 23745a17950b75c1a8f25f0b840c2172332c4cfa
2022-11-30 20:52:46 -08:00
Nicola Corti 2d1d61a38c Move on-issue-labeled to use actions/github-script@v6 (#35474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35474

This cleans up our `on-issue-labeled` workflow and makes sure we use only github-scripts. So we don't need to checkout the code & run an external action.

Changelog:
[Internal] [Changed] - Move on-issue-labeled to use actions/github-script@v6

Reviewed By: cipolleschi

Differential Revision: D41522650

fbshipit-source-id: c93d10eddf5be2ca9f779389e8059633291c0138
2022-11-25 04:01:31 -08:00
Lorenzo Sciandra 37fbc1606c chore(issue templates): small tweaks + clear mention of support window (#35304)
Summary:
During the outage it become clear that we are not doing enough to communicate what the release support policy/window is. This is one of the tweaks I'm doing to help with 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] - small tweaks to issue templates + clear mention of support window

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D41183435

Pulled By: cipolleschi

fbshipit-source-id: 32519c52616fb1903507fad291200eb959d451b4
2022-11-10 08:43:13 -08:00
Nicola Corti a88f805227 Make autorebase less restrictive (#34848)
Summary:
Currently the autorebase feature doesn't work because it fails the `if` validation due to how we distribute permissions.

For now I'm making this action less restricted. We can tweak it if we notice abuse.
Config now is the same as https://github.com/cirrus-actions/rebase

## Changelog

[Internal] - Make autorebase less restrictive

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

Test Plan: Nothing to test

Reviewed By: cipolleschi

Differential Revision: D40022304

Pulled By: cortinico

fbshipit-source-id: 74270b47c61267484c073706fa900f22b3569a94
2022-10-03 08:13:07 -07:00
Cedric van Putten c5a2d571ab Update Expo domain to expo.dev (#34799)
Summary:
Some time ago, we moved the Expo domain over to `expo.dev` ([see this PR for example](c5e091a015)). This does the same thing here :)

## 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 - Update Expo domain to expo.dev

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

Test Plan: Just a minor change, unrelated to React Native code.

Reviewed By: lunaleaps

Differential Revision: D39867749

Pulled By: lunaleaps

fbshipit-source-id: f6ad6350d991ffe1ef8310415e28ae49ed776afc
2022-09-28 07:17:47 -07:00
Luna Wei dc56eb99f1 Fix missing renames from bots to react-native-bots (#34713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34713

Changelog: [Internal] - Fix up missing bots usage after we moved everything to packages/react-native-bots in 767f8e0249

Reviewed By: NickGerleman

Differential Revision: D39583230

fbshipit-source-id: 6cc6b7923e67139dc3c81dfe0c39005dde905248
2022-09-16 12:41:06 -07:00
Alex a5cf3a46ab GitHub Workflows security hardening (#34541)
Summary:
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>

This PR adds explicit [permissions section](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions) to workflows. This is a security best practice because by default workflows run with [extended set of permissions](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) (except from `on: pull_request` [from external forks](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an [injection](https://securitylab.github.com/research/github-actions-untrusted-input/) or compromised third party tool or action) is restricted.
It is recommended to have [most strict permissions on the top level](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) and grant write permissions on [job level](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) case by case.

## 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] [Added] - Explicit security permission definitions in autorebase workflow

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

Reviewed By: cipolleschi

Differential Revision: D39544656

Pulled By: cortinico

fbshipit-source-id: 4918ee83fab7172a1d98689f10102fe2db2b17b7
2022-09-15 09:31:41 -07:00
Luna Wei 767f8e0249 Add bots as a yarn workspace and update danger action (#34652)
Summary:
allow-large-files

When working on https://github.com/facebook/react-native/pull/34614, danger is failing because it doesn't share `node_modules` with the root directory where `typescript` is installed as we added it as a parser in our eslint config.

By setting `bots` as a yarn workspace, dependencies are all installed under the root `node_modules` folder and in local testing (detailed in test section) we no longer have the `typescript module not found` error. However, danger will continue to fail on https://github.com/facebook/react-native/pull/34614 as the `danger_pr` Github action runs from what's defined on `main`.

Once these changes land, I can rebase https://github.com/facebook/react-native/pull/34614 on it and danger's eslint should pass.

## 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 `bots` directory as a yarn workspace and update `danger_pr` Github action

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

Test Plan:
To verify this fix I had to run:
```
react-native $ yarn && cd bots
react-native/bots$ yarn run danger pr https://github.com/facebook/react-native/pull/34614
```

which resulted in
```
❯ yarn run danger pr https://github.com/facebook/react-native/pull/34614
yarn run v1.22.19
$ lunaleaps/react-native/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34614
Starting Danger PR on facebook/react-native#34614

Danger: ✓ found only warnings, not failing the build
## Warnings
🔒 package.json - <i>Changes were made to package.json. This will require a manual import by a Facebook employee.</i>

  Done in 12.78s.
```
Verified this also on another PR:
```
yarn run danger pr https://github.com/facebook/react-native/pull/34650
```

Reviewed By: NickGerleman

Differential Revision: D39435286

Pulled By: lunaleaps

fbshipit-source-id: 8c82f49facf162f4fc0918e3abd95eb7e4ad1e37
2022-09-12 22:03:34 -07:00