Batched delivery: a landing's apps are held as drafts and delivered together in one deliver.yml run (MQ-11 step 5c) #62
Loading…
Reference in a new issue
No description provided.
Delete branch "mq-11-batch-anvil"
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?
Step 5c of anvil stage 6b (https://openproject.home.romaine.life/wp/MQ-11): a landing's apps, built ahead by the prebuild, end their release runs as complete drafts and are delivered together in one pipeline-templates
deliver.ymlrun, so each PC installs the batch in one at-update pass. This is anvil's half of the contract pipeline-templates'release/batch.mjsalready holds (pipeline-templates v0.1.6).Added:
batch.go.apptopic) whose planned commit the landing pushes, or writes with the plan's message after its branch moved. Not held: an app with an external part (release-external: a callback run completes its draft and never batches), and the library's own merge (it carries no trailer, so its run never batches).refs/anvil/delivery/<commit>on Forgejo (a ref outside branches and tags: no push event, webhook or workflow), the pendingmerge-queue / deliverystatus ("delivered with 's batch") goes on it, and only then is the branch pushed. No release run of the commit can exist before its status. The staging ref is deleted once the branch has it. A post that answers an error is read back: if Forgejo kept it the commit stays held. A push that races or fails takes the commit out of the batch and settles its statussuccess.held(succeeded, its release a finalized draft),self(its run published it),none(no release),failed(failed or cancelled, or abandoned: jobs left blocked behind a failed one, the queue'smarkAbandoned). A run that never starts is ended byPOST /landings/clear, which settles the batch too.deliver.ymlon pipeline-templates'mainwith{"version":1,"landing","releases":[{"repo","tag"}]}(held ones only). A run already started for the landing (found by itsbatchinput in its event) is adopted instead, so a lost dispatch answer or a restart never starts two. Held statuses go pending linking the run, the landing's PR gets a comment; the result is the run'sdeliverjob's (itsprunejob is cleanup). No held member: nothing dispatched.DATA_DIR/batches), each write whole and one at a time; a file that can't be read is set aside (.unreadable), the rest read. Every step re-reads each run a batch waits on; steps come from member release run events, any run event in pipeline-templates while a batch goes, and each landings step. Metricsmerge_queue_batches_total{outcome},merge_queue_batch_members_total{outcome},merge_queue_batch_size;GET /batchesinside the cluster.Changed:
landing.go: the planned push and the written bump hold the delivery before their push and report how it went; each landings step pokes the batches;closedTo(no bump left to write, from the lines' snapshot);ReleaseRunOfgives the release run's number;writeWholewrites beside its place under a name of its own, so two writes never share one (landings and plans use it too).landingview.go: a hand clear tells the batch.webhook.go: a run event in a batch member's repository, or in pipeline-templates while a batch goes, steps the batches.metrics.go: histograms can be registered beside the decide one.main.go: the batches start after the prepared landings;/batchesroute.DATA_DIR.Tests (
batch_test.go), each failing with its fix reverted: three apps (draft, self-published, failed) give one dispatch naming only the draft, each pending status posted whilemainwas still the parent on a commit Forgejo already had; a failed status post is posted again; the deliver job's success delivers while its run prunes or its prune fails; a restart before the runs end and after the dispatch dispatches once, and a lost dispatch answer is adopted, not repeated; an abandoned member run fails and the batch goes out while the landing still waits, on a step brought by a pipeline-templates run event; a cleared landing settles its batch; a status Forgejo kept despite an error stays held; no hold for non-apps, an app with an external part, or the library's merge; concurrent saves leave the last state and an unreadable file is set aside. The prepared-landing fixture runs with batches, and the main-moved test checks the written bump is held.Left alone: prepare.go and the plan format, the queue's lines and merges, the module proxy, the
k8s/route (/batchesis in-cluster only).Needs before it does anything live: pipeline-templates' write integration must admit
deliver.yml(nelsong6/openbao#112), or the batch's run gets no token to publish the drafts.🤖 Generated with Claude Code