Repository navigation
publishing: stage every target before any is visible, and resume a failed publish from a pushed record (#4048) - #4080
Merged
Merged
Conversation
…iled publish from a pushed record (#4048) A publish target now has two steps in place of publish(ctx): stage(ctx) puts every item out where no consumer resolves it (npm under the next dist-tag, OCI by digest, forge assets on a draft release, GitLab assets in the package registry), and reveal(ctx, staged) is the one last step that makes them visible (npm moves latest in the declared order, the first package, the core, first; OCI moves the tags; the forge publishes the draft, or GitLab creates the release with its links). chant release publish --yes stages every target, then reveals them. Each step is appended to _releases/publishes.jsonl on chant/lifecycle (version 1) and pushed, so a publish run again after a failure, also from a fresh CI clone, skips what was staged or revealed. Each stage also asks its destination first and sends nothing already there. Records hold names, destinations, digests and draft ids, redacted, never a credential.
3 tasks done
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 #4048
A publish stages every target before any becomes visible, and a failed publish resumes without republishing what already went out (#3856's recommendation).
lifecycle/release-publish.ts):publish(ctx)becomesstage(ctx)andreveal(ctx, staged), with a stablekeyper target (kind plus a digest of its declaration, which never holds a credential).runPublishplans everything, stages every target in declared order, then reveals them in the same order. A failure throwsPublishRunErrorsaying which step failed and what is staged or visible.npm view <name>@<version>and runsnpm publish --tag nextonly for versions the registry lacks; reveal moveslatestwithnpm dist-tag add, the first package in the target's list (the core) first. npm makes a brand-new package's first versionlatestwhatever tag it is published under; that one case is documented._releases/publishes.jsonlonchant/lifecycle(member prefix, append-only,version: 1), pushed after each write, so a CI job on a fresh clone resumes from it. Stages still query their registries, so a missing record costs speed rather than a second publish. Lines are redacted and hold names, destinations, digests and draft ids.test/egress-catalogue.tsnow lists the publish modules'fetch(release-publish.ts,publish-oci.ts,publish-forge.ts), which publishing: a publish-target contract, with npm, OCI and forge release assets #4047 added without a row, sono-egresspasses again; the fakes are read fromlifecycle/__fixtures__/.Level-0 output changes
On the exceptions page and #2525: npm runs
view,publish --tag nextanddist-tag add; OCI tags move only at the reveal; GitHub and Forgejo go through a draft, and a release already published for the tag without the assets is refused (publish-forge-release-published); GitLab links all assets at the reveal; a publish writes and pushes_releases/publishes.jsonl; new progress lines and resume hints;publish-npm-tag-failed;--jsongainsprogressandresumed.Acceptance
publish-resume.test.ts"a stage failure leaves nothing visible; a reveal failure is resumed; neither run again publishes what went out", and the e2e "a publish that failed at the image is resumed from a fresh clone with the record it pushed, and stages no package again").latest, a moved tag or a published release until the last step runs, and that npm moves core'slatestfirst (publish-targets.test.ts: npm, OCI, GitHub draft, GitLab, Forgejo, over stateful fakes).Checks
npx tsx scripts/typecheck.ts: no regressions (26 baselined)npx tsx scripts/check-lexicons.ts: no untracked tier-1 failuresno-listener,no-egress, level-0 goldens: pass withGITHUB_SHA,GITHUB_RUN_IDandCIset, after rebasing on publishing: a publish-target contract, with npm, OCI and forge release assets #4047npx vitest run --project unitpasseslint-docs-sentences(baseline ratcheted down by 2),lint-prompts,check-docs-diataxis,./scripts/build-docs.sh: passchant/lifecyclewas unchanged.