anvil starts the suite runs Forgejo doesn't, and keeps a pass ledger (MQ-12 step 3b) #64
Loading…
Reference in a new issue
No description provided.
Delete branch "mq-12-start"
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 3 step 3b of https://openproject.home.romaine.life/wp/MQ-12: anvil starts the suite runs Forgejo doesn't start, and keeps a pass ledger. Inert today: every suite's ci.yml on main still has a
pull_requesttrigger, so nothing here starts a run or posts a status until a suite loses it (pipeline-templates' flip, or a repository'sCI_SUITES_REF=anvil-trial).Added
anvil.go: for each suite whosesuites/<s>/ci.yml, at the branch Forgejo loads for the repository (itsCI_SUITES_REFactions variable, read from the API, else main; read from the pipeline-templates clone), has nopull_requestkey underon:, a new head getsSuite <s> / scope (pull_request)pending "deciding", decide runs with--passes, and the run is started through patch 0015'sPOST /repos/{o}/{r}/pulls/{n}/suite-runswithsuites_sha, the head, decide's truejobsand the plan{"suites_sha","base","outputs"}. Then reused checks are posted skipped "Identical inputs; passed on " (and a reused package check's coveredcheck-buildjobs), unchanged ones skipped "inputs unchanged by this change", the run'sanvil / release build/anvil / image buildattestations (CI_BUILD_V1/CI_IMAGE_V1, run = Forgejo's run ID), and scope success "anvil, ci-suites : ran N, reused M, unchanged K". 409 drops the head; other 4xx fail the scope with Forgejo's message; 5xx leaves it pending and retries on the repository's next delivery. Each write wakes the queue in-process.CI_SUITES_REFother than main) decides from a worktree of the suites clone at the branch tip, with the pinned package's installed dependencies (its lock must match), and starts runs with that tip assuites_sha.store.go(migration 2):runs(each suite handled on a head, its run and the checks each job runs),passes(by fingerprint, recorded from successful jobs of runs anvil started),pins; passes of any suites commit but the current and previous pin are dropped at startup.merge_queue_suite_runs_total{result}andmerge_queue_passes_total{suite}; README section "Starting suite runs".CI_SUITES_REF): a native suite is untouched; a dispatch-only suite gets scope pending then success and a run with exactly the decided jobs and plan; a recorded pass is reused on the next head; 409/4xx/5xx and decide failure; restart reconcile; a trial; attestations.After review
Suite <s> / scope (pull_request)status for each is on it ("waiting for CI to start"), whatever else the head has.reopenedstarts again a suite whose run the close cancelled (or that failed or was dropped); a run that ended on its own stands.anvil.dbaside first.Changed
decide.goruns from a source (the package, or a trial tip), passes the ledger as--passesonly for heads anvil starts runs of, and checks decide'ssuitesSHAagainst that source.shadow.goshares the started-run test with anvil; the payload's job carrieshtml_url;PR.Base.SHAis read.gopkg.in/yaml.v3to read a suite'son:.Left alone: shadow mode's comparison, the queue, groups, landings, prepared landings, batches; no Forgejo, OpenBao or infra-bootstrap change.
Local:
go vet,go test -p 4 ./...andpull-request checkpass;-raceruns only in CI (no C compiler on nelsonpc).🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.