All 14 fetch-depth: 0 checkouts across our workflows do a full clone with every blob in history. Most don't need that. Optimizing these would speed up CI, especially on Windows where git operations are slower.
Audit results
Can use fetch-depth: 1 (no history needed — 6 occurrences)
| File |
Job / line |
Why history is unnecessary |
ci.yml |
ci-vars (L38) |
Just reads ci/versions.yml with yq |
build-docs.yml |
docs build (L50) |
Checks out a specific tag/ref, reads config |
release-upload.yml |
upload (L46) |
git archive on a tag already checked out |
release.yml |
check-tag (L65) |
Only uses GitHub CLI, no git ops |
release-cuda-pathfinder.yml |
upload-assets (L164) |
git archive on a tag already checked out |
coverage.yml |
coverage-windows (L272) |
Downloads pre-built wheels, no build step |
Can use fetch-depth: 1 + fetch-tags: true (only need tag resolution — 2 occurrences)
| File |
Job / line |
Why |
release.yml |
determine-run-id (L47) |
lookup-run-id calls git rev-parse on a tag |
release-cuda-pathfinder.yml |
prepare (L64) |
Same — lookup-run-id resolves tag to SHA |
Should use fetch-depth: 0 + filter: blob:none (need commit graph, not blobs — 7 occurrences)
These need the full commit graph (for setuptools-scm / git describe, git merge-base, or git worktree), but don't need historical blobs. A treeless clone (filter: blob:none) fetches the commit graph without blob data, which is significantly faster.
Verified locally that git describe produces identical output with a treeless clone.
| File |
Job / line |
Why it needs the commit graph |
build-wheel.yml |
build (L45) |
setuptools-scm (git describe) |
ci.yml |
detect-changes (L109) |
git merge-base + git diff --name-only |
cleanup-pr-previews.yml |
cleanup (L34) |
git worktree on gh-pages |
coverage.yml |
coverage-linux (L69) |
setuptools-scm |
coverage.yml |
build-wheel-windows (L201) |
setuptools-scm |
test-sdist-linux.yml |
test-sdist (L30) |
python -m build → setuptools-scm |
test-sdist-windows.yml |
test-sdist (L36) |
same |
Summary
Out of 14 occurrences, only 7 actually need the commit graph. The other 7 can be made cheaper — 6 with a plain shallow clone and 2 with shallow + tags. The remaining 7 benefit from filter: blob:none to skip historical blob downloads.
-- Leo's bot
All 14
fetch-depth: 0checkouts across our workflows do a full clone with every blob in history. Most don't need that. Optimizing these would speed up CI, especially on Windows where git operations are slower.Audit results
Can use
fetch-depth: 1(no history needed — 6 occurrences)ci.ymlci-vars(L38)ci/versions.ymlwith yqbuild-docs.ymlrelease-upload.ymlgit archiveon a tag already checked outrelease.ymlcheck-tag(L65)release-cuda-pathfinder.ymlupload-assets(L164)git archiveon a tag already checked outcoverage.ymlcoverage-windows(L272)Can use
fetch-depth: 1+fetch-tags: true(only need tag resolution — 2 occurrences)release.ymldetermine-run-id(L47)lookup-run-idcallsgit rev-parseon a tagrelease-cuda-pathfinder.ymlprepare(L64)lookup-run-idresolves tag to SHAShould use
fetch-depth: 0+filter: blob:none(need commit graph, not blobs — 7 occurrences)These need the full commit graph (for
setuptools-scm/git describe,git merge-base, orgit worktree), but don't need historical blobs. A treeless clone (filter: blob:none) fetches the commit graph without blob data, which is significantly faster.Verified locally that
git describeproduces identical output with a treeless clone.build-wheel.ymlgit describe)ci.ymldetect-changes(L109)git merge-base+git diff --name-onlycleanup-pr-previews.ymlgit worktreeon gh-pagescoverage.ymlcoverage-linux(L69)coverage.ymlbuild-wheel-windows(L201)test-sdist-linux.ymlpython -m build→ setuptools-scmtest-sdist-windows.ymlSummary
Out of 14 occurrences, only 7 actually need the commit graph. The other 7 can be made cheaper — 6 with a plain shallow clone and 2 with shallow + tags. The remaining 7 benefit from
filter: blob:noneto skip historical blob downloads.-- Leo's bot