A landing's release builds made before it lands, and the release run that takes them (MQ-11) #346
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/pipeline-templates!346
Loading…
Reference in a new issue
No description provided.
Delete branch "mq-11-prebuild"
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?
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.--latestnames the latest release; without it the series' newest numbered tag stands in.suites/release/group.yml+group.mjs, the prebuild run (workflow_dispatch, inputsprandplan{"id","digest"}, one run per repo+pr, newer cancels older).plan(Linux, runs no repository code) readshttps://merge-queue.home.romaine.life/prebuild/<id>.jsonwith the job's read token, checks the digest and that the plan is this repo's at this head, recreates eachprebuildmember's commit (shallow parent fetch, hash-object/update-index, commit-tree with no user git config), refuses a SHA mismatch naming the repo, computesbuildFingerprintat the planned tag and printsCI_PREBUILT_V1 {"repo","commit","tag","fingerprint","parts","plan"}.build-linux/build-windowsrecreate their members, set up one Go/Rust/.NET, loop over members and parts through the release suite's ownbuild.mjswith the release build job's env (app'sGITHUB_REPOSITORY/GITHUB_SHA/CI_TOPICS,VERSIONthe planned tag),GOPROXY=anvil|file://<shared GOMODCACHE>|home proxy|direct,GONOPROXY=anvil.invalid, a private GOMODCACHE, and keep each part'sdist/asprebuilt-<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 wayforgejo/upload-artifact@v4does, 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 getsartifact-upload(both runners) andartifact-download(forgejo/download-artifact@v4in a later job) to prove it against the real runtime on this PR.prior-build.mjsfindAnvil: readsAnvil-Prebuilt: <libRepo>@<head>from the commit, lists that repo'srelease/group.ymlruns at the head, and takes only one merge-queue dispatched (workflow_dispatch,trigger_usermerge-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 ownrelease/group.ymlunder.forgejo/.gitea/.githubworkflows is refused outright. It then probes the download with the read token.Changed:
findAlltries the merged PR's build first, thenfindAnvil; it returnsrepobesidelocal/external, and a fingerprint that can't be computed still builds rather than failing reserve.release/ci.ymlreserve: a read-token step andREAD_TOKEN, both only whengithub.event.head_commit.messagecontainsAnvil-Prebuilt:; new outputprior-repo. finalize: a read-token step only whenprior-repois set;downloadreads from that repo with it.downloadandzipReadabletake a URL, artifact names and token instead of always the job's own.actions/release-versionexportsnumberedInandseriesOftoo.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 noAnvil-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 namesAnvil-Prebuilt:, which nothing writes yet. Without the trailer,findruns one extragit logthat comes back empty and goes no further.🤖 Generated with Claude Code
merge-queue stopped this at
3088cf3: CI failed: CI / suite-tests-linux (pull_request). Push a fix. A failure fixed on main lands once thequeuelabel 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 thequeuelabel is removed and added again: the queue merges main in and CI runs on the new head.