Repository navigation
plx promote <name> and plx release [major|minor|patch]; the repo template's promote task is removed - #122
Merged
davidjalbers merged 20 commits intoDec 6, 2026
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… declared source Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ease Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…release are commands Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…; a refused release names gh's own reason Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ves out the task promote, which plx promote replaced Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… reaching the repo, narrow clones, subdirectories, git's own messages Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es on stdin, gh reaching the repo, the repo's top, git's own messages Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the rest Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t code Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t code, not by a broken pipe Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…th the notes of the first run Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…names no command to assemble; exec ignores a broken pipe on its input and no other error Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s answer "release not found" counts as no release Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
davidjalbers
deleted the
davidjalbers/plx-305-plx-promote-name-and-plx-release
branch
December 6, 2026 07:48
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.
plx promote <name>andplx release [major|minor|patch]are commands ofplx, the same in every repo, and thepromotetask of therepo-turbotemplate is removed.It implements § 6.8, § 7.9, § 7.10, § 8.4 and § 8.5 of the Decisions (PLX-305).
What each command does, in order
plx promote <name>(header ofpackages/lib/src/promote.ts):readDeclaredEnvironments; refuses an invalid or empty one withdeclarationRefusal, and an undeclared name (exit 2).git ls-remote) which of the source andenv/<name>it has; refuses where the source is not there, saying to promote<other>first.--dry-run; a single-branch or shallow clone, as a forge's checkout makes it, gives the answers of a full one.env/<name>is no ancestor of the source's head; in a shallow clone whose history cannot tell, says so and namesgit fetch --unshallow origin; stops, pushing nothing, where it is at the source already.git push --no-verify origin <sha>:refs/heads/env/<name>, with no force.plx release [step],minorby default (header ofpackages/lib/src/release.ts):ghis logged in (preflightForge) and can reach the repository (gh repo view), before anything is fetched or pushed.origin'smainand its tags by explicit refspec (not forced: a local tag that differs from the remote's is git's refusal, shown in git's words).origin/mainand its version fromcommitVersion, counting only the tags the remote has (a newonlyargument ofcommitVersion, unset for the image step, whose meaning is unchanged; a shallow clone is refused there); refuses whereorigin/mainhas no commit since that tag.0.1.0for a repo without tags, and refuses where its tag exists already.git push --no-verify origin <sha>:refs/tags/<version>.gh release create <version> --verify-tag --title <version> --notes-file -, the notes on standard input whatever their length: a normal release, no immutability asked for; the notes list the subjects since the previous tag, each a code span (codeSpanmoved fromdevtolibfor this), and the first release's notes say only that it is the first release. The narration lists twenty subjects and counts the rest. Whereghfails, the tag stays and the error says the tag is pushed and the release is not, and to runplx releaseagain.plx releaserun where the newest tag of the remote sits on the head oforigin/mainand GitHub has no release for it (gh release view) says that the tag has no release yet, that it exists on the remote and was not made by this run, and that the step is not used, and after the same question creates that release with the notes the first run wrote and tags nothing; its result line says "released", not "tagged", and its JSON hasfinished: true. Where the release exists it says "nothing to release".Only gh's answer "release not found" counts as no release: any other failure of
gh release viewstops the run with gh's words ("gh release view failed: ...") and creates nothing. What I relied on: gh's source returns the errorrelease not foundfor a missing release (a 404), and any failure of a gh command exits 1, so the words, not the exit code, tell them apart; the string is in the installed gh 2.106.1 binary, which I read withstrings, and no real repository was called.Readings
The first three are the maintainer's opening readings.
plx promote <name>refuses when its source isenv/<other>and that branch is not on the remote yet, saying to promote<other>first.toolingenforces fast-forward-only onenv/<name>beyondplx promoteitself; no forge ruleset is created or checked.main, starts no deploy and moves no branch: release, then promote.origin/main:PLEXUS.mdwould be consistent, and is not done). Both push a commit by hash (<sha>:refs/...), so no local branch is made;releasemakes no local tag, the tag exists on the remote only and arrives locally with the next fetch.promotefetches the two branches it compares,releasemainand the tags, into the checkout's remote-tracking refs (and their reflogs) and tags; both do so under--dry-run, which has to read the real remote.origin/HEADis left alone.--no-verify: they push no commit of the repo's own, so a pre-push hook such asmise testhas nothing to check.releaserefuses whereorigin/mainhas no commit since the last tag ("nothing to release"). The Decisions are silent; a release would list nothing and burn a version number, and a rerun after a failedghwould otherwise bump again.0.1.0whichever step is given, as § 7.9 says without a condition.majororpatchon a repo without tags do not give1.0.0or0.0.1.origin/maindoes not hold, is refused rather than reused or moved.ghfails the tag stays, and a run ofplx releaseagain finishes the release (step 7 above); no command is left for a person to assemble.-C, --dir <dir>selects the checkout, asplx changesetandplx deploydo; the commands take no other argument or option. Where the directory is a subdirectory of a repo, the commands work from the repo's top (asplx applydoes, through the sametopOf) and read its root marker; outside a repo they refuse. The remote isorigin, as forchangeset.contextOf; the commands read no variable themselves. PLX-275 therefore still applies to them:PLX_YES=false plx promote staginganswers yes (shown in the transcript), and it is fixed there, for all commands at once, not here.--jsonofreleasealso hasfinished(true where the run only created the release of a tag an earlier run pushed).--jsonofpromoteprintsenvironment, branch, source, from, to, commits, outcome(created,fast-forwarded,unchanged); ofrelease,version, previous, commit, commits, url.mise shipdoes.shipmakes annotated ones (for the maintainer).env/<name>is behind its source,promoterefuses and names the remedy instead of leaving git's "fetch first"; the commit count of a promotion is as far as the clone's history goes.execoflibno longer crashes when a process exits without reading its input (anEPIPEon its input): it fails by the exit code; any other error on the input fails the call. No test for the latter: it needs a write error of another kind on a child's pipe, which cannot be provoked without replacingspawn. Needed so that aghthat exits early reports the pushed tag; one test inio.test.ts.What
plx updatedoes to a repo that has the taskRendered by
plx-templatefrom the old and the new template: an uneditedpromotetask is removed by the merge, and one the repo edited is left in conflict (markers inmise.toml, whichplx doctorreports).No
releasetask is rendered, now or before.Known, and not fixed
gh release viewtreats a draft release is not verified.What no test covers
ghand a real forge: the tests and the proof use a stand-in that records its arguments.Whether the repo's setting makes releases immutable is the forge's.
Contextwith a prompt.actions/checkout(single-branch and shallow clones are made by hand).Release notes
promotetask of therepo-turbotemplate (it fast-forwardedmainfromdevelop).Replaced by
plx promote <name>, which fast-forwardsenv/<name>to its declared source, andplx release [major|minor|patch], which tagsorigin/main.promotetask ran the pre-push hook (it pushedmain);plx promotepushes with--no-verifyand does not, as the update's own pushes do not.For the workflows issue (auto-promotion after a green run)
plx promote <name>is the step to run after a green run on the branchpromotes_fromnames. It fetches the refs it compares itself, by explicit refspec, so it works in a single-branch checkout, but a default depth-1 checkout (actions/checkout) refuses every promotion of a branch that exists behindmain, because its history cannot show the move to be a fast-forward: a job that promotes needs the full history (fetch-depth: 0). It needsoriginpointing at the repo, pushes with whatever credentialsgit pushhas there, the job supplies its own token and passes-y.-y(no terminal in a job) and exits 0 when the branch is at its source already, 1 on a refusal, 2 on an undeclared name.env/<name>is the forge's rule for the token, which the Decisions list as a fact to trial (a push with the default token is said to start no workflow).plx releaseis not for a job: it needsghand asks a person's decision of step.Lines
+1432 −29 across 22 files; tests and their support: 950 added lines (66%).
Checks:
TURBO_FORCE=true mise run testexit 0 (7 of 7 tasks); newborn testsrepo-turbo.test.tsandupdate-released.test.tspass.The review's findings (long notes, narrow clones, local tags,
ghreach, git's messages, subdirectories, finishing a release) are fixed in later commits, each test first, but the test of aeb4e9b (a release in a clone that fetches another branch thanmain) was added after the code it holds, found by a mutation; history is not rewritten.🤖 Generated with Claude Code