Repository navigation
site-build: build only the sites a change reaches - #111
Conversation
The last open part of QuantEcon/project-monorepo#77: "A pull request that touches one shared lecture rebuilds every product that lists it and no other." The owner, 2026-11-27, chose the same for pushes to main ("Affected only (Recommended)"); the schedule and a manual run still build every site. - tools/affected-sites reads the changed paths and prints the sites they reach. A lecture, or its own _static/<slug>/ files, reaches the sites whose _toc.yml lists it, and a _static/_shared/ asset the sites of the lectures the ledger records as using it. A site's own file reaches that site. Any other build input (the bibliography, another pool file, a build tool, _base/, the sync records, the workflow) reaches every site; anything else none. With --base, a lecture a change drops still reaches the sites that listed it. - site-build.yml's first job compares a pull request with its base and a push with the commit before it (the base fetched alone), writes the sites and why to the run summary, and skips the build job when none is reached. tools/affected-sites joins the path filter. The header says so, and puts mystmd and the shared cache in the second phase. - Tests: every rule, a dropped lecture with --base, a key with no site, and the tool's build inputs against the workflow's path filter. 485 passed. - On tonight's merges: the refresh #107 would have built intro alone, not all six; #101 and #110 none; #106 and #109 all six. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
|
Validation at #77's criterion, run for real. A throwaway draft, #112, was opened against this branch (not main) and is now closed. It planted a failing code cell in
This PR's own build, 46070955297, is green on all six legs. The PR changes The rest, as the body says: 485 tests pass, including every rule, a dropped lecture read with |
From the fresh review of 8accedc: - Renames: the diff runs with --no-renames, so a renamed or moved file counts by its old path as well as its new one. git's rename detection printed only the new name, and a renamed lecture built no site. - A push is compared with the head of the last push build on main that succeeded (actions: read on the first job), not the commit before it. A run cancelled while it waits or by hand, or one that failed, no longer leaves its change unbuilt: the next push takes it in. - A change to the rule itself (the tool or the workflow) builds every site without asking the tool, so a broken tool cannot skip its own build. - Paths travel NUL-separated (-z), so a name git would quote still reaches its site. A base that cannot be fetched builds every site; the tool refuses a --base that is no commit, and a contents list or ledger it cannot parse, with exit 2. - A _static/<dir>/ that is no pool lecture's folder reaches every site. - Tests: nesting in a contents list, the ledger at the base, a rename, an asset moved between lectures' folders, a quoted name, the unreadable base and the unparsable list, and the workflow's diff flags, rule check and push base. 496 passed. - The stale header lines go, and the docs say how a push is compared and which sync records reach a build. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
|
Validation at The fixes, as the updated description has them:
This PR's own build, 46075226621, is green on all six legs. Its matrix job wrote "every site: the change, 6 path(s) against 9efe41b, touches the rule itself": the new check, taking every site without asking the tool. The empty set, run for real. A throwaway draft, #113, was opened against this branch and is now closed. It changed only
GitHub lists the skipped job by its unexpanded name, The review's scenarios, on the real pool, with the workflow's own diff command:
Tests: 496 passed and 1 skipped. Six of the new tests fail on The push path can't run before the merge. Its query, run against this repository now, returns |
…iew's nits From the review of 3ec6097: - tools/sync and sync/state.yml reach only the sites in the series environment (site.yml's default), read here or at the base: only those run tools/sync, which alone reads the pins. sync.yml's near-daily pin refresh, which starts no run itself, now builds dp alone on the next push to main, not all six; sync/manifest.yml, which stage-site reads for every site, still reaches every site. - The last build on main that succeeded is found in its own step, run only on a push and alone holding the token, and may be a push, scheduled or manual build (each a sound base); a pull request's run never is. - The header says to mend a red site first, since it holds the base back, and to re-run an older push build's failed jobs, not all its jobs. - Tests: the series rule, a site moved out of the series environment, a site with no site.yml, the two input lists against the path filter, the query step and that only it holds the token. 501 passed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
Why
The last open part of QuantEcon/project-monorepo#77. Its acceptance criteria:
Today every pull request and push to
mainthat touches a build input builds all six sites. A fix to one intro lecture also rebuilds intermediate, programming and jax on the GPU machines. For pushes tomainthe owner chose the same narrowing on 2026-11-27, in the project-monorepo session: "Affected only (Recommended)". The schedule and a manual run still build every site.What it adds
tools/affected-sitesreads the changed paths and prints the sites, of those named, that they reach:_static/<slug>/files: the sites whose_toc.ymllists it, at any depth of parts, chapters and sections;_static/_shared/asset: the sites of the lectures the ledger records as using it, or every site when it records none;_static/<dir>/that is no pool lecture's folder: every site;sites/README.mdreaches none);tools/syncandsync/state.yml: the sites in theseriesenvironment, here or at the base, since only those runtools/sync(today dp).sync.yml's near-daily pin refresh starts no run, but the next push takes it in, and it builds dp alone;_base/,sync/manifest.yml(whichtools/stage-sitereads for every site) and the workflow. These are the workflow's path filter outside the pool and the sites, and a test keeps the two lists in step;With
--base, the contents lists and the ledger are read at the base too. So a lecture a change drops still builds the sites that listed it, and a shared asset its old users' sites. Paths come NUL-separated with-z. The tool refuses a--basethat is no commit, and a contents list or ledger it can't parse, with exit 2. Links between sites don't widen the set: intersphinx resolves them against the other site's published inventory, not this build.site-build.yml's first job chooses the sites:mainthat succeeded, not the commit before it. That build may be a push, scheduled or manual one, but never a pull request's. A run cancelled while it waits (the concurrency group keeps one waiting), cancelled by hand, or failed then leaves nothing unbuilt: the next push takes its change in. A step of its own reads that run through the API, withactions: read. It runs only on a push, and is the only step that holds the token.main, no build succeeds, so each push builds all that has changed since the last green build. The header says to mend a red site first. It also says to re-run an older push build's failed jobs, not all its jobs.git diff --no-renames --name-only -z. A renamed or moved file counts by its old path as well as its new one, and a name git would quote keeps its bytes. Only the base commit is fetched: a diff of two trees needs no history.The header: who builds what, and how a push is compared. "What it does not do" now puts mystmd and the shared cache in the second phase, after the cutovers, which takes in the note deferred from README: Jupyter Book 1 for every cutover; mystmd a second phase after them #110.
Docs: README's build paragraph and tools table, and
sites/README.md's "Building a site in CI".Checked
Tests: 501 passed and 1 skipped. They cover:
site.yml;Six of the new tests fail on the first version of the tool, and dropping the ledger's base reading fails one. actionlint and pool-check are clean.
On the real pool, with the workflow's own diff command:
git mv lectures/os_stochastic.md lectures/os_stochastic_v2.mdbuilds dp and intermediate;about_pyfigure intoos_stochastic's folder builds dp, programming and intermediate;_static/lecture_specific/…builds all six;about_py/café.pngbuilds programming;fc2ea1fbuilds dp alone.On tonight's merges (each squash commit against its parent):
sites/README.md)site-build.yml)tools/stage-site)Real runs, each from a throwaway draft against this branch, now closed:
sites/README.md. The matrix job reported no site, and the build job was skipped.The evidence comments below have the details.
This PR's own build changes the workflow, so it builds all six: the "rule itself" path.
The push path can't run before the merge. Its query, run now against this repository, returns 31f29fc (pool-check: a {ref} link that leaves its site has one target (ref-target) #101), the last build on
mainthat succeeded. The first push after the merge carries this workflow, so it builds all six. The "Sites built" summaries of the first two push builds onmainare to be read after the merge. The first should say it touches the rule, against 31f29fc. The second should be compared with the merge commit, if the first went green.The validation rule: this changes which sites build, not how. The legs that run are unchanged steps, so a full output comparison isn't needed. The planted test is the evidence.
Copilot: not requested (Matt, 2026-11-22).
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG