Use shallow fetches for generated dashboard branches - #1089
Use shallow fetches for generated dashboard branches#1089jamesmontemagno wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Note This PR is from a fork and modifies infrastructure files ( Changes to infrastructure typically need to be submitted from a branch in Please consider recreating this PR from an upstream branch. If you don't have push access to |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Review tier: Lite
Findings: None
What changed in this PR
This PR reduces GitHub Actions network/disk usage by switching generated dashboard snapshot branches (dashboard-token-data, dashboard-eval-data, and gh-pages) to shallow fetch/clone operations where only the current tip is consumed or updated.
Changes:
- Use
git fetch --depth=1when retrieving the latest snapshot content fromdashboard-token-dataanddashboard-eval-data. - Use
git clone --depth=1when preparing working copies ofdashboard-token-data,dashboard-eval-data, andgh-pagesfor publishing updates.
| File | Description |
|---|---|
| .github/workflows/evaluation.yml | Updates fetch/clone commands for generated dashboard branches to use depth-1 shallow operations while preserving existing publish behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
🔒 Secret-backed evaluation is disabled for fork PRs. A maintainer must review and promote the change to a trusted repository branch before running |
AbhitejJohn
left a comment
There was a problem hiding this comment.
Thanks for the fix James. If you wouldn't mind converting this to a branch in the repo, the CI should kick in and we can merge this through.
|
@AbhitejJohn I confirmed my account has triage/pull access but not push access to A maintainer can promote it with: git fetch https://github.com/jamesmontemagno/skills.git motz-shallow-dashboard-fetches
git push origin FETCH_HEAD:refs/heads/motz-shallow-dashboard-fetchesGitHub cannot change an existing PR's head repository, so after the upstream branch exists we should open a replacement PR from |
|
@jamesmontemagno : Sounds good. I ported this over here: #1099. Thanks again for the fix. |
Problem
The dashboard publishing workflow fetches and clones generated branches that contain append-only snapshots. Its consumers only need the current files at each branch tip, but several operations currently allow Git to bring in the branches' full reachable ancestry. On ephemeral Actions runners, that creates avoidable network transfer and object retention.
This is not the same as the repository's compact server-side size. GitHub repository metadata reports roughly 139,194 KiB (~136 MiB) because the server-side pack is well delta-compressed. Our local analysis with
git-sizer, however, found about 10.2 GiB of total uncompressed blob content across reachable history.Evidence
Measurements from a fresh bare clone show how much historical snapshot content is reachable from each generated branch versus how compactly GitHub can represent it in an optimized pack:
gh-pagesdashboard-eval-datadashboard-token-dataThese branch totals overlap because branches can reach shared objects. They should not be added together and presented as the repository's unique size.
One concrete source of growth is
data/token-usage.json: the analysis found 258 historicalgh-pagesversions, with individual historical blobs reaching roughly 20–40 MiB. That history is useful context for understanding object volume, but the workflow reads only the current file.Why this happens
The generated branches are append-only snapshots. Fetching a disconnected generated branch without
--depth=1can download and retain ancestry that the job never reads. Depending on fetch order, automatic maintenance/repacking, retained refs or reflogs, and duplicate or poorly packed local packs, an ephemeral runner can therefore end up with much more data than GitHub's optimized server-side pack suggests.This explains reports of workflow
.gitdirectories exceeding 2 GiB without implying that every clone will have that size. The exact local footprint is sequence- and maintenance-dependent.What changed
This PR adds
--depth=1at all seven relevant sites in.github/workflows/evaluation.yml:dashboard-token-dataanddashboard-eval-datain their data-generation jobs, plus both branches again indeploy-dashboarddashboard-token-data,dashboard-eval-data, andgh-pagesbefore publishing updatesNo unrelated fetches or clones are changed.
Safety and behavior
The change preserves the existing workflow behavior:
checkout,show, orcopyonly against files in the fetched tip snapshot; they do not inspect generated-branch historyLimitations
This is deliberately a safe first step. It does not rewrite or compact existing remote history, alter retention behavior, force-push, or permanently stop generated-branch history growth. It reduces runner transfer and local object retention now.
A maintainer-approved generated-branch compaction or migration to Pages artifacts could address remote history growth separately, but neither is part of this PR.
Validation
actionlintv1.7.7 passed for.github/workflows/evaluation.ymlwith ShellCheck and pyflakes integration disabled, matching the repository's targeted workflow validation.