Skip to content

Commit 767f8e0

Browse files
Luna Weifacebook-github-bot
Luna Wei
authored andcommitted
Add bots as a yarn workspace and update danger action (#34652)
Summary: allow-large-files When working on #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 #34614 as the `danger_pr` Github action runs from what's defined on `main`. Once these changes land, I can rebase #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: #34652 Test Plan: To verify this fix I had to run: ``` react-native $ yarn && cd bots react-native/bots$ yarn run danger pr #34614 ``` which resulted in ``` ❯ yarn run danger pr #34614 yarn run v1.22.19 $ lunaleaps/react-native/node_modules/.bin/danger pr #34614 Starting Danger PR on #34614 Danger: ✓ found only warnings, not failing the build ## Warnings :lock: 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 #34650 ``` Reviewed By: NickGerleman Differential Revision: D39435286 Pulled By: lunaleaps fbshipit-source-id: 8c82f49facf162f4fc0918e3abd95eb7e4ad1e37
1 parent bfb36c2 commit 767f8e0

File tree

13 files changed

+1331
-1711
lines changed

13 files changed

+1331
-1711
lines changed

.circleci/config.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,6 @@ commands:
173173
- ~/.cache/yarn
174174
key: << parameters.yarn_base_cache_key >>-{{ arch }}-{{ checksum "yarn.lock" }}
175175

176-
install_github_bot_deps:
177-
steps:
178-
- run:
179-
name: "Yarn: Install dependencies (GitHub bots)"
180-
command: cd bots && yarn install --non-interactive --cache-folder ~/.cache/yarn
181-
182176
brew_install:
183177
parameters:
184178
package:
@@ -247,7 +241,6 @@ commands:
247241
type: enum
248242
enum: ["android", "ios"]
249243
steps:
250-
- install_github_bot_deps
251244
- run:
252245
name: Report size of RNTester.app (analysis-bot)
253246
command: GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" scripts/circleci/report-bundle-size.sh << parameters.platform >> || true
@@ -304,7 +297,6 @@ jobs:
304297
- checkout
305298
- run_yarn
306299

307-
- install_github_bot_deps
308300

309301
# Note: The yarn gpg key needs to be refreshed to work around https://github.com/yarnpkg/yarn/issues/7866
310302
- run:
@@ -1291,7 +1283,6 @@ jobs:
12911283
condition:
12921284
matches: { pattern: '^pull\/.*$', value: << pipeline.git.branch >> }
12931285
steps:
1294-
- install_github_bot_deps
12951286
- run:
12961287
name: Post link to PR build artifacts (pull-bot)
12971288
command: GITHUB_TOKEN="$PUBLIC_PULLBOT_GITHUB_TOKEN_A""$PUBLIC_PULLBOT_GITHUB_TOKEN_B" scripts/circleci/post-artifacts-link.sh || true

.github/workflows/danger_pr.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ jobs:
2020
- name: Run Yarn Install on Root
2121
run: yarn install
2222
working-directory: .
23-
- name: Run Yarn Install inside Bots
24-
run: yarn install
25-
working-directory: bots
2623
- name: Danger
2724
run: yarn danger ci --use-github-checks --failOnErrors
28-
working-directory: bots
25+
working-directory: packages/react-native-bots
2926
env:
3027
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)