Skip to content

Commit b893cd8

Browse files
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 <pkg>@<version> 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.
1 parent 5dc1d78 commit b893cd8

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎.github/workflow-scripts/__tests__/publishTemplate-test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('#verifyPublishedTemplate', () => {
9595
'@react-native-community/template',
9696
version,
9797
null,
98-
18,
98+
90,
9999
);
100100
});
101101

@@ -109,7 +109,7 @@ describe('#verifyPublishedTemplate', () => {
109109
'@react-native-community/template',
110110
version,
111111
'latest',
112-
18,
112+
90,
113113
);
114114
});
115115

‎.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('#verifyReleaseOnNPM', () => {
3333
'react-native',
3434
version,
3535
null,
36-
18,
36+
90,
3737
);
3838
});
3939

@@ -47,7 +47,7 @@ describe('#verifyReleaseOnNPM', () => {
4747
'react-native',
4848
version,
4949
'latest',
50-
18,
50+
90,
5151
);
5252
});
5353

@@ -61,7 +61,7 @@ describe('#verifyReleaseOnNPM', () => {
6161
'react-native',
6262
version,
6363
'next',
64-
18,
64+
90,
6565
);
6666
});
6767

@@ -75,7 +75,7 @@ describe('#verifyReleaseOnNPM', () => {
7575
'react-native',
7676
version,
7777
'next',
78-
18,
78+
90,
7979
);
8080
});
8181

‎.github/workflow-scripts/publishTemplate.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports.publishTemplate = async (github, version, dryRun = true) => {
5454
});
5555
};
5656

57-
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
57+
const MAX_RETRIES = 15 * 6; // 90 attempts. Waiting between attempt: 10 s. Total time: 15 mins.
5858
const TEMPLATE_NPM_PKG = '@react-native-community/template';
5959

6060
/**

‎.github/workflow-scripts/verifyPublishedPackage.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
const {log, getNpmPackageInfo, sleep} = require('./utils');
1111

1212
const SLEEP_S = 10;
13-
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
13+
const MAX_RETRIES = 15 * 6; // 90 attempts. Waiting between attempt: 10 s. Total time: 15 mins.
1414

1515
async function verifyPublishedPackage(
1616
packageName,
@@ -24,8 +24,8 @@ async function verifyPublishedPackage(
2424
while (count-- > 0) {
2525
try {
2626
const json = await getNpmPackageInfo(packageName, tag ? tag : version);
27-
log(`🎉 Found ${packageName}@${version} on npm`);
2827
if (!tag) {
28+
log(`🎉 Found ${packageName}@${version} on npm`);
2929
return;
3030
}
3131

‎.github/workflow-scripts/verifyReleaseOnNpm.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
const {run, sleep, log} = require('./utils.js');
1111
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
1212
const REACT_NATIVE_NPM_PKG = 'react-native';
13-
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
13+
const MAX_RETRIES = 15 * 6; // 90 attempts. Waiting between attempt: 10 s. Total time: 15 mins.
1414
/**
1515
* Will verify that @latest, @next and the @<version> have been published.
1616
*

‎.github/workflows/publish-npm.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ jobs:
258258
const isDryRun = false
259259
await publishTemplate(github, version, isDryRun);
260260
- name: Wait for template to be published
261-
timeout-minutes: 3
261+
timeout-minutes: 16
262262
uses: actions/github-script@v8
263263
with:
264264
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
@@ -273,7 +273,7 @@ jobs:
273273
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
274274
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
275275
- name: Verify Release is on NPM
276-
timeout-minutes: 3
276+
timeout-minutes: 16
277277
uses: actions/github-script@v8
278278
with:
279279
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)