Repository navigation
Description
chant ci serve should run releases on its host, as it runs pull-request jobs and build requests. A release on the chant-native git forge (--forge git), or on any forge where a team runs chant's jobs on its own host, should then get the same publish, signing, scan and checks the rendered release workflow gives.
Epic: #5452. Related: #4016 (the git forge), #4168 (the release workflow), #4169 (build requests in ci serve).
What exists, checked at chant 3bf0df0
-
chant release workflowrenders the publish job for github, forgejo and gitlab only (RELEASE_WORKFLOW_FORGESinworkspace/release-workflow.ts). It has two shapes:- a publish job that runs when a
release/**tag (or arelease.tagtag) appears; - a dispatch shape that runs the whole release when started by hand: doctor, stamp, images, cut and publish.
- a publish job that runs when a
-
On top of that:
- the security groups add
--require-provenanceandchant release verify; - signing installs cosign pinned by SHA-256 and sets
CHANT_COSIGN.
- the security groups add
-
chant ci serve(workspace/ci-serve.ts):- runs plan, record and apply for pull requests and the target branch;
- runs
ci tickfrom its own signed runs; - with
--build-command, servesci/build/*tags in a fresh worktree; - takes a git-ref lease per apply group.
Nothing in it reads
release/**tags or runschant release. -
So on
--forge gitthere is no generated way to release. A person runschant release cutandchant release publishby hand on some machine. Every step the rendered workflow adds has to be remembered by hand:- the doctor;
- the pinned cosign;
--require-provenance;- verify;
- and once they land, the scanner install (release publish: scan every artifact before the stage, with a pinned scanner, under supply-chain #5446) and the pull login (release images: digest-pinned bases, a re-pin command and pull login for any Dockerfile, under supply-chain #5457).
What it should be
- The publish.
ci serveserves releases, opt-in with--release. Each poll fetches the release tags. For each tag it has not served, it runs the same steps the rendered publish job runs, in the same order and from the same step list (release-steps), so the two cannot drift:- in a fresh detached worktree of the tag, the install, the build of what the targets upload, and the fetch of the ci tags and
chant/lifecycle; - then
chant release publish --yes, with the flags the security groups add.
- in a fresh detached worktree of the tag, the install, the build of what the targets upload, and the fetch of the ci tags and
- The tool installs. The installs the rendered workflow does are done on the host, from
TOOL_PINS, checksum-checked and cached in the state directory: cosign, and the scanner and syft from release publish: scan every artifact before the stage, with a pinned scanner, under supply-chain #5446. A host with no network for them names the missing tool and stops before the stage. - Dispatch. A dispatch request is an annotated
ci/release/<sha>tag, pushed the waychant ci run --atpushesci/build/<sha>.ci serveruns the dispatch shape for it (doctor, stamp, images, cut, publish) when the commit is green underci.green, and deletes the tag after. - One publisher. A lease on
refs/chant/lease/releasemakes two hosts serving one repository publish once. - Credentials. Registry credentials come from
--secrets, as job secrets do today. They are passed only to the publish, never to the build. - Signing.
- A host has no CI OIDC token, so keyless signing is not available.
- With
supply-chainon,ci serve --releaserefuses to start unlessrelease.signingiskmsorkey(release.signing: KMS, key and private Sigstore modes, and signing on Forgejo #5458). - Off GitHub Actions and GitLab CI,
--require-provenancerefuses every publish today, not only npm (detectProvenanceand thepublish-provenance-missingrefusal inlifecycle/release-publish.ts). release.signing: KMS, key and private Sigstore modes, and signing on Forgejo #5458 makes the signed SLSA statement meet it inkmsandkeymodes, with the host's runner key as the builder. npm then publishes with a token and no npm provenance.
- The record. Each served release appends to
_releases/publishes.jsonlas a rendered publish does. It names the host's runner key, sowho-ran-itcovers it. - State. The served release tags live in the
ci servestate file beside its jobs, and a failed publish is retried as a failed job is.
Done when
- On a bare git remote (
--forge git), pushing a release tag makesci serve --releasepublish to a local registry fake. The record names the runner key, and nothing publishes twice with two hosts serving. - A
ci/release/<sha>request on a green commit cuts and publishes. On a commit that is not green it is refused with the reason. - With
supply-chainon, the host publish runs the same steps as the rendered GitHub job. A test compares the two step lists. - A train release (
chant workspace train publish) is served the same way, and its step list is compared with the rendered train workflow's. - The
ci servereference (cli/ci.mdx) and the land-without-a-pull-request guide describe releasing from the host. The forge matrix (docs: forges, CI systems and wardens, with a feature matrix and why only forges get a warden #5461) gets its release column forci serve.
Pull requests, in order
- 1.
ci serve --releaseserves release tags: the publish steps fromrelease-steps, the host tool installs, the record and the state, for a single release and a train. - 2. Dispatch requests (
ci/release/<sha>) on green commits, and therefs/chant/lease/releaselease.
Activity
lex00 commentedon Nov 22, 2026
Design for both pull requests, settled against the code on the epic's integration branch.
PR 1:
ci serve --releaseserves release tagsHow the steps stay the same.
chant release workflownow reads its input through one function,releaseWorkflowInputAt, whichci servecalls too. The host renders the release workflow from that input with the tag trigger, parses thepublishjob out of the rendered file, and runs its steps in order. So the host does not keep a second list of steps that a test has to hold in line with the first: it runs the job the renderer writes. A test still compares the host's steps with the rendered GitHub job's, step for step.The host renders the Forgejo flavour. Its steps are the GitHub job's without what only GitHub's hosted runners have: the job token for a
forge: "github"target and the npm upgrade for trusted publishing. The test shows the difference is exactly the tool installs and that npm line.Running a step. Each
run:step goes throughbash -eo pipefailin the job's working directory, withRUNNER_TEMP,GITHUB_ENV,GITHUB_OUTPUT,GITHUB_PATH,GITHUB_REF_NAMEandGITHUB_SHAset and read back after the step. The step gets the runner's base variables and--pass-env, neverGITHUB_ACTIONSor another forge's run variables, so the publish sees a host. The checkout is a fresh detached worktree of the tag's commit, and the toolchain set-up actions are the host's own toolchains. Any other action, andrelease.workflow.builds(which needs runners of its own), fails the release with the reason.Tools. cosign, grype and syft are installed from
TOOL_PINSinto<state>/tools, each checked against its SHA-256. The host putsCHANT_COSIGN,CHANT_GRYPEandCHANT_SYFTin the job's env, which is what makes the rendered job leave out its own install steps. A host that already sets one of those variables uses its own tool.ci serve --releaseinstalls the tools before its first poll, so a host that can't download one, or runs on a platform chant has no pin for (the pins are linux/amd64 and linux/arm64), stops there and names the tool.Credentials.
${{ secrets.NAME }}in the job reads the--secretsfile, in the step or job that names it, as a forge reads repository secrets. The step that runsrelease publishorworkspace train publishalso gets the file's secrets for a newjobs.releaseallowlist entry (every secret when the file has no such entry). No other step gets them.Signing and the builder.
ci serve --releaserefuses to start when any release signs keylessly, and, undersupply-chain, when a release that publishes does not sign withkmsorkey. It also needs a trusted runner key. Every step getsCHANT_RELEASE_RUNNER_KEY_FINGERPRINT, soreleaseBuildKindsees a host and the SLSA statement namesci-serve/<fingerprint>as the builder. The run idci servegives the job reaches the publish throughCHANT_CI_RUN_ID. Each line in_releases/publishes.jsonlgets a new optionalrunnerKeyfield with the fingerprint.State. The state file keeps each tag under
release:<tag>, with its status, attempts, failure and the path of its log. On the first pass with--releasethe release tags already there are noted asbaselineand not run, the same way the target branch's first head is a baseline. A failed release runs again with--rerun-failed, and the publish resumes from its record.Which tags:
release/**for the legacy template, the tags arelease.tagtemplate makes (not its floating tag), andrelease-train/<env>/<id>at a train's root. The release config is read at the tag's commit. A config that can't be read there before its install, because it imports a package, is read from the serve's clone instead, with a warning.PR 2: dispatch requests and the release lease
A dispatch request is an annotated tag
ci/release/<sha>whose message carries a small JSON record: the commit, the label (defaultauto), the levels for a train (defaultauto), and when it was asked.chant ci run --at <sha> --release [--label <label>] [--levels <levels>]pushes it, the same wayci run --atpushesci/build/<sha>.For each request,
ci serve --releaserenders the dispatch shape of the release workflow withgate: "head". It runs that file'sgateandcutjobs on the host, withinputs.label(orinputs.levels) from the request andGITHUB_SHAset to the requested commit. The gate refuses a commit that is not green, and the refusal's own line becomes the request's recorded reason. The cut runs the doctor, the stamp, the images and the cut, and pushes the release tag (or the train tag). The publish is then the tag path from PR 1 on the next poll. So a dispatched release on a host runs the same doctor, cut and publish steps the workflow does, with the publish rebuilding from the tag as a tag-triggered publish job does. The request tag is deleted on the remote once it has been served or refused, and the state file keeps it underdispatch:<sha>.The lease. Serving a release tag and serving a request each take the git-ref lease
release, which isrefs/chant/lease/releaseat the workspace root. They take it withrequirePush, renew it while the job runs, and release it after. A host that finds the lease held waits for a later poll. Once a host holds the lease it checks two things on the remote. For a tag, it looks for the markerrefs/chant/released/<tag>, which a host pushes after a successful publish. For a request, it checks the request tag still exists. If the marker is there or the request is gone, it records the item as served elsewhere and runs nothing. So two hosts serving one repository publish each release once.What the code says that the issue did not
FROM". release images: digest-pinned bases, a re-pin command and pull login for any Dockerfile, under supply-chain #5457 made that a report inworkspace checkand a warning inrelease doctor. Nothing in the cut or the publish refused, on a forge or anywhere else. The refusal now lives where every path builds release images,chant release cutandchant release images: undersupply-chainthey read the Dockerfile entries with the sameunpinnedFromsand stop withrelease-image-base-unpinnedbefore anything is built. That covers the rendered workflows on all three forges, the train and the host. The doctor's check stays a warning.--require-provenanceoff GitHub Actions and GitLab CI is already met by the key- or KMS-signed SLSA statement after release.signing: KMS, key and private Sigstore modes, and signing on Forgejo #5458, so the host needs no change inrelease-publish.tsbeyond the record field.--releasealready takes a value elsewhere (components promote --release <label>). Underci, a bare--releaseis the flag.