Skip to content

fix: retry Foundry binary downloads - #9854

Draft
davidmurdoch wants to merge 3 commits into
mainfrom
david/foundryup-download-retries
Draft

fix: retry Foundry binary downloads#9854
davidmurdoch wants to merge 3 commits into
mainfrom
david/foundryup-download-retries

Conversation

@davidmurdoch

@davidmurdoch davidmurdoch commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Explanation

@metamask/foundryup currently aborts an installation after a single transient failure while downloading a Foundry release archive. This makes consumers—especially parallel CI jobs—vulnerable to short-lived GitHub release-asset 5xx, rate-limit, socket-reset, and truncated-stream failures.

This PR retries the complete archive download and extraction operation for errors that are likely transient. Retrying the complete operation ensures a mid-stream failure starts again with a clean temporary directory rather than appending to or consuming a partial archive.

The default policy uses five total attempts with exponential backoff, equal jitter, a 1-second initial delay, and a 30-second delay cap. Permanent HTTP failures and validation errors still fail immediately. No new dependencies are introduced.

Consumers can override the policy with --max-attempts, --initial-retry-delay-ms, and --max-retry-delay-ms, or with the equivalent FOUNDRYUP_MAX_ATTEMPTS, FOUNDRYUP_INITIAL_RETRY_DELAY_MS, and FOUNDRYUP_MAX_RETRY_DELAY_MS environment variables. Setting --max-attempts 1 disables retries.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Validation

  • yarn workspace @metamask/foundryup test:verbose --runInBand
  • yarn eslint packages/foundryup/src/download.ts packages/foundryup/src/download.test.ts packages/foundryup/src/types.ts packages/foundryup/src/options.ts packages/foundryup/src/index.ts packages/foundryup/src/foundryup.test.ts
  • yarn tsc --build packages/foundryup/tsconfig.lint.json
  • yarn workspace @metamask/foundryup build
  • yarn oxfmt --check eslint-suppressions.json packages/foundryup/src/download.ts packages/foundryup/src/download.test.ts packages/foundryup/src/types.ts packages/foundryup/src/options.ts packages/foundryup/src/index.ts packages/foundryup/src/foundryup.test.ts packages/foundryup/README.md packages/foundryup/CHANGELOG.md
  • yarn workspace @metamask/foundryup changelog:validate
  • node packages/foundryup/dist/cli.mjs --help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant