From b893cd8b9fb106c84df0592562728c9991aaca2c Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Mon, 23 Nov 2026 17:29:23 -0300 Subject: [PATCH] Give the npm verification in post_publish 15 minutes instead of 3 Every release publish run from 0.88.0-rc.4 to 0.89.0-rc.2 failed in post_publish while the package itself was published. npm takes 5 to 12 minutes after `npm publish` returns before the `next` or `latest` dist-tag names the new version, and the verify steps only waited 3 minutes. The verifier also logged "Found @ on npm" as soon as the dist-tag document fetched, before checking which version the tag named. That line now only prints for a plain version lookup. --- .../workflow-scripts/__tests__/publishTemplate-test.js | 4 ++-- .../workflow-scripts/__tests__/verifyReleaseOnNpm-test.js | 8 ++++---- .github/workflow-scripts/publishTemplate.js | 2 +- .github/workflow-scripts/verifyPublishedPackage.js | 4 ++-- .github/workflow-scripts/verifyReleaseOnNpm.js | 2 +- .github/workflows/publish-npm.yml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflow-scripts/__tests__/publishTemplate-test.js b/.github/workflow-scripts/__tests__/publishTemplate-test.js index 25734752cf4c..464a76f5b408 100644 --- a/.github/workflow-scripts/__tests__/publishTemplate-test.js +++ b/.github/workflow-scripts/__tests__/publishTemplate-test.js @@ -95,7 +95,7 @@ describe('#verifyPublishedTemplate', () => { '@react-native-community/template', version, null, - 18, + 90, ); }); @@ -109,7 +109,7 @@ describe('#verifyPublishedTemplate', () => { '@react-native-community/template', version, 'latest', - 18, + 90, ); }); diff --git a/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js b/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js index e55f126183b5..cd7ce85cf1e4 100644 --- a/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js +++ b/.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js @@ -33,7 +33,7 @@ describe('#verifyReleaseOnNPM', () => { 'react-native', version, null, - 18, + 90, ); }); @@ -47,7 +47,7 @@ describe('#verifyReleaseOnNPM', () => { 'react-native', version, 'latest', - 18, + 90, ); }); @@ -61,7 +61,7 @@ describe('#verifyReleaseOnNPM', () => { 'react-native', version, 'next', - 18, + 90, ); }); @@ -75,7 +75,7 @@ describe('#verifyReleaseOnNPM', () => { 'react-native', version, 'next', - 18, + 90, ); }); diff --git a/.github/workflow-scripts/publishTemplate.js b/.github/workflow-scripts/publishTemplate.js index 0d4f5b343931..6b7f6d40339d 100644 --- a/.github/workflow-scripts/publishTemplate.js +++ b/.github/workflow-scripts/publishTemplate.js @@ -54,7 +54,7 @@ module.exports.publishTemplate = async (github, version, dryRun = true) => { }); }; -const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins. +const MAX_RETRIES = 15 * 6; // 90 attempts. Waiting between attempt: 10 s. Total time: 15 mins. const TEMPLATE_NPM_PKG = '@react-native-community/template'; /** diff --git a/.github/workflow-scripts/verifyPublishedPackage.js b/.github/workflow-scripts/verifyPublishedPackage.js index b7358b9b253d..403b05ac728a 100644 --- a/.github/workflow-scripts/verifyPublishedPackage.js +++ b/.github/workflow-scripts/verifyPublishedPackage.js @@ -10,7 +10,7 @@ const {log, getNpmPackageInfo, sleep} = require('./utils'); const SLEEP_S = 10; -const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins. +const MAX_RETRIES = 15 * 6; // 90 attempts. Waiting between attempt: 10 s. Total time: 15 mins. async function verifyPublishedPackage( packageName, @@ -24,8 +24,8 @@ async function verifyPublishedPackage( while (count-- > 0) { try { const json = await getNpmPackageInfo(packageName, tag ? tag : version); - log(`🎉 Found ${packageName}@${version} on npm`); if (!tag) { + log(`🎉 Found ${packageName}@${version} on npm`); return; } diff --git a/.github/workflow-scripts/verifyReleaseOnNpm.js b/.github/workflow-scripts/verifyReleaseOnNpm.js index e65cda401230..e206b4bcf1a0 100644 --- a/.github/workflow-scripts/verifyReleaseOnNpm.js +++ b/.github/workflow-scripts/verifyReleaseOnNpm.js @@ -10,7 +10,7 @@ const {run, sleep, log} = require('./utils.js'); const {verifyPublishedPackage} = require('./verifyPublishedPackage.js'); const REACT_NATIVE_NPM_PKG = 'react-native'; -const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins. +const MAX_RETRIES = 15 * 6; // 90 attempts. Waiting between attempt: 10 s. Total time: 15 mins. /** * Will verify that @latest, @next and the @ have been published. * diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 4326c0f047f1..9533c075685b 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -258,7 +258,7 @@ jobs: const isDryRun = false await publishTemplate(github, version, isDryRun); - name: Wait for template to be published - timeout-minutes: 3 + timeout-minutes: 16 uses: actions/github-script@v8 with: github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }} @@ -273,7 +273,7 @@ jobs: -H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \ -d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}" - name: Verify Release is on NPM - timeout-minutes: 3 + timeout-minutes: 16 uses: actions/github-script@v8 with: github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}