Skip to content

Download React Native artifacts from the proxy cache server first (#57325) - #57325

Open
coado wants to merge 1 commit into
react:mainfrom
coado:@coado/maven-repo-switch
Open

Download React Native artifacts from the proxy cache server first (#57325)#57325
coado wants to merge 1 commit into
react:mainfrom
coado:@coado/maven-repo-switch

Conversation

@coado

@coado coado commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary:
This PR adds pull-through cache support for React Native Maven artifacts by trying https://repo.reactnative.dev/maven2 before Maven Central for release artifacts.

  • Updates the Android Gradle resolution by adding cache repository before mavenCentral() scoped to React Native groups via includeGroupByRegex.
  • Updates iOS CocoaPods prebuilt artifact resolution to try the cache first, then fall back to https://repo1.maven.org/maven2.
  • Updates SwiftPM/iOS prebuild JS tooling with the same cache-first fallback behavior.
  • Preserves ENTERPRISE_REPOSITORY behavior as an explicit single custom repository override.
  • Avoids duplicate artifact existence probes in Ruby and JS by checking candidate URLs directly and caching JS HEAD results within the process.

Changelog:

[GENERAL][CHANGED] - Add React Native Maven pull-through cache fallback for prebuilt artifacts.

Test Plan:
Run:

react-native % RN_DEP_VERSION=0.81.0 \
HERMES_VERSION=250829098.0.13 \
node scripts/ios-prebuild -s -f Debug

The logs confirm that React Native artifacts are cached and pulled from the proxy:

[ReactNativeDependencies] Using download prebuild Debug tarball
[ReactNativeDependencies] Using release tarball from URL: https://rnmaven.swmtest.xyz/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz
[ReactNativeDependencies] Downloading ReactNativeDependencies tarball from https://rnmaven.swmtest.xyz/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz

Added gradle plugin tests which can be run with:

./gradlew :react-native-gradle-plugin:test --tests com.facebook.react.utils.DependencyUtilsTest

Reviewed By: cortinico

Differential Revision: D113902346

Pulled By: coado

@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 Jun 24, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Jun 24, 2026

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great stuff 👍 love the direction

Comment thread packages/react-native/package.json Outdated
Comment thread packages/react-native/scripts/cocoapods/rncore.rb Outdated
@coado
coado marked this pull request as ready for review June 26, 2026 10:24

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left some minor comments but we can import afterwards. Please apply my Android changes also to iOS @coado

@meta-codesync

meta-codesync Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot changed the title Download React Native artifacts from the proxy cache server first Download React Native artifacts from the proxy cache server first (#57325) Jul 28, 2026
@coado
coado force-pushed the @coado/maven-repo-switch branch from 7800b85 to 9351dd3 Compare July 28, 2026 15:35
coado added a commit to coado/react-native that referenced this pull request Jul 28, 2026
…act#57325)

Summary:
This PR adds pull-through cache support for React Native Maven artifacts by trying `https://repo.reactnative.dev/maven2` before Maven Central for release artifacts.
- Updates the Android Gradle resolution by adding cache repository before `mavenCentral()` scoped to React Native groups via `includeGroupByRegex`.
- Updates iOS CocoaPods prebuilt artifact resolution to try the cache first, then fall back to `https://repo1.maven.org/maven2`.
- Updates SwiftPM/iOS prebuild JS tooling with the same cache-first fallback behavior.
- Preserves `ENTERPRISE_REPOSITORY` behavior as an explicit single custom repository override.
- Avoids duplicate artifact existence probes in Ruby and JS by checking candidate URLs directly and caching JS HEAD results within the process.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL][CHANGED] - Add React Native Maven pull-through cache fallback for prebuilt artifacts.

Pull Request resolved: react#57325

Test Plan:
Run:

```sh
react-native % RN_DEP_VERSION=0.81.0 \
HERMES_VERSION=250829098.0.13 \
node scripts/ios-prebuild -s -f Debug
```
The logs confirm that React Native artifacts are cached and pulled from the proxy:

```sh
[ReactNativeDependencies] Using download prebuild Debug tarball
[ReactNativeDependencies] Using release tarball from URL: https://rnmaven.swmtest.xyz/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz
[ReactNativeDependencies] Downloading ReactNativeDependencies tarball from https://rnmaven.swmtest.xyz/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz
```

Added gradle plugin tests which can be run with:
```sh
./gradlew :react-native-gradle-plugin:test --tests com.facebook.react.utils.DependencyUtilsTest
```

Reviewed By: cortinico

Differential Revision: D113902346

Pulled By: coado
@meta-codesync

meta-codesync Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

…act#57325)

Summary:
This PR adds pull-through cache support for React Native Maven artifacts by trying `https://repo.reactnative.dev/maven2` before Maven Central for release artifacts.
- Updates the Android Gradle resolution by adding cache repository before `mavenCentral()` scoped to React Native groups via `includeGroupByRegex`.
- Updates iOS CocoaPods prebuilt artifact resolution to try the cache first, then fall back to `https://repo1.maven.org/maven2`.
- Updates SwiftPM/iOS prebuild JS tooling with the same cache-first fallback behavior.
- Preserves `ENTERPRISE_REPOSITORY` behavior as an explicit single custom repository override.
- Avoids duplicate artifact existence probes in Ruby and JS by checking candidate URLs directly and caching JS HEAD results within the process.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL][CHANGED] - Add React Native Maven pull-through cache fallback for prebuilt artifacts.

Pull Request resolved: react#57325

Test Plan:
Run:

```sh
react-native % RN_DEP_VERSION=0.81.0 \
HERMES_VERSION=250829098.0.13 \
node scripts/ios-prebuild -s -f Debug
```
The logs confirm that React Native artifacts are cached and pulled from the proxy:

```sh
[ReactNativeDependencies] Using download prebuild Debug tarball
[ReactNativeDependencies] Using release tarball from URL: https://rnmaven.swmtest.xyz/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz
[ReactNativeDependencies] Downloading ReactNativeDependencies tarball from https://rnmaven.swmtest.xyz/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz
```

Added gradle plugin tests which can be run with:
```sh
./gradlew :react-native-gradle-plugin:test --tests com.facebook.react.utils.DependencyUtilsTest
```

Reviewed By: cortinico

Differential Revision: D113902346

Pulled By: coado
@coado
coado force-pushed the @coado/maven-repo-switch branch from 9351dd3 to 9f59039 Compare July 28, 2026 15:45
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 p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants