#53470: ci: retry the depot_tools clones and the angle fetch on transient network errors
Description of Change
Three CI steps fetch over the network with no retry, and each has failed builds on main with errors that pass on a re-run:
- the test job's Get Depot Tools clone from googlesource.com
- Install Build Tools:
npm i -g @electron/build-tools, then the depot_tools clone that the firstecommand performs (fatal: fetch-pack: invalid index-pack output) - Fixup angle git in the fix-sync action, a large
git fetchfrom github.com (error: RPC failed; curl 56 Recv failure: Operation timed out, e.g. https://github.com/electron/electron/actions/runs/33782849304/job/100741729272)
This adds script/actions/retry.sh, which reruns a command with exponential backoff (4 attempts, waiting 1s, 4s and 16s; tunable through RETRY_ATTEMPTS, RETRY_DELAY and RETRY_FACTOR), and prefixes those commands with it. It's a script rather than a composite action so each step stays a plain run: and no command has to pass through an action input. Each wrapped command is safe to repeat: a failed git clone removes its partial directory, and a failed git fetch leaves the repository as it was. A retry shows up as a warning annotation; after the last attempt the step fails with the command's own exit code, as it does today.
The depot_tools clone inside build-tools itself gets the same treatment in electron/build-tools#895, which CI picks up on its next release because this action installs the latest build-tools.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
Release Notes
Notes: none
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron