Skip to content

Commit 00584a1

Browse files
committed
Update flow comment to document retry logic
1 parent 962fddc commit 00584a1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/install-npm-packages.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,11 @@ async function installPackage(packageInfo) {
580580
// When pnpm installs from a GitHub tarball, it respects the "files" field and discards test files.
581581
// To preserve test files, we:
582582
// 1. Download and extract the GitHub tarball ourselves (with validation to catch HTTP errors)
583-
// 2. Verify the downloaded tarball and extracted package.json are not empty
584-
// 3. Remove the "files" field from package.json
585-
// 4. Point pnpm to our modified local directory instead of the GitHub URL
586-
// If extraction fails (HTTP error, empty files, or JSON parse error), fall back to GitHub URL.
583+
// 2. Wait for filesystem to flush, then verify the downloaded tarball and extracted package.json are not empty
584+
// 3. Retry reading package.json up to 3 times with exponential backoff to handle filesystem delays on slow CI
585+
// 4. Remove the "files" field from package.json
586+
// 5. Point pnpm to our modified local directory instead of the GitHub URL
587+
// If extraction fails (HTTP error, empty files, or JSON parse error after retries), fall back to GitHub URL.
587588
let packageSpec = versionSpec
588589

589590
if (versionSpec.startsWith('https://github.com/')) {

0 commit comments

Comments
 (0)