From 528173eb96c9c9baa539022673335eb159ea032f Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 9 Jul 2025 08:12:58 -0700 Subject: [PATCH] Change polling to try and download the pom manifest (#52512) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52512 The way Maven works is that the artifacts are uploaded and available way before the browsing UI will allow us to browse them. By trying to download the `.pom` file instead of checking for the browsing website to be visible, we can shave some minutes during the release ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D78008635 fbshipit-source-id: 96516163628d6d25db385d996a11b4af78db764a --- .../__tests__/verifyArtifactsAreOnMaven-test.js | 8 ++++---- .github/workflow-scripts/verifyArtifactsAreOnMaven.js | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflow-scripts/__tests__/verifyArtifactsAreOnMaven-test.js b/.github/workflow-scripts/__tests__/verifyArtifactsAreOnMaven-test.js index df1a332ac22..e77e7c4e2e4 100644 --- a/.github/workflow-scripts/__tests__/verifyArtifactsAreOnMaven-test.js +++ b/.github/workflow-scripts/__tests__/verifyArtifactsAreOnMaven-test.js @@ -38,7 +38,7 @@ describe('#verifyArtifactsAreOnMaven', () => { expect(mockSleep).toHaveBeenCalledTimes(1); expect(mockFetch).toHaveBeenCalledWith( - 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1', + 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom', ); }); @@ -55,7 +55,7 @@ describe('#verifyArtifactsAreOnMaven', () => { expect(mockSleep).toHaveBeenCalledTimes(1); expect(mockFetch).toHaveBeenCalledWith( - 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1', + 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom', ); }); @@ -67,7 +67,7 @@ describe('#verifyArtifactsAreOnMaven', () => { expect(mockSleep).toHaveBeenCalledTimes(0); expect(mockFetch).toHaveBeenCalledWith( - 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1', + 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom', ); }); @@ -81,7 +81,7 @@ describe('#verifyArtifactsAreOnMaven', () => { expect(mockSleep).toHaveBeenCalledTimes(90); expect(mockExit).toHaveBeenCalledWith(1); expect(mockFetch).toHaveBeenCalledWith( - 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1', + 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom', ); }); }); diff --git a/.github/workflow-scripts/verifyArtifactsAreOnMaven.js b/.github/workflow-scripts/verifyArtifactsAreOnMaven.js index d2091b00cde..1bb46163e0a 100644 --- a/.github/workflow-scripts/verifyArtifactsAreOnMaven.js +++ b/.github/workflow-scripts/verifyArtifactsAreOnMaven.js @@ -13,13 +13,14 @@ const SLEEP_S = 60; // 1 minute const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min. const ARTIFACT_URL = 'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/'; +const ARTIFACT_NAME = 'react-native-artifacts-'; async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) { if (version.startsWith('v')) { version = version.substring(1); } - const artifactUrl = `${ARTIFACT_URL}${version}`; + const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`; for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) { const response = await fetch(artifactUrl);