ci(docs): auto-archive previous docs version when a release branch is cut - #22691
Conversation
… cut Add an `archive-previous-docs-version` job to create-release-branch.yml that, right after a `release/N.N` branch is cut, snapshots the previous stable version's docs from its own release branch and opens a PR (labelled `docs`) adding it to the new branch's archived versions (Docusaurus versioning). Covers Q1 of the docs version transition; Q2 (flipping the live deploy) stays the manual retire+publish pair (#22062 / #22063). - Sources the snapshot from the OUTGOING release branch (release/N.<M-1>), not the just-cut branch (which was cut from main and already holds the next version's docs) — fixes the wrong-content assumption in the manual docs-version-bump.yml path. - Ports the outgoing branch's FULL versioned state (versions.json + all versioned_docs + versioned_sidebars) + the fresh snapshot, then applies the 3-archived-version cap, so no older version silently drops off at the next cut. - Opens a `docs`-labelled PR with the default GITHUB_TOKEN for manual review and merge; the archive is build-verified in-job (onBrokenLinks=throw) before the PR opens. - Fail-closed series selection (gh API enumeration, exact release/N.N regex, numeric per-component sort); dry_run validates the port + build without opening a PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an automated “Q1” docs-version transition step to the release-branch cut workflow, so the outgoing stable docs version is archived onto the newly cut release/N.N branch via an automatically opened, docs-labelled PR (build-verified before opening).
Changes:
- Introduces a new
archive-previous-docs-versionjob that determines the outgoing release series, snapshots its docs via Docusaurus versioning, ports the full versioned docs state, enforces the archived-version cap, regenerates llms artifacts, and build-verifies. - Opens a PR against the newly cut release branch (or validates end-to-end in
dry_runwithout opening a PR). - Extends the Discord notification embed to include a “Docs archive” audit field.
Comments suppressed due to low confidence (1)
.github/workflows/create-release-branch.yml:401
- The Discord notification summary treats any non-
skipped/ non-PR-opened state asn/a. With the dry-run validation path, this will hide useful information (it should explicitly report that the docs archive was validated without opening a PR).
if [ -n "${ARCHIVE_PR_URL:-}" ]; then
archive_field="[Archive PR opened]($ARCHIVE_PR_URL)"
elif [ "${ARCHIVE_OUTCOME:-}" = "skipped" ]; then
archive_field=":information_source: ${ARCHIVE_DETAIL:-skipped}"
else
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review on #22691: in dry-run mode the archive job's `outcome` output resolved to the non-terminal `proceed` from the plan step, which also made notify's "Docs archive" field inaccurate. The dry-run summary step now emits `outcome=dry-run` (+ detail), the job outputs prefer it, and notify renders the dry-run/skipped detail instead of "n/a". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep more historical doc versions on the site (current + 5 archived ≈ a year+ of coverage at Erigon's minor cadence). Marginal cost is ~4 MB built HTML per version and one extra Docusaurus render pass; deployed-size and Pages limits are nowhere near binding. Applied in both cap enforcers to stay consistent: create-release-branch.yml (auto-archive job) and docs-version-bump.yml (manual). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Blocked by flaky merge-group CI — requesting a maintainer mergeThis PR is CLEAN + APPROVED and passes every required check on its head, but it has been evicted from the merge queue three times, each time due to merge-group CI infrastructure that is unrelated to the change (this PR only edits
The Could a maintainer with admin please either:
Happy to rebase if needed. cc @lystopad |
… cut (#22691) ## What Adds an `archive-previous-docs-version` job to `create-release-branch.yml` that runs right after a `release/N.N` branch is cut and opens a **`docs`-labelled PR** archiving the previous stable docs version onto the freshly-cut branch (Docusaurus native versioning). A human reviews and merges that PR. This automates **Q1** of the docs version transition (archive the outgoing version). **Q2** — flipping the live deploy on docs.erigon.tech to the new series — is intentionally left as the existing manual retire+publish pair (#22062 / #22063). ## Why Versioning is not automatic today: cutting `release/3.6` leaves `versions.json` without a `v3.5` snapshot, so the previous stable version would silently drop out of the version dropdown. Doing it by hand is easy to forget or get wrong. ## How it works - **Sources the snapshot from the OUTGOING release branch** (`release/N.<M-1>`), not the just-cut branch — which was cut from `main` and already holds the *next* version's docs. (This is the correctness bug the manual `docs-version-bump.yml` path is prone to.) - **Ports the outgoing branch's full versioned state** (`versions.json` + all `versioned_docs/` + `versioned_sidebars/`) plus the fresh snapshot, then enforces the 3-archived-version cap — so no older version drops off at the *next* cut. - **Fail-closed series selection**: enumerates `release/N.N` branches via the GitHub API, exact regex (excludes patch-style names like `release/3.0.10`), numeric per-component sort (so `3.10 > 3.9`); aborts on API error rather than guessing. - **Build-verified before opening** (`onBrokenLinks: throw`), llms.txt regenerated. - **`dry_run`** validates the full port + build without opening a PR. - Opens the PR with the default `GITHUB_TOKEN` (scoped `contents:write` + `pull-requests:write`) for manual review/merge. Note: a `GITHUB_TOKEN`-opened PR does not itself trigger `pull_request` CI (Actions recursion guard); the archive is already build-verified in-job, and a reviewer merges after inspecting the diff. ## Notes for reviewers - The version chain stays intact only if each cycle's archive PR is merged into its release branch before the next cut (inherent to the human-merge model; no worse than today's fully-manual state). - Passed `actionlint` (with shellcheck) and `zizmor` locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Bloxster <gianni.morselli@erigon.tech> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit a18ea1c)
What
Adds an
archive-previous-docs-versionjob tocreate-release-branch.ymlthat runs right after arelease/N.Nbranch is cut and opens adocs-labelled PR archiving the previous stable docs version onto the freshly-cut branch (Docusaurus native versioning). A human reviews and merges that PR.This automates Q1 of the docs version transition (archive the outgoing version). Q2 — flipping the live deploy on docs.erigon.tech to the new series — is intentionally left as the existing manual retire+publish pair (#22062 / #22063).
Why
Versioning is not automatic today: cutting
release/3.6leavesversions.jsonwithout av3.5snapshot, so the previous stable version would silently drop out of the version dropdown. Doing it by hand is easy to forget or get wrong.How it works
release/N.<M-1>), not the just-cut branch — which was cut frommainand already holds the next version's docs. (This is the correctness bug the manualdocs-version-bump.ymlpath is prone to.)versions.json+ allversioned_docs/+versioned_sidebars/) plus the fresh snapshot, then enforces the 3-archived-version cap — so no older version drops off at the next cut.release/N.Nbranches via the GitHub API, exact regex (excludes patch-style names likerelease/3.0.10), numeric per-component sort (so3.10 > 3.9); aborts on API error rather than guessing.onBrokenLinks: throw), llms.txt regenerated.dry_runvalidates the full port + build without opening a PR.GITHUB_TOKEN(scopedcontents:write+pull-requests:write) for manual review/merge. Note: aGITHUB_TOKEN-opened PR does not itself triggerpull_requestCI (Actions recursion guard); the archive is already build-verified in-job, and a reviewer merges after inspecting the diff.Notes for reviewers
actionlint(with shellcheck) andzizmorlocally.🤖 Generated with Claude Code