Skip to content

bin: split the release tooling into a shared release layer - #308

Open
gnidan wants to merge 5 commits into
mainfrom
release-tooling-split
Open

gnidan wants to merge 5 commits into
mainfrom
release-tooling-split

Conversation

@gnidan

@gnidan gnidan commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

bin/version.ts had grown to eight concerns in one file: the release vocabulary, workspace reading, git and Lerna plumbing, changelog parsing, the version plan and its guards, the pre-flight checks, the writes, and the report. At the same time bin/ already had a shared model, in the wrong place. Six of the eight scripts imported one from publish-tagged.ts: readWorkspaces alone had five import sites, check-changelog.ts depended on the publisher, and packlist.ts was a library nothing executed. version.ts carried its own copy of the same model.

The nouns are now modules in bin/release/, shared by every script that needs them:

  • policy.ts: the vocabulary (keywords, identifiers, dist-tags, and the release-tag convention: releaseTag, parseReleaseTag, isReleaseTag)
  • git.ts: run, status, tryRun, with no release knowledge
  • workspaces.ts: one Workspace model that keeps dependency kinds apart and derives dependencies exactly as before, plus rewriteManifest and topoSort
  • lerna.ts, changelog.ts, packlist.ts (moved whole), and schema-versions.ts (from format: stamp info, resources and program objects with their schema and specification version #305)
  • plan.ts: the moves and the judgements about them
  • apply.ts: the writes, the Publish commit, the tags and the undo advice

No module imports a script, and no script imports another script.

The phases are types. bin/version.ts now reads as surveyRelease (the only read) → decide (pure, returns a Plan that holds the exact bytes to write) → check (pure, returns the errors and findings) → report → applyRelease (the only write). Because the world enters through one reader, the pre-flight findings, the nearest-tag check and the release-tags-at-HEAD exception now have tests from hand-built surveys. They had none before, because they shelled out. applyRelease has its first test too, against a scratch repository, including a failure part-way through tagging.

bin/ is now type-checked: yarn typecheck:bin, with a CI step beside yarn typecheck. The one error it found in the existing code (a narrowing in parseArgs) is fixed in the first commit.

Behavior is unchanged. A dry run of bin/version.ts gives byte-identical output and exit codes against the pre-refactor script for prerelease, patch, minor --all, major --all and a dirty tree. Every commit passes the bin tests and the type-check on its own.

Two things are left as they were, on purpose:

  • A workspace counts as released when any @ethdebug/<name>@… tag exists, as before. publish-tagged.ts still counts only semver-valid tags when it picks a dist-tag, as before. No tag in the repository makes the two differ.
  • The root package.json has no typescript devDependency, so typecheck:bin uses the hoisted tsc. Pinning it would change hoisting, which is out of scope here.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ethdebug.github.io/format/pr-preview/pr-308/

Built to branch gh-pages at 2026-10-02 23:01 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@gnidan
gnidan force-pushed the architect-identification branch from 7163b01 to a28c85e Compare September 30, 2026 00:49
@gnidan
gnidan force-pushed the release-tooling-split branch from 5158ec7 to 93a22e8 Compare September 30, 2026 00:50
@gnidan
gnidan force-pushed the architect-identification branch from a28c85e to d47013e Compare September 30, 2026 01:20
@gnidan
gnidan force-pushed the release-tooling-split branch from 93a22e8 to ea8b853 Compare September 30, 2026 01:22
@gnidan
gnidan force-pushed the architect-identification branch from d47013e to 471fcd7 Compare September 30, 2026 17:33
@gnidan
gnidan force-pushed the release-tooling-split branch from ea8b853 to b68490d Compare September 30, 2026 17:34
@gnidan
gnidan force-pushed the architect-identification branch from 471fcd7 to 5de84fb Compare September 30, 2026 17:45
@gnidan
gnidan force-pushed the release-tooling-split branch from b68490d to 06e1404 Compare September 30, 2026 17:46
@gnidan
gnidan force-pushed the architect-identification branch from 5de84fb to a6eeb59 Compare September 30, 2026 17:55
@gnidan
gnidan force-pushed the release-tooling-split branch from 06e1404 to f11bdac Compare September 30, 2026 17:55
@gnidan
gnidan force-pushed the architect-identification branch from a6eeb59 to c61187c Compare September 30, 2026 18:06
@gnidan
gnidan force-pushed the release-tooling-split branch from f11bdac to 750261b Compare September 30, 2026 18:06
@gnidan
gnidan force-pushed the architect-identification branch from c61187c to 4d6971c Compare October 2, 2026 00:23
@gnidan
gnidan force-pushed the release-tooling-split branch from 750261b to 79b207e Compare October 2, 2026 00:24
@gnidan
gnidan force-pushed the architect-identification branch from 4d6971c to 72b97aa Compare October 2, 2026 00:42
@gnidan
gnidan force-pushed the release-tooling-split branch from 79b207e to f519b02 Compare October 2, 2026 00:42
@gnidan
gnidan force-pushed the architect-identification branch from 72b97aa to 3375908 Compare October 2, 2026 00:54
@gnidan
gnidan force-pushed the release-tooling-split branch from f519b02 to 1bfbcca Compare October 2, 2026 00:54
@gnidan
gnidan force-pushed the architect-identification branch from 3375908 to 6650d25 Compare October 2, 2026 21:44
@gnidan
gnidan force-pushed the release-tooling-split branch from 1bfbcca to 30d9aaa Compare October 2, 2026 21:45
@gnidan
gnidan force-pushed the architect-identification branch from 6650d25 to 3e41202 Compare October 2, 2026 21:52
@gnidan
gnidan force-pushed the release-tooling-split branch from 30d9aaa to f9d3ef0 Compare October 2, 2026 21:53
@gnidan
gnidan force-pushed the architect-identification branch from 3e41202 to c349f06 Compare October 2, 2026 22:50
@gnidan
gnidan force-pushed the release-tooling-split branch from f9d3ef0 to cb5435b Compare October 2, 2026 22:50
@gnidan
gnidan force-pushed the release-tooling-split branch from cb5435b to cbcaa9a Compare October 2, 2026 22:56
@gnidan
gnidan changed the base branch from architect-identification to main October 2, 2026 22:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant