-
Notifications
You must be signed in to change notification settings - Fork 1
Pipeline Plan 59
The plan has been fully developed through my codebase analysis. Here's the complete implementation plan:
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.
| File | Purpose |
|---|---|
scripts/sw-release.sh |
Release train orchestration (~600-800 lines) |
scripts/sw-release-test.sh |
Test suite (~700-900 lines) |
| 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 |
Standard Shipwright structure (VERSION, set -euo pipefail, colors, emit_event).
Subcommands: status, plan, create, schedule, history, check-ready
Core functions:
-
release_get_last_tag()—git describe --tags --abbrev=0 --match 'v*', defaults tov0.0.0 -
release_collect_prs()—gh pr list --state merged --base main --search "merged:>=$date"→ newline-delimited JSON -
release_classify_pr()— Classify by conventional commit prefix + labels:-
feat:/featurelabel → feature (minor) -
fix:/buglabel → fix (patch) -
BREAKING CHANGEin body orfeat!:→ breaking (major) -
docs:,refactor:,ci:,chore:→ patch - Unclassified → other (patch)
-
-
release_determine_version()— Highest bump wins: breaking→major, feature→minor, else→patch. Parse current version frompackage.json. -
release_generate_changelog()— Markdown grouped by category (Breaking Changes, Features, Bug Fixes, Documentation, Other). Each entry:**PR #N**: title (@author). -
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 createwith changelog body emit_event "release.created"
-
release_check_ready()— Daemon-compatible readiness check based on config mode (pr_countthreshold,scheduleinterval,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"]
}
}Add release) case to dispatch to sw-release.sh, plus help text line.
- Load
RELEASE_TRAIN_ENABLED,RELEASE_TRAIN_MODE,RELEASE_TRAIN_AUTO_CREATEinload_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 emitsrelease.readyevent
Add fleet_notify_release() that emits fleet.release_notification events for each fleet repo.
Add workflow_dispatch trigger with bump_type input (auto/major/minor/patch). Add release-train job that runs sw-release.sh create.
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).
- Task 1: Create
sw-release.shboilerplate + subcommand router + config loading - Task 2: Implement
release_get_last_tag()andrelease_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,historysubcommands - Task 9: Add
releaseroute 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_dispatchtrigger to release workflow - Task 13: Create
sw-release-test.shtest suite - Task 14: Register test in
package.json+ run full suite
-
Unit tests (
sw-release-test.sh): Mocked binaries, isolated temp dirs, PASS/FAIL counters -
Manual validation:
shipwright release statusandplanon this repo -
CI:
npm test— all 23 existing suites + new release suite pass
-
shipwright release status/plan/createall 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_eventtelemetry