Repository navigation
lifecycle: the release, cut from a green commit and compiled per environment (#4026) - #4056
Merged
Merged
Conversation
…gests and one compile target per environment (#4026) A release is one green commit of one member, compiled (ws-104). chant release cut [<label>] refuses a HEAD without a ci/green tag (or with ci/revoked), compiles every environment of the member's promotion order in a child process with CHANT_ENV set, refuses a component whose build steps differ between environments, builds each component's artifacts once (or carries them from the release of the nearest ancestor when their source did not change), and stores _releases/<releaseDigest>.json, the template bytes and a line in _releases/cuts.jsonl on chant/lifecycle. releaseDigest is computePlanDigest("release", ...) over member, commit, artifact digests and each target's env, templates and param names and values, so two cuts of one commit give one digest. A label names one digest and a digest takes one label. chant components promote --release <label|digest> deploys the target's recorded templates, refuses one whose bytes do not hash to the target's digest, and names the release on the deploy record (releaseDigest). chant release list --json prints the new releases read-contract document at v1 within contract 1, reusing ledger-unreadable and ledger-malformed; floors recorded in the read contract. Level-0 exception recorded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4026
The release object of ws-104: cut once from a green commit, artifacts built once, one compile target per declared environment, and promote under a release deploys the recorded templates.
_releases/<releaseDigest>.jsononchant/lifecycleholds{ version, releaseDigest, member, commit, artifactDigests, targets }, sorted as ws-104 sets.releaseDigest = computePlanDigest("release", …)over member, commit, artifact digests and each target's env, templates and param name and value; a param'ssourceand everything on the cut line stay outside (lifecycle/release-store.ts).{ version, releaseDigest, label, actor, timestamp, runOrigin, signature: null }to_releases/cuts.jsonl. A label names one digest per member, a digest takes at most one label, cutting the same digest again is a no-op that returns the label, and another label for it is refused.HEADto carry a localci/green/<sha>and noci/revoked/<sha>(lifecycle/release-cut.ts). It compiles each environment of the member's promotion order (workspace: declare the promotion order of environments, used by promote, gates and the trunk lane #4030) in a child chant process withCHANT_ENVset, builds artifacts once, and refuses a component whose build steps differ between environments.chant components promote … --release <label|digest>writes the target's stored template bytes to.chant/release-templates/<digest>/, points the deploy step there, and refuses a template whose digest differs from the target's. Promote without--releaseis unchanged.chant release list --jsonprintsreleases.schema.jsonv1 within contract 1, reusingledger-unreadableandledger-malformed. ws-104's floor table is copied intoworkspace-read-contract.mdxwith 0.124.28 for the lifecycle: the release is what graduates: cut from a green commit, shared artifact digests, one compile target per environment #4026 rows. Thedigestdescription instatus.schema.jsonnow lists its three meanings (ws-104 question 3).chant release cut [<label>] [--build <command>] [--param k=v] [--params-file <file>] [--actor <name>] [--json],chant release list [--json], and an internalchant release compile. There was no top-levelreleasecommand;components releaseis unrelated and unchanged. Docs pagecli/release.mdx.Choices ws-104 left open (please review)
import().--build <command>runs before each environment's templates are read, since chant has no generic way to produce the files a deploy step names.template,manifestorvaluesfield (anarchive:prefix stripped; directories such as helm charts skipped). A named template missing after the build stops the cut._releases/templates/<digest>.txt, so a promote can deploy them from any checkout.docker-buildgivesimage,zip-packageandjvm-buildgiveasset, run once in the first environment each component is enabled in.chant.config.tsor the build-input paths; the previous release is the one cut from the nearest ancestor.{env}in--params-fileis replaced by each environment's name;--paramapplies to every environment.release-worktree-dirty), a member with no environments (release-no-environments), a project with no components (release-no-components, until releases: implicit releases for projects with no components #4046). The cut is always fromHEAD.. _ + -but no:, so--releasenever confuses a label with a digest. An unlabelled release can be labelled once by a later cut.releaseDigest. Until records: join commit, release, gate and deploy through the release digest #4043 makesrun --componentswrite that field, the first environment isn't listed.Known gaps, posted on their issues: promote under a release doesn't yet check the source record's artifact against
artifactDigests(#4045), and it leaves.chant/release-templates/in the checkout.Level-0 output changes
On the exceptions page and #2525:
--helplistsrelease cut,release listand promote's--release;--release,--buildand--artifactsare now accepted flags; a deploy record getsreleaseDigestand promote's--jsongetsreleaseonly under--release. No golden moved.Acceptance
release-cut.test.ts"the release digest",releases.test.ts).release.e2e.test.ts).releaseDigest("two cuts of one commit give the same releaseDigest", e2e).release-promote.test.ts,promote.test.ts"promote --release (lifecycle: the release is what graduates: cut from a green commit, shared artifact digests, one compile target per environment #4026)").Checks
npx tsx scripts/typecheck.ts: no regressions (26 baselined)npx tsx scripts/check-lexicons.ts: no untracked tier-1 failuresGITHUB_SHA,GITHUB_RUN_IDandCIsetop/factory.e2e.test.tsfailures and load timeouts that pass alonelint-docs-sentences: no regressions. The baseline gains the two front-mattercolon-revealfindings every CLI page carries, for the newcli/release.mdx.lint-prompts,check-docs-diataxis,./scripts/build-docs.sh: pass