[TEST] sparse-checkout: dirty docs across multiple cones (expect fail)#8873
[TEST] sparse-checkout: dirty docs across multiple cones (expect fail)#8873SamuelReeder wants to merge 4 commits into
Conversation
The pre-commit workflow used `actions/checkout` with `fetch-depth: 0`, which fetches every branch in the repo (thousands), making checkout take ~8 minutes. The --from-ref/--to-ref diff only needs full history for the branch being compared against. Replace it with a default shallow checkout plus a targeted fetch of just the base branch, deepened via --unshallow (guarded for already-complete repos) and with --filter=blob:none since `git diff --name-only` only needs trees. This keeps the three-dot merge base resolvable for both PR and push events.
The pre-commit checkout took ~8 minutes. CI logs showed the cost is not branch enumeration but downloading the blob pack for one snapshot of the monorepo: a single commit's working tree is ~43,757 blobs (~9 GB), and a depth-1 fetch of one ref takes ~6 minutes on its own. Switch checkout to a blobless partial clone (`filter: blob:none`) with a minimal sparse-checkout, then widen the sparse cone to only the projects touched by the diff. Blobs for untouched projects are never fetched, so a typical PR fetches megabytes instead of ~9 GB. Project-level granularity keeps each project's configs and local pre-commit hook scripts present even when they live in sibling directories. The base branch is still fetched on its own (commits/trees only) so the three-dot --from-ref/--to-ref merge base resolves without fetching every branch.
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (76.92%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #8873 +/- ##
========================================
Coverage 71.34% 71.34%
========================================
Files 2613 2613
Lines 408997 408997
Branches 61114 61114
========================================
Hits 291775 291775
Misses 95825 95825
Partials 21397 21397
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
Throwaway test PR for the blobless sparse-checkout pre-commit workflow (#8863). Based on that branch so the new workflow runs; test commits change only docs.
Touches multiple cones at once to exercise the multi-element DIRS array and
git sparse-checkout set --conewith several dirs:TEST_multi_root.md(root, no cone dir)docs/TEST_sparse_nf2.md(conedocs)projects/hipdnn/docs/TEST_multi.md(coneprojects/hipdnn)shared/stinkytofu/docs/TEST_multi.md(coneshared/stinkytofu)All four are dirty (trailing whitespace + no final newline). Expected: pre-commit fails and lists every one of the four files under trailing-whitespace / end-of-file-fixer, proving each path across multiple cones was materialized and checked. Confirmed in the run.