Repository navigation
[codex] Compact gh-pages history - #2239
Merged
Merged
Conversation
|
@thedjpetersen must be a member of the Meta Open Source team on Vercel to deploy. Learn more about collaboration on Vercel and other options here. |
thedjpetersen
force-pushed
the
codex/compact-gh-pages-history
branch
from
May 20, 2026 03:35
7631635 to
d245851
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
thedjpetersen
marked this pull request as ready for review
May 20, 2026 18:36
thedjpetersen
requested review from
cixzhang,
czarandy and
josephfarina
as code owners
May 20, 2026 18:36
cixzhang
approved these changes
May 20, 2026
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
added a commit
that referenced
this pull request
Aug 5, 2026
…an commit (#4718) Every push to main has had its Deploy job cancelled for ~a day (15-min job timeout). The deploy job cloned all of gh-pages and `cp -r`'d the entire /pr/ tree forward on every push. With ~52 live previews (>1GB, ~40k files) the clone + two copies blew the 15-min budget before the publish step ever ran. The cost was O(all live previews) per deploy — a full local copy of the tree was required because peaceiris `force_orphan:true` publishes whatever is in publish_dir. Fix: build the single orphan commit ourselves and reuse /pr/ & /reports/ by SHA instead of copying them: - --filter=blob:none + sparse-checkout materializes ONLY the stable paths (storybook/ sandbox/ assets/ + root files). /pr/ & /reports/ (the >1GB of preview blobs) are never fetched or written — they stay in the index as skip-worktree entries. - clean-replace the stable paths so superseded content-hashed assets don't accumulate (keeps what keep_files:false originally fixed, #916). - git write-tree rebuilds the full tree from the index (pr/ & reports/ reused by SHA); git commit-tree with no parent produces a single orphan commit — the same clean-slate history force_orphan gave us (#2239/#2238), now without a full local copy of gh-pages. - push with --force-with-lease + retry to stay safe against concurrent gh-pages writers (other main deploys, PR-preview pushes). Deploy time is now O(1) in preview count. compact-gh-pages.yml stays as the weekly history backstop. Note: deploy-preview.yml still full-clones gh-pages per preview push (same root pattern, not yet at the timeout) — worth the same treatment as a follow-up.
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.
Summary
Fixes #2238.
Adds a
gh-pageshistory compaction path so generated Pages artifacts do not keep accumulating in normal clones:.github/scripts/compact-gh-pages-history.sh, which rewrites the currentgh-pagestree as a single commit with--force-with-leaseCompact GitHub Pages Historyworkflowforce_orphan: trueso main deploys also collapse old generated artifact historyWhy
The current clone bloat was caused by generated Storybook/Sandbox preview and report artifacts retained in
gh-pageshistory. Cleanup commits remove old files from the live Pages tree, but they do not remove blobs from Git history.One-time cleanup
Already ran the one-time branch compaction from this branch locally:
gh-pages:2c84ef7a58a8439c4d0c709e68dad60966d900e6gh-pages:531f620791ca6d5235644710fb555cd316238519This PR keeps that cleanup from regressing after merge.
Validation
bash -n .github/scripts/compact-gh-pages-history.sh./scripts/add-copyright.sh --check.github/workflows/compact-gh-pages.ymland.github/workflows/deploy.ymlgit diff --check