Skip to content

Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) (#57469)#57469

Open
zeyap wants to merge 1 commit into
mainfrom
fix-e2e-prerelease-publish-tag
Open

Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) (#57469)#57469
zeyap wants to merge 1 commit into
mainfrom
fix-e2e-prerelease-publish-tag

Conversation

@zeyap

@zeyap zeyap commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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 nil #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

@meta-cla meta-cla 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 Jul 7, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jul 7, 2026
@meta-codesync

meta-codesync Bot commented Jul 7, 2026

Copy link
Copy Markdown

@zeyap has imported this pull request. If you are a Meta employee, you can view this in D110925222.

@zeyap zeyap changed the title Fix release e2e local testing: pass --tag when publishing prerelease packages Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) Jul 7, 2026
…+ 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
@meta-codesync meta-codesync Bot changed the title Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) Fix release e2e local testing on macOS / npm >= 11 (prerelease --tag + gradle.properties) (#57469) Jul 8, 2026
@meta-codesync meta-codesync Bot force-pushed the fix-e2e-prerelease-publish-tag branch from 2ca7454 to 2b4cb4e Compare July 8, 2026 17:11
@meta-codesync

meta-codesync Bot commented Jul 8, 2026

Copy link
Copy Markdown

@zeyap has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110925222.

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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant