Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) (#57469)#57469
Open
zeyap wants to merge 1 commit into
Open
Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) (#57469)#57469zeyap wants to merge 1 commit into
zeyap wants to merge 1 commit into
Conversation
|
@zeyap has imported this pull request. If you are a Meta employee, you can view this in D110925222. |
…+ gradle.properties) (#57469) Summary: Two fixes that make `test-release-local` work again for release-candidate testing on macOS with modern npm. Both are in the local release-testing scripts only (no product code). ### 1. `npm publish` needs `--tag` for prereleases (npm >= 11) Publishing the monorepo packages to the local Verdaccio proxy fails on npm >= 11 for a prerelease version (e.g. `0.87.0-rc.0`): ``` react-native/asset-utils (packages/asset-utils) ........................ Failed ❌ npm error You must specify a tag using --tag when publishing a prerelease version. ``` npm now refuses to publish a prerelease to the default `latest` dist-tag without an explicit `--tag`. Fix: when the version is a prerelease (contains `-`), pass `--tag prerelease`. Stable versions are unaffected. (`scripts/e2e/init-project-e2e.js`) ### 2. `echo -e` corrupts `gradle.properties` on macOS Setting up the Android test project, the script appends the maven-local repo path with `echo -e`. On macOS, `/bin/sh`'s `echo` doesn't support `-e`, so it writes a literal `-e ` onto the previous property, corrupting the file: ``` Cannot parse project property android.newDsl='false-e ' of type 'class java.lang.String' as boolean. Expected 'true' or 'false'. ``` Fix: use `printf`, which is portable. (`scripts/release-testing/test-release-local.js`) ## Changelog [INTERNAL] - Fix `test-release-local` for prerelease testing on macOS / npm >= 11 Test Plan: On npm 11.4.2 / Node 24, `yarn test-release-local -t RNTestProject -p Android -c <token>` against `0.87.0-rc.0`: - **Before:** failed at "Publishing packages to local npm proxy" (prerelease `--tag` error); after working around that, failed at `app:installDebug` with the `android.newDsl='false-e '` parse error. - **After:** packages publish to the local proxy with `--tag prerelease`, `gradle.properties` gets a well-formed `react.internal.mavenLocalRepo` line, and the app builds/installs against the RC's maven-local artifacts. - iOS (`-t RNTestProject -p iOS`) also gets past the publish step with fix #1. - Stable (non-prerelease) versions: `publishTag` is empty and `printf` behaves identically, so no behavior change. Reviewed By: christophpurrer Differential Revision: D110925222 Pulled By: zeyap
2ca7454 to
2b4cb4e
Compare
|
@zeyap has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110925222. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Two fixes that make
test-release-localwork again for release-candidate testing on macOS with modern npm. Both are in the local release-testing scripts only (no product code).1.
npm publishneeds--tagfor prereleases (npm >= 11)Publishing the monorepo packages to the local Verdaccio proxy fails on npm >= 11 for a prerelease version (e.g.
0.87.0-rc.0):npm now refuses to publish a prerelease to the default
latestdist-tag without an explicit--tag. Fix: when the version is a prerelease (contains-), pass--tag prerelease. Stable versions are unaffected. (scripts/e2e/init-project-e2e.js)2.
echo -ecorruptsgradle.propertieson macOSSetting up the Android test project, the script appends the maven-local repo path with
echo -e. On macOS,/bin/sh'sechodoesn't support-e, so it writes a literal-eonto the previous property, corrupting the file:Fix: use
printf, which is portable. (scripts/release-testing/test-release-local.js)Changelog
[INTERNAL] - Fix
test-release-localfor prerelease testing on macOS / npm >= 11Test Plan:
On npm 11.4.2 / Node 24,
yarn test-release-local -t RNTestProject -p Android -c <token>against0.87.0-rc.0:--tagerror); after working around that, failed atapp:installDebugwith theandroid.newDsl='false-e 'parse error.--tag prerelease,gradle.propertiesgets a well-formedreact.internal.mavenLocalRepoline, and the app builds/installs against the RC's maven-local artifacts.-t RNTestProject -p iOS) also gets past the publish step with fix nil #1.publishTagis empty andprintfbehaves identically, so no behavior change.Reviewed By: christophpurrer
Differential Revision: D110925222
Pulled By: zeyap