🚧 fix: skip Jekyll pages build and prune superseded patch bundles on release - #1955
Draft
jeswr wants to merge 1 commit into
Draft
🚧 fix: skip Jekyll pages build and prune superseded patch bundles on release#1955jeswr wants to merge 1 commit into
jeswr wants to merge 1 commit into
Conversation
…lease The pages branch has grown to ~7.4GB because every release adds ~32MB of webpack bundles (patch dir + three latest copies) with the gh-pages plugin's "add": true, and GitHub's implicit Jekyll build now runs out of disk on the runner (see #1845). - publish a .nojekyll marker with the bundle (and enable the gh-pages plugin's dotfiles option so it is actually picked up) to skip the failing Jekyll build entirely - after semantic-release publishes x.y.z, prune the superseded patch dirs of minor x.y from the pages branch via a blobless sparse clone, bounding per-minor storage at one patch dir plus the latest copies; latest/, vMajor/latest and vMajor/vMinor/latest are never touched, nor are example/ and dev/bench (benchmark workflow) - document the retention policy in the README See #1845. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
🚧 Release-flow fix for the failing pages deployment
References #1845 (intentionally not "Closes" — the pages branch is still ~7.4GB until the separate one-off prune below is approved and executed, so the deployment failure can recur in the meantime).
This PR performs no pages-branch surgery. It only changes the release flow going forward.
What this changes
1. Skip the Jekyll build (
.nojekyll) — immediate mitigationThe failing step is GitHub's implicit
pages-build-deploymentJekyll build, which copies the whole ~7.4GB site on the runner and dies withNo space left on device.scripts/post-webpack.tsnow writes an empty.nojekyllmarker at the bundle root, and the@qiwi/semantic-release-gh-pages-pluginconfig gains"dotfiles": true— without it the plugin'sgh-pagesglobbing (**/*withdot: falseby default) silently drops the file. Once the next release publishes it, Jekyll is skipped entirely. (The 1GB GitHub Pages site limit still applies, hence 2. and the one-off prune.)2. Stop the regrowth — bound per-minor storage
Each release adds ~32MB (patch dir +
latest+vMajor/latest+vMajor/vMinor/latest, each holdingindex.js+dynamic-import.jsat ~4MB) and"add": truemeans nothing is ever removed. Now, aftersemantic-releasepublishesx.y.z, a new workflow step prunes the superseded patch dirs of minorx.yfrom the pages branch:latest/,vMajor/latest,vMajor/vMinor/latest(all documented URL shapes in the README keep working),example/, other minors/majors, anddev/bench(written by the benchmark workflow — the prune only ever deletes numeric dirs directly under<major>/<minor>/, so it cannot reach it by construction).4/10/1and4/10/2. Per-minor storage is thus bounded at one patch dir + the latest copies. (Pinning an exact older patch remains possible via the npm package; README updated to say so.)--filter=blob:none+ cone sparse-checkout of<major>/<minor>only), so the runner never materialises the large branch;ts-node scripts/prune-pagesdecides what to delete; push uses the sameGH_TOKENas the release (agithub.tokenpush would not trigger the Pages deployment) with a fetch+rebase retry loop in case the benchmark writer races.The prune logic lives in
scripts/prune-pages.ts(exported + CLI with--dry-run) and is covered by a new jest suite.Dry-run evidence (local, no publish, no pages push)
Fixture tree mirroring the pages branch (
latest/,4/latest,4/10/{1,2,3,latest},4/9/{9,latest},3/22/{0,latest},3/latest,example/,dev/bench/,.nojekyll):Real run against the fixture removes exactly
4/10/1and4/10/2; everything else (includingdev/benchand alllatestshapes) verified untouched.End-to-end rehearsal of the exact workflow step against a local bare repo standing in for
origin(blobless sparse clone → prune → commit → push): resultingpagestree keeps.nojekyll,3/22/{0,latest},4/9/{9,latest},4/10/{3,latest}, alllatestshapes,example/,dev/bench— only4/10/1and4/10/2dropped. A second rehearsal with a competingdev/benchcommit pushed mid-flight confirmed the retry loop recovers (rejected push → fetch+rebase → push OK on attempt 2) with both the bench update and the prune preserved..nojekyllpath:post-webpack.tssmoke-tested in an isolated fake repo —bundle/.nojekyll(0 bytes) created alongside the usualdynamic-import.jsand the threelatestcopies.Validation:
eslinton touched files exit 0;tsc --noEmiton the new/changed scripts + test exit 0; new jest suite 6/6 passing; workflow YAML parses.One-off prune (separate sign-off)
Not part of this PR — awaiting explicit approval from @jeswr before anything is done to the pages branch. This PR only bounds future growth; the branch is already ~7.4GB (2,974 files, 188 minor dirs), ~7x the 1GB Pages limit. The proposed one-off action is:
pagesbranch as a single orphan commit (shrinking clone/checkout size, not just the deployed tree) containing only:dev/bench(benchmark history),example/,latest/, everyvMajor/latest, everyvMajor/vMinor/latest, and the current patch dir of the newest minor, plus.nojekyll./x/y/z/index.jsfor superseded patches) stop resolving — anyone pinning them should move tovMajor/vMinor/latestor the npm package, where every published bundle remains available forever (dist/ships in theeyereasonerpackage). All documented URL shapes in the README keep working.Happy to adjust retention (e.g. keep the last N patch dirs per minor instead of one) if preferred — the prune script takes the decision in one place.
🤖 Generated with Claude Code