mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-16 14:42:29 -05:00
[PR #1404] [MERGED] PR-1: Release-prep safety net (link checking + publish guards + nightly link-rot) #15429
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1404
Author: @profvjreddi
Created: 4/19/2026
Status: ✅ Merged
Merged: 4/20/2026
Merged by: @profvjreddi
Base:
dev← Head:release-prep/safety-net📝 Commits (4)
159005dci(links): add Tier 1 pre-commit internal-link checkera0333d5ci(links): Tier 2 per-site Lychee validate-dev coverage92003cdci(release): publish-live green gate + nightly link rot trackerd239a90fix(ci): drop --exclude-mail from Lychee args (removed in v0.21)📊 Changes
24 files changed (+1556 additions, -69 deletions)
View changed files
📝
.github/workflows/book-publish-live.yml(+13 -0)📝
.github/workflows/book-validate-dev.yml(+20 -1)📝
.github/workflows/infra-link-check.yml(+89 -26)➕
.github/workflows/infra-link-rot-nightly.yml(+280 -0)➕
.github/workflows/infra-publish-guard.yml(+122 -0)📝
.github/workflows/instructors-publish-live.yml(+9 -0)📝
.github/workflows/instructors-validate-dev.yml(+11 -33)📝
.github/workflows/kits-publish-live.yml(+10 -1)📝
.github/workflows/kits-validate-dev.yml(+22 -2)📝
.github/workflows/labs-publish-live.yml(+9 -0)📝
.github/workflows/labs-validate-dev.yml(+21 -2)📝
.github/workflows/mlsysim-publish-live.yml(+10 -1)📝
.github/workflows/mlsysim-validate-dev.yml(+15 -0)📝
.github/workflows/site-publish-live.yml(+9 -0)➕
.github/workflows/site-validate-dev.yml(+148 -0)📝
.github/workflows/slides-publish-live.yml(+9 -0)📝
.github/workflows/slides-validate-dev.yml(+21 -2)📝
.github/workflows/staffml-publish-live.yml(+9 -0)➕
.github/workflows/staffml-validate-dev.yml(+239 -0)📝
.github/workflows/tinytorch-publish-live.yml(+12 -0)...and 4 more files
📄 Description
Summary
The first of five logical PRs that make up the staged-rollout foundation
for the new mlsysbook.ai ecosystem properties. This PR is the safety
net layer — three tiers of link checking plus a publish-guard so that
no
*-publish-liveworkflow can deploy without a recent green*-validate-devrun.Nothing in this PR ships content; everything is plumbing.
What's in this PR
Tier 1 — pre-commit (instant, local). New
shared/scripts/check-internal-links.pyruns against staged.md/.qmdfiles only, validates internal links + anchors, skips fenced code
blocks and inline code (so TikZ snippets etc. don't false-positive),
and is wired into
.pre-commit-config.yamlwith anexcludelist forknown legacy / auto-generated paths.
Tier 2 — per-subsite CI (every PR + every dev push). Generalized
.github/workflows/infra-link-check.ymlto take site-specific args(
include_pattern,lycheeignore_path,accept_status,fail_on_broken). Every*-validate-dev.ymlnow invokes it as acheck-linksjob. Createdsite-validate-dev.ymlandstaffml-validate-dev.ymlfor the two subsites that lacked validateworkflows. Universal exclusions live in
shared/config/.lycheeignore.Publish guard. New
.github/workflows/infra-publish-guard.ymlblocks every
*-publish-live.ymlfrom running unless the latest*-validate-dev.ymlrun ondevis green and recent (configurablemax_age_minutes, default 60). Wired as the first job of each publishworkflow.
Tier 3 — nightly link-rot tracker. New
.github/workflows/infra-link-rot-nightly.ymlsweeps every subsite at04:30 UTC and aggregates findings into a single sticky GitHub issue
(label
link-rot). Each run replaces the issue body and appends acomment, so the issue is the always-current dashboard.
Risk surface
Tier 1 + Tier 2 are non-blocking by default (
fail_on_broken: false)so existing baseline failures don't immediately gate merges; we can
flip the flag per-subsite as backlogs are cleared. Publish guards
CAN block on green dev — that's the whole point.
Verification done locally
python3 .github/scripts/check_workflow_fork_safety.pyon all fivenew/modified workflows — clean.
check-internal-links.pyexercised against a real.qmdfile.non-md files).
Verification still pending in this PR's CI
watching whether:
shared/config/.lycheeignorepatterns.include_patternglobs match what we think theymatch.
only invoked on workflow_dispatch, so this PR exercises everything
EXCEPT the guard — that gets exercised the first time someone
clicks "Run" on a
*-publish-liveworkflow).What this PR does NOT change
book/,tinytorch/,labs/,kits/, etc. Thesource content is untouched.
guardjob beforeexisting logic runs.
Test plan
book-validate-devruns to completion, including the newcheck-linksjob.tinytorch-validate-dev,labs-validate-dev,kits-validate-dev,mlsysim-validate-devall pass withcheck-links.
site-validate-devandstaffml-validate-dev(newlycreated) at least start and report.
.qmdchange without hanging.
confirm Lychee output is interpretable.
Followup
Four more PRs on the existing release-prep work. Tracked in
RELEASE-PREP.md(not in this PR — comes with PR-3).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.