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

[LOCAL][Release-Testing] Update the testing script to use the new template #45144

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Jun 24, 2024

Summary:

This PR applies changes to the testing script for releases so that it can use the new template and the new react-native-community/cli

Changelog:

[Internal] - Make the release testing script use the community/cli

Test Plan:

Tested locally

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 24, 2024
@cipolleschi cipolleschi changed the base branch from main to 0.75-stable June 24, 2024 16:52
@cortinico cortinico changed the title LOCAL][Release-Testing] Update the testing script to use the new template [LOCAL][Release-Testing] Update the testing script to use the new template Jun 24, 2024
const pathToTemplate = path.join(templateRepoFolder, 'template');

// Cleanup template clone folder
exec(`rm -rf ${templateRepoFolder}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this folder does not exists anymore. it was pointing to /tmp/template which was the folder where we were cloning the template. We are not cloning the template anymore, so the folder is gone (line 247) and also the cleanup should go at this point.

scripts/e2e/init-template-e2e.js Outdated Show resolved Hide resolved
const appPackageJson = JSON.parse(
fs.readFileSync(appPackageJsonPath, 'utf8'),
);
appPackageJson.dependencies['react-native'] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be a file:// dependency, just the version so it uses Verdaccio.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, we want to use the exact same version we built in CI, so we download react native and we use the local file.
Having it to point to the locally published package means that we are going to rebuild react native locally, especially for Android, and we want to avoid that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, React Native is NOT published on Verdaccio, AFAIK.

@analysis-bot
Copy link

analysis-bot commented Jun 24, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,443,788 -52,329
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,642,466 -51,015
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 4a8f0ee
Branch: main

@cipolleschi cipolleschi force-pushed the cipollesschi/update-testing-script-for-cli branch from 787f4b8 to 3c48bdc Compare June 25, 2024 08:54
@cipolleschi cipolleschi marked this pull request as ready for review June 25, 2024 08:56
--directory ${directory} \
--template ${templatePath} \
--version next \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this won't work for rc.0 the next time.

Let's use it for now to unblock us but this now assumes the template is already published before be do the testing which is not the case.

I think the most correct way to do would be to:

  1. git clone the template
  2. git checkout to the 0.75-stable branch (i.e. the same branch this script is executed from).
  3. Update the template to align react-native and all the @react-native/* dependencies.
  4. Run npm pack to create a tarball of the template
  5. Run npx npx @react-native-community/cli@next init ${projectName} --template file://{path-to-packaged-template}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the current approach doesn't work to test older versions of react native.
But also the steps highlighted here don't work, unless we have a release branch for the template as well. 🤔

The problem is that, when we test RC1, for example, React Native RC1 has not been published yet. And locally, the version of react native has not been updated yet. So:

  • we are testing RC1, while the version in React native is still RC0
  • we need to automate the creation of template release branches
    🤔 🤔 🤔 🤔 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can pass an extra parameter to the script, though... We can:

  • pass a new -v with the version we want to test
  • run set-version to bump everything locally to the right version
  • run the Verdaccio to publish the packages in the versions we actually want to test
  • Assuming that we are in the release branch and that a release branch with the exact same name exists in the template, we can apply your steps.

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. p: Facebook Partner: Facebook Partner Pick Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants