Skip to content

Commit 1a6887b

Browse files
committed
[LOCAL] Add more logging around computeNightlyTarballURL
1 parent e01cbf9 commit 1a6887b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • packages/react-native/scripts/ios-prebuild

packages/react-native/scripts/ios-prebuild/utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,29 @@ async function computeNightlyTarballURL(
6565
artifactCoordinate /*: string */,
6666
artifactName /*: string */,
6767
) /*: Promise<string> */ {
68+
const urlLog = createLogger('NightlyURL');
6869
const xmlUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/${artifactCoordinate}/${version}-SNAPSHOT/maven-metadata.xml`;
6970

71+
urlLog(`Attempting to download maven-metadata.xml from: ${xmlUrl}...`);
7072
const response = await fetch(xmlUrl);
7173
if (!response.ok) {
74+
urlLog(`Downloading maven-metadata.xml failed!`, 'error');
7275
return '';
7376
}
7477
const xmlText = await response.text();
7578

7679
// Extract the <snapshot> block
7780
const snapshotMatch = xmlText.match(/<snapshot>([\s\S]*?)<\/snapshot>/);
7881
if (!snapshotMatch) {
82+
urlLog(`Could not find a <snapshot> tag that matches the regex!`, 'error');
7983
return '';
8084
}
8185
const snapshotContent = snapshotMatch[1];
8286

8387
// Extract <timestamp> from the snapshot block
8488
const timestampMatch = snapshotContent.match(/<timestamp>(.*?)<\/timestamp>/);
8589
if (!timestampMatch) {
90+
urlLog(`Could not find a <timestamp> tag inside <snapshot> that matches the regex!`, 'error');
8691
return '';
8792
}
8893
const timestamp = timestampMatch[1];
@@ -92,12 +97,14 @@ async function computeNightlyTarballURL(
9297
/<buildNumber>(.*?)<\/buildNumber>/,
9398
);
9499
if (!buildNumberMatch) {
100+
urlLog(`Could not find a <buildNumber> tag that matches the regex!`, 'error');
95101
return '';
96102
}
97103
const buildNumber = buildNumberMatch[1];
98104

99105
const fullVersion = `${version}-${timestamp}-${buildNumber}`;
100106
const finalUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/${artifactCoordinate}/${version}-SNAPSHOT/${artifactCoordinate}-${fullVersion}-${artifactName}`;
107+
urlLog(`Final artifact URL found: ${finalUrl}`);
101108
return finalUrl;
102109
}
103110

0 commit comments

Comments
 (0)