Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix E2E template install in CI jobs #43323

Closed
wants to merge 1 commit into from

Conversation

huntie
Copy link
Member

@huntie huntie commented Mar 5, 2024

This fixes a seemingly pre-existent misconfiguration within our test_ios_template E2E test setup in CircleCI.

Background

We call npx @react-native-community/cli init with the --skip-install flag, as part of the bootstrapping logic in scripts/e2e/init-template-e2e.js. This is necessary because we later want to explicitly call npm install with a custom --registry for our locally mirrored packages (via Verdaccio).

For some reason, we were observing unexpected differences when this was run under CircleCI:

  1. Runs yarn init
  2. Runs a yarn add (unknown pkg)

image

https://app.circleci.com/pipelines/github/facebook/react-native/42725/workflows/f648468b-e916-4501-887d-ad293aa6fccf/jobs/1398950

This is causing a Yarn-based install ahead of where we want — ignoring the --skip-install flag.

I'm still unsure on the exact LOC cause in CLI (but most likely, it's around the Yarn v3 move).

Impact of this fix

  • The above meant that, when we were bootstrapping test_ios_template previously, packages weren't being read from Verdaccio, but instead from npm — using the "0.74.0" versions from the previous branch cut ❌.
  • After Bump packages for next major release #43132, this behaviour became breaking 💀 — since for the 0.74 -> 0.75 cut, we no longer physically published "0.75.0-main" (new format) packages to npm.

This change

I'm passing --pm npm to npx @react-native-community/cli init to skip around any Yarn behaviour. This appears to have removed the erroneous yarn invocations ✅.

Changelog: [Internal]

Differential Revision: D54536848

Summary: `test_ios_template` job

Differential Revision: D54536848
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D54536848

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner labels Mar 5, 2024
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 18,024,916 -1
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,383,272 -13
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: f043c83
Branch: main

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 5, 2024
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 42cab14.

huntie added a commit that referenced this pull request Mar 18, 2024
Summary:
Pull Request resolved: #43323

This fixes a seemingly pre-existent misconfiguration within our `test_ios_template` E2E test setup in CircleCI.

**Background**

We call `npx react-native-community/cli init` with the `--skip-install` flag, as part of the bootstrapping logic in `scripts/e2e/init-template-e2e.js`. This is necessary because we later want to explicitly call `npm install` with a custom `--registry` for our locally mirrored packages (via Verdaccio).

For some reason, we were observing unexpected differences when this was run under CircleCI:

1. Runs `yarn init`
2. Runs a `yarn add` (unknown pkg)

 {F1464781818}

https://app.circleci.com/pipelines/github/facebook/react-native/42725/workflows/f648468b-e916-4501-887d-ad293aa6fccf/jobs/1398950

This is causing a Yarn-based install ahead of where we want — ignoring the `--skip-install` flag.

*I'm still unsure on the exact LOC cause in CLI* (but most likely, it's around the Yarn v3 move).

**Impact of this fix**

- The above meant that, when we were bootstrapping `test_ios_template` previously, packages weren't being read from Verdaccio, but **instead from npm** — using the `"0.74.0"` versions from the *previous branch cut* ❌.
- After D54006327, this behaviour became breaking 💀 — since for the 0.74 -> 0.75 cut, we no longer physically published `"0.75.0-main"` (new format) packages to npm.

**This change**

I'm passing `--pm npm` to `npx react-native-community/cli init` to skip around any Yarn behaviour. This appears to have removed the erroneous `yarn` invocations ✅.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: cortinico, cipolleschi

Differential Revision: D54536848

fbshipit-source-id: 473b11924955f5787c82a6c81d4527d77b810aa5
This was referenced Jun 28, 2024
@huntie huntie deleted the export-D54536848 branch September 9, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants