A landing's release builds made before it lands, and the release run that takes them (MQ-11) #346

Merged
merge-queue merged 7 commits from mq-11-prebuild into main 2026-12-01 03:23:22 -08:00
Owner

Stage 6b of the anvil build, cutover step 2 (pipeline-templates pieces, inert): release builds made before a landing lands, and the release run that takes them. Design: https://openproject.home.romaine.life/wp/MQ-11 (decisions in https://openproject.home.romaine.life/wp/RLMQ-6). The batch delivery half is its own held PR (mq-11-batch).

Removed: nothing.

Added:

  • suites/release/predict.mjs (ships in @romaine-life/ci-suites): for a checkout at a commit and the repository's tags, whether a merge there releases (releaseScope's comparison against the latest release), the tag it takes (nextTag), module/app/image, and the release plan's parts and external parts. No network, no token. --latest names the latest release; without it the series' newest numbered tag stands in.
  • suites/release/group.yml + group.mjs, the prebuild run (workflow_dispatch, inputs pr and plan {"id","digest"}, one run per repo+pr, newer cancels older). plan (Linux, runs no repository code) reads https://merge-queue.home.romaine.life/prebuild/<id>.json with the job's read token, checks the digest and that the plan is this repo's at this head, recreates each prebuild member's commit (shallow parent fetch, hash-object/update-index, commit-tree with no user git config), refuses a SHA mismatch naming the repo, computes buildFingerprint at the planned tag and prints CI_PREBUILT_V1 {"repo","commit","tag","fingerprint","parts","plan"}. build-linux / build-windows recreate their members, set up one Go/Rust/.NET, loop over members and parts through the release suite's own build.mjs with the release build job's env (app's GITHUB_REPOSITORY/GITHUB_SHA/CI_TOPICS, VERSION the planned tag), GOPROXY=anvil|file://<shared GOMODCACHE>|home proxy|direct, GONOPROXY=anvil.invalid, a private GOMODCACHE, and keep each part's dist/ as prebuilt-<owner>.<name>-<part> (3 days) as soon as it is built. Each build runs without the runner's artifact and cache credentials (ACTIONS_RUNTIME_TOKEN, ACTIONS_RESULTS_URL, ACTIONS_RUNTIME_URL, ACTIONS_CACHE_URL); the loop keeps the files after the build, so no app's build-time code can reach another's artifacts. A member whose release is a module, has external parts, joins an image, needs another toolchain, or another Go/Rust than the run's (the most common one) builds after landing, with the reason logged.
  • suites/artifacts.mjs: uploads an artifact from a script over the runner's artifact protocol (CreateArtifact, blocks, block list, FinalizeArtifact), the way forgejo/upload-artifact@v4 does, so one job can keep any number of artifacts. Each upload's block ids start with a random prefix of its own (one length per upload), so build-linux and build-windows never share a block in the run's temp folder; transient failures (no answer, 429, 5xx) are retried with backoff. The live CI check uploads two equal-size multi-block artifacts at once, with every block of both up before either finalizes, so shared ids would corrupt one and fail its read-back. A unit test against a model of Forgejo's block store shows bare-number ids fail it. pipeline-templates' own CI gets artifact-upload (both runners) and artifact-download (forgejo/download-artifact@v4 in a later job) to prove it against the real runtime on this PR.
  • prior-build.mjs findAnvil: reads Anvil-Prebuilt: <libRepo>@<head> from the commit, lists that repo's release/group.yml runs at the head, and takes only one merge-queue dispatched (workflow_dispatch, trigger_user merge-queue). Its plan job and the build jobs covering this release's parts must have succeeded, its artifacts must be kept ≥1h, and a plan-job log line must match this repo, tag, fingerprint and exact parts. The plan that line names is read from anvil with the read token and must name the trailer's library and head, with this app prebuilt at this tag. A library head holding its own release/group.yml under .forgejo/.gitea/.github workflows is refused outright. It then probes the download with the read token.
  • Tests: predict on fixture repos and tags, byte-identical commit recreation against a fixture clone (and refusals), plan validation, member fingerprint equal to the release run's, runner assignment, build env, uploader protocol, findAnvil acceptance and refusals, findAll order, cross-repo download.

Changed:

  • findAll tries the merged PR's build first, then findAnvil; it returns repo beside local/external, and a fingerprint that can't be computed still builds rather than failing reserve.
  • release/ci.yml reserve: a read-token step and READ_TOKEN, both only when github.event.head_commit.message contains Anvil-Prebuilt:; new output prior-repo. finalize: a read-token step only when prior-repo is set; download reads from that repo with it.
  • download and zipReadable take a URL, artifact names and token instead of always the job's own.
  • actions/release-version exports numberedIn and seriesOf too.
  • suites/README.md: "What a merge would release", "A landing's release builds, made before it lands", rule 1.

Left alone: the PR-build path (findPrior), external parts, joined images, every check job, and every release run with no Anvil-Prebuilt: trailer.

What makes it inert today: nothing dispatches release/group.yml (anvil doesn't yet). The release suite reaches the new code only for a pushed commit whose message names Anvil-Prebuilt:, which nothing writes yet. Without the trailer, find runs one extra git log that comes back empty and goes no further.

🤖 Generated with Claude Code

Stage 6b of the anvil build, cutover step 2 (pipeline-templates pieces, inert): release builds made before a landing lands, and the release run that takes them. Design: https://openproject.home.romaine.life/wp/MQ-11 (decisions in https://openproject.home.romaine.life/wp/RLMQ-6). The batch delivery half is its own held PR (mq-11-batch). **Removed:** nothing. **Added:** - `suites/release/predict.mjs` (ships in @romaine-life/ci-suites): for a checkout at a commit and the repository's tags, whether a merge there releases (releaseScope's comparison against the latest release), the tag it takes (`nextTag`), module/app/image, and the release plan's parts and external parts. No network, no token. `--latest` names the latest release; without it the series' newest numbered tag stands in. - `suites/release/group.yml` + `group.mjs`, the prebuild run (`workflow_dispatch`, inputs `pr` and `plan` `{"id","digest"}`, one run per repo+pr, newer cancels older). `plan` (Linux, runs no repository code) reads `https://merge-queue.home.romaine.life/prebuild/<id>.json` with the job's read token, checks the digest and that the plan is this repo's at this head, recreates each `prebuild` member's commit (shallow parent fetch, hash-object/update-index, commit-tree with no user git config), refuses a SHA mismatch naming the repo, computes `buildFingerprint` at the planned tag and prints `CI_PREBUILT_V1 {"repo","commit","tag","fingerprint","parts","plan"}`. `build-linux` / `build-windows` recreate their members, set up one Go/Rust/.NET, loop over members and parts through the release suite's own `build.mjs` with the release build job's env (app's `GITHUB_REPOSITORY`/`GITHUB_SHA`/`CI_TOPICS`, `VERSION` the planned tag), `GOPROXY=anvil|file://<shared GOMODCACHE>|home proxy|direct`, `GONOPROXY=anvil.invalid`, a private GOMODCACHE, and keep each part's `dist/` as `prebuilt-<owner>.<name>-<part>` (3 days) as soon as it is built. Each build runs without the runner's artifact and cache credentials (`ACTIONS_RUNTIME_TOKEN`, `ACTIONS_RESULTS_URL`, `ACTIONS_RUNTIME_URL`, `ACTIONS_CACHE_URL`); the loop keeps the files after the build, so no app's build-time code can reach another's artifacts. A member whose release is a module, has external parts, joins an image, needs another toolchain, or another Go/Rust than the run's (the most common one) builds after landing, with the reason logged. - `suites/artifacts.mjs`: uploads an artifact from a script over the runner's artifact protocol (CreateArtifact, blocks, block list, FinalizeArtifact), the way `forgejo/upload-artifact@v4` does, so one job can keep any number of artifacts. Each upload's block ids start with a random prefix of its own (one length per upload), so build-linux and build-windows never share a block in the run's temp folder; transient failures (no answer, 429, 5xx) are retried with backoff. The live CI check uploads two equal-size multi-block artifacts at once, with every block of both up before either finalizes, so shared ids would corrupt one and fail its read-back. A unit test against a model of Forgejo's block store shows bare-number ids fail it. pipeline-templates' own CI gets `artifact-upload` (both runners) and `artifact-download` (`forgejo/download-artifact@v4` in a later job) to prove it against the real runtime on this PR. - `prior-build.mjs` `findAnvil`: reads `Anvil-Prebuilt: <libRepo>@<head>` from the commit, lists that repo's `release/group.yml` runs at the head, and takes only one merge-queue dispatched (`workflow_dispatch`, `trigger_user` merge-queue). Its plan job and the build jobs covering this release's parts must have succeeded, its artifacts must be kept ≥1h, and a plan-job log line must match this repo, tag, fingerprint and exact parts. The plan that line names is read from anvil with the read token and must name the trailer's library and head, with this app prebuilt at this tag. A library head holding its own `release/group.yml` under `.forgejo`/`.gitea`/`.github` workflows is refused outright. It then probes the download with the read token. - Tests: predict on fixture repos and tags, byte-identical commit recreation against a fixture clone (and refusals), plan validation, member fingerprint equal to the release run's, runner assignment, build env, uploader protocol, findAnvil acceptance and refusals, findAll order, cross-repo download. **Changed:** - `findAll` tries the merged PR's build first, then `findAnvil`; it returns `repo` beside `local`/`external`, and a fingerprint that can't be computed still builds rather than failing reserve. - `release/ci.yml` reserve: a read-token step and `READ_TOKEN`, both only when `github.event.head_commit.message` contains `Anvil-Prebuilt:`; new output `prior-repo`. finalize: a read-token step only when `prior-repo` is set; `download` reads from that repo with it. - `download` and `zipReadable` take a URL, artifact names and token instead of always the job's own. - `actions/release-version` exports `numberedIn` and `seriesOf` too. - `suites/README.md`: "What a merge would release", "A landing's release builds, made before it lands", rule 1. **Left alone:** the PR-build path (`findPrior`), external parts, joined images, every check job, and every release run with no `Anvil-Prebuilt:` trailer. **What makes it inert today:** nothing dispatches `release/group.yml` (anvil doesn't yet). The release suite reaches the new code only for a pushed commit whose message names `Anvil-Prebuilt:`, which nothing writes yet. Without the trailer, `find` runs one extra `git log` that comes back empty and goes no further. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
release/predict.mjs answers what a merge at a commit would release; release/group.yml builds a
landing's planned bumps ahead through anvil's module proxy and keeps each app's files from a
script (suites/artifacts.mjs); prior-build.mjs findAnvil publishes them for a bump that names its
prebuild run. Inert until anvil dispatches the run and writes the Anvil-Prebuilt trailer.
A fingerprint that can't be computed builds, as before, rather than failing reserve
Some checks failed
Suite release / deploy-image (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
CI / prune-releases (pull_request) Successful in 6s
CI / check-fetches (pull_request) Successful in 7s
CI / azure-cli (pull_request) Successful in 7s
CI / actionlint (pull_request) Successful in 11s
CI / cache-save (ubuntu-latest) (pull_request) Successful in 12s
CI / artifact-upload (windows-latest) (pull_request) Successful in 27s
CI / suite-tests-linux (pull_request) Failing after 2m4s
CI / check-image-digests (pull_request) Successful in 9s
CI / cached-images (pull_request) Successful in 9s
CI / home-cache-linux (pull_request) Successful in 19s
Suite default / check-logs (pull_request) Successful in 31s
CI / service-cancellation (pull_request) Successful in 1m12s
CI / artifact-download (pull_request) Successful in 39s
CI / release-version (pull_request) Successful in 9s
CI / check-versions (pull_request) Successful in 8s
CI / home-cache-windows (pull_request) Successful in 18s
CI / artifact-upload (ubuntu-latest) (pull_request) Successful in 14s
CI / service-runtime (two) (pull_request) Successful in 51s
Suite default / reused-checks (pull_request) Successful in 32s
CI / manifest-check-linux (pull_request) Successful in 14s
CI / container-health (pull_request) Successful in 28s
CI / cache-save (windows-latest) (pull_request) Successful in 32s
Suite default / check-fetches (pull_request) Successful in 30s
Suite default / check-rules (pull_request) Successful in 33s
CI / service-runtime (one) (pull_request) Successful in 51s
CI / suite-tests-windows (pull_request) Successful in 2m22s
CI / setup-linux (cluster) (pull_request) Successful in 2m44s
CI / setup-windows (pull_request) Successful in 3m26s
f879d89586
Review fixes: findAnvil takes only merge-queue's dispatch of anvil's plan, uploads keep their own blocks, builds don't see the runner's services (MQ-11)
Some checks failed
Suite release / deliver-prune (pull_request) Has been skipped
CI / prune-releases (pull_request) Successful in 9s
CI / check-image-digests (pull_request) Successful in 10s
CI / check-fetches (pull_request) Successful in 11s
CI / cache-save (windows-latest) (pull_request) Successful in 27s
CI / manifest-check-linux (pull_request) Successful in 16s
Suite default / check-rules (pull_request) Successful in 20s
Suite default / check-fetches (pull_request) Has been skipped
CI / azure-cli (pull_request) Successful in 12s
CI / actionlint (pull_request) Successful in 15s
CI / home-cache-windows (pull_request) Successful in 18s
CI / home-cache-linux (pull_request) Successful in 24s
Suite default / check-logs (pull_request) Successful in 22s
CI / service-runtime (one) (pull_request) Successful in 44s
CI / cache-save (ubuntu-latest) (pull_request) Successful in 15s
CI / release-version (pull_request) Successful in 9s
CI / check-versions (pull_request) Successful in 9s
CI / cached-images (pull_request) Successful in 10s
CI / artifact-upload (ubuntu-latest) (pull_request) Successful in 25s
CI / artifact-upload (windows-latest) (pull_request) Successful in 33s
CI / container-health (pull_request) Successful in 34s
CI / service-runtime (two) (pull_request) Successful in 42s
CI / artifact-download (pull_request) Successful in 24s
CI / service-cancellation (pull_request) Successful in 51s
Suite default / reused-checks (pull_request) Successful in 17s
CI / suite-tests-linux (pull_request) Failing after 1m13s
CI / suite-tests-windows (pull_request) Successful in 1m47s
CI / setup-linux (cluster) (pull_request) Successful in 1m55s
CI / setup-windows (pull_request) Successful in 2m31s
merge-queue CI failed: CI / suite-tests-linux (pull_request)
3088cf35c9
findAnvil refuses a run merge-queue didn't dispatch, a library head holding its own
release/group.yml, and an attestation whose plan (read from anvil) isn't the trailer's library
and head with this app prebuilt at this tag. Block ids carry a per-upload random prefix and
transient failures are retried; the live check uploads two equal-size artifacts at once. Each
member's build runs without the runner's artifact and cache credentials.
First-time contributor

merge-queue stopped this at 3088cf3: CI failed: CI / suite-tests-linux (pull_request). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at 3088cf3: CI failed: CI / suite-tests-linux (pull_request). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
The prebuild's git calls await their input and their exit: no write to a closed pipe (MQ-11)
Some checks failed
Tofu providers / lock (pull_request) Has been cancelled
Suite upkeep / upkeep (pull_request) Has been cancelled
CI / artifact-upload (windows-latest) (pull_request) Has been cancelled
CI / artifact-download (pull_request) Has been cancelled
CI / cache-save (ubuntu-latest) (pull_request) Has been cancelled
CI / cache-save (windows-latest) (pull_request) Has been cancelled
CI / setup-linux (cluster) (pull_request) Has been cancelled
CI / setup-windows (pull_request) Has been cancelled
CI / service-runtime (one) (pull_request) Has been cancelled
CI / service-runtime (two) (pull_request) Has been cancelled
CI / service-cancellation (pull_request) Has been cancelled
CI / manifest-check-linux (pull_request) Has been cancelled
CI / suite-tests-linux (pull_request) Has been cancelled
CI / suite-tests-windows (pull_request) Has been cancelled
Suite default / scope (pull_request) Has been cancelled
Suite default / check-fetches (pull_request) Has been cancelled
Suite default / check-rules (pull_request) Has been cancelled
Suite default / check-logs (pull_request) Has been cancelled
Suite default / reused-checks (pull_request) Has been cancelled
Suite release / scope (pull_request) Has been cancelled
Suite release / module (pull_request) Has been cancelled
Suite release / reserve (pull_request) Has been cancelled
Suite release / finalize (pull_request) Has been cancelled
Suite release / deliver (pull_request) Has been cancelled
Suite release / deliver-prune (pull_request) Has been cancelled
Suite release / publish (pull_request) Has been cancelled
Suite release / check-package (pull_request) Has been cancelled
Suite release / check-manifest (pull_request) Has been cancelled
Suite release / deploy-image (pull_request) Has been cancelled
Suite release / reused-checks (pull_request) Has been cancelled
f50f7cf7f3
Every git call opened a stdin pipe and wrote to it, even calls that read none (init, fetch,
read-tree, write-tree, checkout). One that exited first left the write to fail with EPIPE after
the call had returned, which failed suite-tests-linux. spawnWith closes stdin when there is no
input, and with input awaits both the write and the exit, failing with the process's own stderr.
Merge branch 'main' into mq-11-prebuild
All checks were successful
Suite default / check-fetches (pull_request) Successful in 21s
Suite default / check-rules (pull_request) Successful in 24s
Suite default / check-logs (pull_request) Successful in 4s
CI / changes (pull_request) Successful in 3s
Suite default / reused-checks (pull_request) Successful in 5s
CI / cache-save (ubuntu-latest) (pull_request) Successful in 11s
CI / cache-save (windows-latest) (pull_request) Successful in 30s
CI / service-runtime (one) (pull_request) Successful in 28s
CI / artifact-download (pull_request) Successful in 13s
CI / setup-linux (cluster) (pull_request) Successful in 1m25s
CI / check-fetches (pull_request) Successful in 6s
CI / release-version (pull_request) Successful in 5s
CI / azure-cli (pull_request) Successful in 6s
CI / prune-releases (pull_request) Successful in 7s
CI / check-image-digests (pull_request) Successful in 7s
CI / cached-images (pull_request) Successful in 7s
CI / check-versions (pull_request) Successful in 8s
CI / actionlint (pull_request) Successful in 10s
CI / artifact-upload (ubuntu-latest) (pull_request) Successful in 14s
CI / home-cache-linux (pull_request) Successful in 15s
CI / home-cache-windows (pull_request) Successful in 16s
CI / manifest-check-linux (pull_request) Successful in 11s
CI / container-health (pull_request) Successful in 20s
CI / service-runtime (two) (pull_request) Successful in 28s
CI / suite-tests-linux (pull_request) Successful in 45s
CI / setup-windows (pull_request) Successful in 2m8s
merge-queue landed on main
CI / artifact-upload (windows-latest) (pull_request) Successful in 33s
CI / service-cancellation (pull_request) Successful in 35s
CI / suite-tests-windows (pull_request) Successful in 1m28s
d7150ffb46
First-time contributor

merge-queue stopped this at d7150ff: CI failed: Suite default / check-logs (pull_request). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at d7150ff: CI failed: Suite default / check-logs (pull_request). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
merge-queue deleted branch mq-11-prebuild 2026-12-01 03:23:22 -08:00
Sign in to join this conversation.
No description provided.