Skip to content

[build-tools] Proxy React Native Maven artifacts - #4196

Open
sjchmiela wants to merge 2 commits into
mainfrom
stanley/add-rn-enterprise-repository
Open

[build-tools] Proxy React Native Maven artifacts#4196
sjchmiela wants to merge 2 commits into
mainfrom
stanley/add-rn-enterprise-repository

Conversation

@sjchmiela

@sjchmiela sjchmiela commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Why

React Native 0.81 and newer support ENTERPRISE_REPOSITORY for stable Hermes, React Native Core, and React Native Dependencies artifacts. React Native 0.87 also reads this setting in its experimental Swift Package Manager artifact downloader.

Set a system fallback so React Native downloads during pod install use the existing EAS CocoaPods cache without replacing a repository configured by the user.

React Native source: https://github.com/facebook/react-native/blob/v0.87.0/packages/react-native/scripts/cocoapods/rncore.rb

How

During pod install, set ENTERPRISE_REPOSITORY to <EAS_BUILD_COCOAPODS_CACHE_URL>/repo1.maven.org/maven2 only when the user did not set it.

The existing proxy mechanisms remain active:

  • EAS_BUILD_COCOAPODS_CACHE_URL stays set, so the CocoaPods plug-in handles all other supported hosts.
  • An already proxied Maven URL is not proxied a second time.
  • If that cache download fails, the CocoaPods plug-in reconstructs the Maven Central URL and retries it directly. This preserves the existing origin fallback.
  • The curl wrapper leaves the already proxied URL unchanged because it only rewrites URLs that start with https://repo1.maven.org/maven2.

This change does not remove the CocoaPods plug-in or curl wrapper.

Test Plan

  • Added build-tools tests for the system fallback, user precedence, and disabled-cache behavior.
  • Added expo-cocoapods-proxy tests for an already proxied Maven URL and its direct-origin fallback.
  • yarn workspace @expo/build-tools test pod.test.ts --runInBand
  • bundle exec rspec spec/expo_cocoapods_proxy/proxy_spec.rb
  • yarn build
  • yarn fmt:check
  • yarn lint (0 errors; existing unrelated warnings remain)

@sjchmiela sjchmiela added the no changelog PR that doesn't require a changelog entry label Aug 14, 2026
@github-actions

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.39%. Comparing base (2a7cb5e) to head (b544528).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4196      +/-   ##
==========================================
+ Coverage   63.39%   63.39%   +0.01%     
==========================================
  Files        1027     1027              
  Lines       46881    46888       +7     
  Branches     9834     9835       +1     
==========================================
+ Hits        29715    29722       +7     
  Misses      17064    17064              
  Partials      102      102              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant