Repository navigation
ci: remove the partial depot_tools clone before retrying it - #53486
Merged
Merged
Conversation
script/actions/retry.sh (#53470, backported in #53473) assumed that a failed `git clone` removes its directory, so it rerun the command as is. That is only true while git is still fetching the pack: once the repository has been written, a failure in the checkout stage keeps the directory, and with --filter=tree:0 the checkout still fetches trees over the network. In the 44-x-y run for #53479, the "Get Depot Tools" step lost DNS mid-clone ("fatal: could not fetch ... from promisor remote"), left ./depot_tools behind, and every retry then failed with "fatal: destination path 'depot_tools' already exists and is not an empty directory", so the wrapper turned one transient error into a guaranteed failure. Add an opt-in RETRY_CLEAN_PATH to retry.sh: when set, the path is removed before each retry, never before the first attempt, and set it to depot_tools at the clone call site. The other callers (npm install, `e d update_depot_tools`, `git fetch`) are unchanged. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pgo4hKUF1UNQCWyBFwRdjg
MarshallOfSound
approved these changes
Sep 3, 2026
MarshallOfSound
enabled auto-merge (squash)
September 3, 2026 23:01
VerteDinde
approved these changes
Sep 3, 2026
|
No Release Notes |
This was referenced Sep 3, 2026
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #53487 |
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #53488 |
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #53489 |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #53490 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested via Slack
Description of Change
Before: when the test job's "Get Depot Tools" clone failed after git had already written the repository,
retry.shreran the samegit cloneagainst the leftover./depot_toolsdirectory, so every retry failed instantly and the step was guaranteed to fail.After:
retry.shtakes an opt-inRETRY_CLEAN_PATH; the depot_tools clone sets it todepot_tools, and the wrapper removes that path before each retry (never before the first attempt), so a retried clone starts from a clean destination.This makes the retry wrapper actually recover from a clone that dies mid-way instead of turning one transient network error into four identical failures.
How: #53470 (backported to 44-x-y in #53473) added
script/actions/retry.shon the assumption that "a failedgit cloneremoves its partial directory". That only holds while git is still fetching the pack: once the repository is written, a failure in the checkout stage keeps the directory, and with--filter=tree:0the checkout still fetches trees over the network.macos-x64 / test (darwin, 2)on #53479 hit exactly that (job 100841887205): a DNS blip during checkout, thenThe cleanup is opt-in and takes an explicit path rather than parsing
git clone's arguments, so the script never deletes anything a caller didn't name, and the other wrapped commands (npm i -g,e d update_depot_tools,git fetch) are unchanged. The header comment inretry.shis corrected to match.Testing
Reproduced with a fake
gitonPATHthat leavesdepot_tools/behind and exits 128 on the first clone, then behaves like real git (fails if the destination exists, succeeds otherwise):Also checked that a pre-existing path is left alone when the first attempt succeeds (
RETRY_CLEAN_PATH=keep bash retry.sh truekeepskeep/x).bash -nand a YAML parse of the workflow pass; shellcheck was not available in the environment, andnode script/lint.jsneeds a full checkout so it was not run.Checklist
Release Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01Pgo4hKUF1UNQCWyBFwRdjg
Notes: none
Generated by Claude Code