Commit Graph

12 Commits

Author SHA1 Message Date
Fabrizio Cucci 95de14dc53 Drop unused code + minor lint fixes (#44645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44645

Changelog: [Internal]

As per title.

Reviewed By: NickGerleman

Differential Revision: D57664819

fbshipit-source-id: 2388bd01c00d814a12de7f2e285b78f207e6012c
2024-05-22 12:11:33 -07:00
Moti Zilberman 8e70acc235 Remove linting step from dangerfile (#42332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42332

Changelog: [Internal]

TSIA - the Danger ESLint plugin we use is outdated and there have been issues with its reliability. We already have [linting jobs on CircleCI](https://github.com/facebook/react-native/blob/6c8dfc89566d27c36f9ca3828bcf3a63dfcb6942/.circleci/configurations/jobs.yml#L5-L74) that overlap with this functionality.

Reviewed By: cortinico

Differential Revision: D52834693

fbshipit-source-id: f2b6cb9c4c560f5c3e66514da1779f14d908ae97
2024-01-17 07:52:58 -08:00
Moti Zilberman d2e8225887 Revert import order change in dangerfile.js (#41366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41366

Changelog: [Internal]

D51025812 broke Danger runs in the React Native repo, so let's revert the changes to `dangerfile.js`.

Reviewed By: hoxyq

Differential Revision: D51075476

fbshipit-source-id: 66dc08e10a44e9a9a371af28d9a7440167470702
2023-11-07 09:41:35 -08:00
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 6aae713a18 Disable unstable E2E tests (#41153)
Summary:
E2E tests in OSS are expensive and flaky.
They already prevented some broken changes to land on main, but as of today:
- they are always green, so they are not bloking
- nobody is looking at the reporting job
- the reporting job takes a lot of time to run and prevent other useful signals to be available soon
- it is expensive

So we decide to disable them for the time being, while we iterate on those with Callstack and MSFT.

## Changelog:
[Internal] -  Disable E2E tests

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

Test Plan: CircleCI stays green

Reviewed By: cortinico

Differential Revision: D50552818

Pulled By: cipolleschi

fbshipit-source-id: 7160a8074492c3c9a55485d8a17a6883eb4b35b5
2023-10-23 07:15:00 -07:00
Nick Gerleman 247717b091 disable test_e2e_android job (#39399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39399

Even after making these never report command failures, and allowing no output for thirty minutes, there are still failures here (though less) which cause lands to be aborted, especially for stacks with multiple diffs (it has prevented a recent stack of mine from landing after multiple attempts).

```
yarn run v1.22.19
$ node ./../../scripts/e2e/run-e2e-tests.js android
`isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`
    at isModuleDeclaration (/home/circleci/project/node_modules/babel/types/lib/validators/generated/index.js:3940:35)
    at NodePath.<computed> [as isModuleDeclaration] (/home/circleci/project/node_modules/babel/traverse/lib/path/index.js:181:12)
/bin/bash: line 2: 14063 Hangup                  yarn test-e2e android 2>&1
     14064 Done                    | tee /tmp/test_log

Too long with no output (exceeded 30m0s): context deadline exceeded
```

We are not able to detect regressions from tests while they are configured to suppress all failures, and they are still causing issues (though less), so this disables them at the job level until improvements can be made.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D49175533

fbshipit-source-id: f8b99725a57500b027874f3ef51d74c869502a22
2023-09-11 22:47:59 -07:00
Riccardo Cipolleschi a05858680a Make the e2e tests not land blocking (#39129)
Summary:
Given that the e2e tests are quite flaky, we want to reduce the flakyness making them non land blocking.
The idea is to:
1. always have them green in CircleCI
2. store the test logs in CircleCI artifacts, so we can explore them if needed.
3. use danger to read the artifacts from CircleCI and post a message to inform the user whether the Test ends up successfully or not.

## Changelog:

[Internal] - Make e2e tests non land-blocking. Use Danger to report the status of the E2E jobs

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

Test Plan: CircleCI stays green, logs are uploaded as artifacts.

Reviewed By: rshest

Differential Revision: D48642955

Pulled By: cipolleschi

fbshipit-source-id: 185862f46c47d59f949743a9b893162b2bb3a651
2023-08-25 05:11:28 -07:00
Nick Gerleman 290774fd80 Do not run OSS changelog validator on diffs exported from Phabricator (#36994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36994

We already run changelog validation internally which has specific exemptions for codemods and dirsynced directories. Do not run twice, now that we need to export diffs.

An alternative solution would be to port the logic to the OSS changelog generator and stop running the internal one, but that would increase latency, and we have made fixes to the internal once as recent as two weeks ago in D44746795.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D45135111

fbshipit-source-id: e23c2613b183f75a148d1b38b31c259acc9c9fc5
2023-04-20 10:11:43 -07:00
Luna Wei d9f7c4c189 Use @rnx-kit/rn-changelog-generator for changelog validation in danger (#36507)
Summary:
Currently we have a tool (rnx-kit/rn-changelog-generator) that extracts changelog messages from our commit history to generate the changelog for a React Native release.

In hopes of standardizing to one place where changelog validation occurs -- I've moved this logic to the package rnx-kit/rn-changelog-generator such that if the formatting ever changes, the changelog parsing is also updated.

Changelog: [Internal] - Updating danger to use logic in rnx-kit/rn-changelog-generator for changelog validation.

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

Test Plan: Tried `require`-ing the package and on a changelog message. I'm not sure exactly how to test a dangerfile -- IIRC it has to run off `main`

Reviewed By: cortinico, cipolleschi

Differential Revision: D44183479

Pulled By: lunaleaps

fbshipit-source-id: f65440f7b66a048f961d4698d78210c74e276452
2023-03-27 13:27:43 -07: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
Gabriel Donadel Dall'Agnol 55b09da62a fix: Eslint on Danger not matching project config (#34980)
Summary:
I've been noticing this for a while now, every time that someone changes a file inside rn-tester Danger comments a bunch of warnings regarding inline styles, e.g. https://github.com/facebook/react-native/pull/34567#issuecomment-1257956893, even though that is disabled inside .eslintrc https://github.com/facebook/react-native/blob/8edf4e9e3adcc85743e3c86a25ab3748b276a3da/packages/rn-tester/.eslintrc#L3

After some investigation, I realized that the problem was that the Eslint Node.js API used by [seadub/danger-plugin-eslint](https://www.npmjs.com/package/seadub/danger-plugin-eslint) was not able to locate any `.eslintrc` files due to the location of the directory where danger is invoked. By using `process.chdir` we can ensure that eslint will run from the root folder and that it will be able to find all .eslintrc files

## Changelog

[Internal] [Fixed] - fix eslint config when running Danger

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

Test Plan:
run `yarn danger pr https://github.com/facebook/react-native/pull/34976`

After

![image](https://user-images.githubusercontent.com/11707729/195751496-5225a32f-f4b3-4ce2-833f-ae5723f647c0.png)

Before

![image](https://user-images.githubusercontent.com/11707729/195751673-34ba87fc-ce50-4020-9688-a486e3021c4f.png)

Reviewed By: cortinico

Differential Revision: D40384300

Pulled By: yungsters

fbshipit-source-id: e68eeafc42567dc9d7297dde3709a989cc70f4e2
2022-10-14 10:01:25 -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