Skip to content

refactor(scripts): split release-pipeline along its sections - #519

Merged
Vivswan merged 1 commit into
mainfrom
refactor/split-release-pipeline
Oct 6, 2026
Merged

Vivswan merged 1 commit into
mainfrom
refactor/split-release-pipeline

Conversation

@Vivswan

@Vivswan Vivswan commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

What this changes

.github/scripts/release-pipeline.ts        1563 lines, every section in one file
->
.github/scripts/release-pipeline.ts         205  the header, the step constants, main()
.github/scripts/release-pipeline/git.ts     136  the git helpers every section shares, ancestry, position, manifest
.github/scripts/release-pipeline/tags.ts    522  packaged commits and the refs that name them (build tags, vX.Y.Z, latest, vX)
.github/scripts/release-pipeline/anchor.ts  223  release-please's boundary: the anchor, the boundary check, the anchor check
.github/scripts/release-pipeline/npm.ts     514  the pre-release version, the verdicts, the publish, the floor
.github/scripts/release-pipeline/draft.ts    46  the draft release's source and assets

test/scripts/release-pipeline.test.ts      2224 lines
->
test/scripts/release-pipeline.test.ts      1257  tags, anchor, draft, config
test/scripts/release-pipeline-npm.test.ts   997  the npm half

How

  • Pure moves: every function keeps its text; only imports, exports, and file headers are new.
  • One entry file stays at the invoked path, holding main() and the pause knob it reads.
  • A directory, not lib siblings: lib/ holds helpers several scripts share; these sections belong to one script.
  • Every importer follows: the build test, the three workflow tests, and the comments that named the old file.

Proof

  • Census: test( and test.each( call sites 71 before and after (47 + 24). Exports 37 before and after, plus 12 helpers exported for cross-module use (listed below). Lines 1563 to 1646 (script) and 2224 to 2254 (tests), the difference being headers and imports.
  • Tests: the six touched test files 228 green, typecheck, biome, knip, and arch lint green.
Technical details
  • Newly exported from release-pipeline/git.ts: assertFullHistory, BOT_IDENTITY, FULL_SHA, git, gitOrNo, gitWithEnv, isAncestor, manifestVersionAt, push, resolveCommit, tryGit; from draft.ts: RELEASE_ASSETS (read by main).
  • mainPosition moved to git.ts rather than npm.ts: tags.ts names build tags by it, so it is shared, not npm's.
  • Moved text keeps its long lines (25 over 150 columns across the modules and the npm test); no moved line was edited.
  • Library: none applies to a move.
  • Outside this PR: CONTRIBUTING.md line 60 still names .github/scripts/release-pipeline.ts as where the topology lives. The entry file still exists, so the sentence stays true.
  • Files: .github/scripts/release-pipeline.ts, .github/scripts/release-pipeline/{git,tags,anchor,npm,draft}.ts, .github/workflows/{update-release,update-release-pr}.yml (comments), test/scripts/release-pipeline{,-npm,-build}.test.ts, test/workflows/{checks-workflow,post-green-workflow,npm-publish-workflows}.test.ts.

@Vivswan Vivswan added the merge-when-green Owner approved: merge once every gate is green label Oct 6, 2026
@Vivswan
Vivswan force-pushed the ci/release-resolve-verify branch from b185ed7 to cc008ba Compare October 6, 2026 21:02
@Vivswan
Vivswan force-pushed the refactor/split-release-pipeline branch from be33954 to 44e5db9 Compare October 6, 2026 21:12
@Vivswan
Vivswan requested a balanced review from Copilot October 6, 2026 21:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The refactor preserves the command interface, updates all importers, and retains the complete 71-test census.

Review effort: Balanced
Findings: None

What changed in this PR

Splits the release pipeline into focused modules while preserving the workflow entry point and behavior introduced by #517.

Changes:

  • Extracts git, tag, anchor, npm, and draft-release logic into dedicated modules.
  • Moves npm tests into a separate suite and updates imports.
  • Updates workflow comments and verification tests for the new paths.
File Description
.github/​scripts/​release-pipeline.ts Retains subcommand dispatch.
.github/​scripts/​release-pipeline/​git.ts Houses shared git helpers.
.github/​scripts/​release-pipeline/​tags.ts Houses packaging and tag logic.
.github/​scripts/​release-pipeline/​anchor.ts Houses release boundary logic.
.github/​scripts/​release-pipeline/​npm.ts Houses npm publishing logic.
.github/​scripts/​release-pipeline/​draft.ts Houses draft release reads.
.github/​workflows/​update-release.yml Updates topology documentation path.
.github/​workflows/​update-release-pr.yml Updates implementation references.
test/​scripts/​release-pipeline.test.ts Retains non-npm pipeline tests.
test/​scripts/​release-pipeline-npm.test.ts Contains extracted npm tests.
test/​scripts/​release-pipeline-build.test.ts Imports tag operations from their module.
test/​workflows/​checks-workflow.test.ts Imports the anchor branch constant.
test/​workflows/​post-green-workflow.test.ts Imports draft step outputs.
test/​workflows/​npm-publish-workflows.test.ts Reads the relocated npm floor.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Vivswan
Vivswan force-pushed the ci/release-resolve-verify branch from cc008ba to 58b4269 Compare October 6, 2026 21:22
@Vivswan
Vivswan force-pushed the refactor/split-release-pipeline branch from 44e5db9 to 9a61ceb Compare October 6, 2026 21:22
Base automatically changed from ci/release-resolve-verify to main October 6, 2026 21:28
release-pipeline.ts held every section of the release pipeline in one 1562-line file. Its sections move to sibling modules under .github/scripts/release-pipeline/: git.ts (the git helpers every section shares, with ancestry, a commit's position on main, and the manifest read), tags.ts (packaged commits and the refs that name them), anchor.ts (release-please's boundary), npm.ts (the pre-release version, the verdicts, the publish, the floor), and draft.ts (the draft release's source and assets). The entry file keeps its path, the one the workflows and the test fixture invoke, and holds main() alone.

The test file splits the same way: its npm half becomes test/scripts/release-pipeline-npm.test.ts. Every function keeps its text; only imports, exports, and file headers are new, and every importer and comment that named the old file follows the move.
@Vivswan
Vivswan force-pushed the refactor/split-release-pipeline branch from 9a61ceb to 8b2175c Compare October 6, 2026 21:29
@Vivswan
Vivswan marked this pull request as ready for review October 6, 2026 21:35
Copilot AI balanced review requested due to automatic review settings October 6, 2026 21:35
@Vivswan
Vivswan merged commit 858c7cd into main Oct 6, 2026
28 checks passed
@Vivswan
Vivswan deleted the refactor/split-release-pipeline branch October 6, 2026 21:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The refactor preserves behavior, updates all identified importers, and retains comprehensive test coverage.

Review effort: Balanced
Findings: None

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

Labels

merge-when-green Owner approved: merge once every gate is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants