Skip to content

gh-151365: Retry git fetch in CI workflows - #155490

Closed
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:ci-retry-shallow-fetch
Closed

serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:ci-retry-shallow-fetch

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Fetching the history for computing the branch diff can fail with fatal: shallow file has changed since we read it, a git 2.54 bug (fixed in git 2.55, which is not yet in the runner images) which is hit especially often for old pull requests, which have a lot of history to fetch.

Retry the fetch up to 5 times, and annotate the run with a warning on every retry.

🤖 Generated with Claude Code

Fetching the history for computing the branch diff can fail with
"fatal: shallow file has changed since we read it", a git 2.54 bug
which is hit especially often for old pull requests, which have a lot
of history to fetch.

Retry the fetch up to 3 times, and annotate the run with a warning on
every retry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@webknjaz webknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, let's try this

@hugovk

hugovk commented Aug 10, 2026

Copy link
Copy Markdown
Member

With manual re-runs, it sometimes fails after even 7 retries. Shall we try 10 here?

@vstinner

Copy link
Copy Markdown
Member

Downgrading Git sounds like a more reliable solution: #155495.

@webknjaz

Copy link
Copy Markdown
Member

Agreed. I also think that #155495 would be preferred.

@StanFromIreland

Copy link
Copy Markdown
Member

I'm also in favour of #155495.

@serhiy-storchaka
serhiy-storchaka deleted the ci-retry-shallow-fetch branch August 11, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants