Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pipeline Plan 59

Seth Ford edited this page Feb 14, 2026 · 2 revisions

The plan has been fully developed through my codebase analysis. Here's the complete implementation plan:


Release Train Automation — Implementation Plan

Overview

Add shipwright release command that batches merged PRs into releases with auto-generated changelogs, semantic versioning, and GitHub Release creation. Integrates with the daemon patrol loop for scheduled releases and with fleet for downstream notifications.

Files to Modify

New Files

File Purpose
scripts/sw-release.sh Release train orchestration (~600-800 lines)
scripts/sw-release-test.sh Test suite (~700-900 lines)

Modified Files

File Change
scripts/sw Add release route to CLI router + help text
scripts/sw-daemon.sh Add release train check to patrol loop + config loading
scripts/sw-fleet.sh Add fleet_notify_release() for downstream broadcasts
.github/workflows/release.yml Add workflow_dispatch trigger for release-train job
package.json Register sw-release-test.sh in test scripts

Implementation Steps

Step 1: scripts/sw-release.sh — Core Script

Standard Shipwright structure (VERSION, set -euo pipefail, colors, emit_event).

Subcommands: status, plan, create, schedule, history, check-ready

Core functions:

  1. release_get_last_tag()git describe --tags --abbrev=0 --match 'v*', defaults to v0.0.0

  2. release_collect_prs()gh pr list --state merged --base main --search "merged:>=$date" → newline-delimited JSON

  3. release_classify_pr() — Classify by conventional commit prefix + labels:

    • feat: / feature label → feature (minor)
    • fix: / bug label → fix (patch)
    • BREAKING CHANGE in body or feat!:breaking (major)
    • docs:, refactor:, ci:, chore: → patch
    • Unclassified → other (patch)
  4. release_determine_version() — Highest bump wins: breaking→major, feature→minor, else→patch. Parse current version from package.json.

  5. release_generate_changelog() — Markdown grouped by category (Breaking Changes, Features, Bug Fixes, Documentation, Other). Each entry: **PR #N**: title (@author).

  6. release_create() — Full orchestration:

    • Collect + classify PRs → determine version → generate changelog
    • Call existing scripts/update-version.sh $new_version
    • Prepend to CHANGELOG.md
    • Git commit + tag + push
    • gh release create with changelog body
    • emit_event "release.created"
  7. release_check_ready() — Daemon-compatible readiness check based on config mode (pr_count threshold, schedule interval, manual). Returns exit code 0/1.

Config (.claude/daemon-config.json):

{
 "release_train": {
 "enabled": false,
 "mode": "pr_count",
 "pr_count_threshold": 5,
 "schedule_interval": "weekly",
 "auto_create": false,
 "changelog_file": "CHANGELOG.md",
 "exclude_labels": ["skip-release", "wip"]
 }
}

Step 2: CLI Router (scripts/sw)

Add release) case to dispatch to sw-release.sh, plus help text line.

Step 3: Daemon Integration (scripts/sw-daemon.sh)

  • Load RELEASE_TRAIN_ENABLED, RELEASE_TRAIN_MODE, RELEASE_TRAIN_AUTO_CREATE in load_config()
  • Add release check block after patrol in the quiet-period section (~line 4914): calls sw-release.sh check-ready, then either auto-creates or emits release.ready event

Step 4: Fleet Notification (scripts/sw-fleet.sh)

Add fleet_notify_release() that emits fleet.release_notification events for each fleet repo.

Step 5: GitHub Actions (release.yml)

Add workflow_dispatch trigger with bump_type input (auto/major/minor/patch). Add release-train job that runs sw-release.sh create.

Step 6: Test Suite (scripts/sw-release-test.sh)

Mock git, gh, jq in temp PATH. Test: version determination (patch/minor/major), PR classification (all prefix variants + labels + breaking), changelog formatting, readiness check (all modes), full release flow (mocked), edge cases (no tags, excluded labels).

Step 7: Register test in package.json

Task Checklist

  • Task 1: Create sw-release.sh boilerplate + subcommand router + config loading
  • Task 2: Implement release_get_last_tag() and release_collect_prs()
  • Task 3: Implement release_classify_pr() — conventional commit + label classification
  • Task 4: Implement release_determine_version() — semver bump calculation
  • Task 5: Implement release_generate_changelog() — grouped markdown
  • Task 6: Implement release_create() — full orchestration
  • Task 7: Implement release_check_ready() — daemon-compatible readiness
  • Task 8: Implement status, plan, history subcommands
  • Task 9: Add release route to CLI router + help text
  • Task 10: Integrate release train into daemon patrol loop
  • Task 11: Add fleet_notify_release() to fleet script
  • Task 12: Add workflow_dispatch trigger to release workflow
  • Task 13: Create sw-release-test.sh test suite
  • Task 14: Register test in package.json + run full suite

Testing Approach

  1. Unit tests (sw-release-test.sh): Mocked binaries, isolated temp dirs, PASS/FAIL counters
  2. Manual validation: shipwright release status and plan on this repo
  3. CI: npm test — all 23 existing suites + new release suite pass

Definition of Done

  • shipwright release status/plan/create all functional
  • Semantic version auto-determined from PR content (major/minor/patch)
  • Changelog grouped by category with PR references
  • GitHub Release created with tag and notes
  • Daemon patrol triggers release check when enabled
  • Configurable schedule (pr_count, schedule, manual)
  • Fleet notification on release
  • Test suite with full coverage
  • All existing tests pass
  • Bash 3.2 compatible, set -euo pipefail, emit_event telemetry

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /