Skip to content

Commit 99f34f3

Browse files
committed
docs: enhance release command documentation with branch sync, dry-run, and best practices
1 parent a73936c commit 99f34f3

File tree

1 file changed

+42
-28
lines changed

1 file changed

+42
-28
lines changed

.opencode/command/release.md

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ agent: ci-agent
66
# Release Command
77

88
## Overview
9-
The Release Command automates the preparation and execution of software releases, including quality checks, versioning, and deployment.
9+
The Release Command automates the preparation and execution of software releases, incorporating best practices for GitHub releases, including branch synchronization, complete changelog inclusion, conventional commits for changelog generation, semantic versioning, protected branches, and automated release notes.
1010

1111
## Purpose
12-
To ensure releases are built, tested, and deployed reliably, coordinating multiple agents for a seamless process.
12+
To ensure releases are built, tested, and deployed reliably, coordinating multiple agents for a seamless process while addressing issues like develop branch not being up to date and incomplete changelogs in releases.
1313

1414
## Inputs/Outputs
15-
- **Inputs**: Optional arguments like "alpha" for pre-releases.
16-
- **Outputs**: Release confirmation, version updates, or error reports.
15+
- **Inputs**: Optional arguments like "alpha" for pre-releases, "patch" for patch releases, "dry-run" for dry runs.
16+
- **Outputs**: Release confirmation, version updates, changelog updates, or error reports.
1717

1818
## Dependencies
1919
- Cargo toolchain.
2020
- Agents: CI Agent, Storage Agent, Docs Agent, Git Handler, GitHub, Hive Mind Orchestrator.
21+
- Tools: git-cliff for changelog generation from conventional commits.
2122

2223
## Usage Examples
2324
- Standard release: `/release`
2425
- Pre-release: `/release alpha`
2526
- Patch release: `/release patch`
27+
- Dry-run: `/release dry-run`
2628

2729
## Changelog
2830
- v1.0: Basic release with checks.
2931
- v1.1: Added agent coordination.
32+
- v1.2: Incorporated best practices for branch sync, changelog, and automated releases.
33+
- v1.3: Added support for dry-run argument to run quality checks and report without proceeding to release.
3034

3135
## Error Scenarios
3236
- **Build Failures**: Stop and report errors; suggest fixes before retrying.
@@ -36,49 +40,59 @@ To ensure releases are built, tested, and deployed reliably, coordinating multip
3640
- **Version Conflicts**: If version bump fails, check existing tags.
3741
- **Agent Handoff Failures**: If an agent fails (e.g., CI pipeline), retry or escalate.
3842
- **Network/Permission Issues**: For pushing tags, ensure auth and connectivity.
43+
- **Branch Sync Issues**: If develop is not up to date, merge main to develop before proceeding.
44+
- **Changelog Incomplete**: Ensure all commits follow conventional commit format for accurate changelog generation.
3945

4046
## Integration Notes
41-
- **Handoff Protocols**: Sequential handoffs: checks -> version bump -> CI -> storage update -> docs -> git -> github (PR creation and merge). Confirm each step before proceeding.
47+
- **Handoff Protocols**: Sequential handoffs: branch sync check -> checks -> version bump -> CI -> storage update -> docs -> git -> github (PR creation and merge). Confirm each step before proceeding.
4248
- **Collaboration**: Uses CI Agent for pipelines, Storage for versions, Docs for updates, Git for commits/tags, GitHub for PR creation and merging. For complex releases, hand off to Hive Mind Orchestrator.
43-
- **Best Practices**: Always run checks first; log all actions. Confirm completion with user.
44-
- **Edge Cases**: Handle pre-releases differently; for hotfixes, skip some checks if urgent (with caution).
49+
- **Best Practices**: Always run checks first; use semantic versioning; ensure protected branches (main protected); log all actions. Confirm completion with user. Use conventional commits for automated changelog.
50+
- **Edge Cases**: Handle pre-releases differently; for hotfixes, skip some checks if urgent (with caution). Address develop branch not up to date by merging main to develop.
4551

46-
Prepare for release. Optional: $ARGUMENTS (e.g., "alpha" for pre-release)
52+
Prepare for release. Optional: $ARGUMENTS (e.g., "alpha" for pre-release, "patch" for patch release, "dry-run" for dry run)
4753

48-
First, run quality checks. Stop on any errors or warnings.
54+
First, ensure branch synchronization:
55+
- Check if develop branch is up to date with main. If not, merge main into develop to sync changes.
56+
- Switch to develop branch if not already on it.
57+
58+
Then, run quality checks. Stop on any errors or warnings.
4959

5060
Build check: !`cargo build`
51-
If build fails, stop and report errors.
61+
If build fails, report errors. If not dry-run, stop.
5262

5363
Test check: !`cargo test`
54-
If tests fail, stop and report failures.
64+
If tests fail, report failures. If not dry-run, stop.
5565

5666
Lint check: !`cargo clippy`
57-
If clippy finds issues, stop and report warnings/errors.
67+
If clippy finds issues, report warnings/errors. If not dry-run, stop.
5868

5969
Format check: !`cargo fmt --check`
60-
If formatting issues, stop and report.
70+
If formatting issues, report. If not dry-run, stop.
6171

6272
Doc tests: !`cargo test --doc`
63-
If doc tests fail, stop and report failures.
73+
If doc tests fail, report failures. If not dry-run, stop.
6474

6575
Coverage generation: !`cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info`
66-
If coverage generation fails, stop and report errors.
76+
If coverage generation fails, report errors. If not dry-run, stop.
6777

6878
Security audit: !`cargo audit`
69-
If security vulnerabilities are found, stop and report.
79+
If security vulnerabilities are found, report. If not dry-run, stop.
80+
81+
If "dry-run" is specified, report the summary of all check results and stop.
7082

71-
If all checks pass:
72-
1. Determine new version: /version-bump $ARGUMENTS
83+
Else if all checks pass:
84+
1. Determine new version using semantic versioning: /version-bump $ARGUMENTS
7385
2. @ci-agent to handle CI/CD pipeline.
7486
3. Update version in Cargo.toml using @storage-agent.
75-
4. @docs-agent to update changelog/docs.
76-
5. @git-handler for tagging and pushing.
77-
6. @github agent to create a pull request from the current branch (e.g., develop) to main.
78-
7. @github agent to merge the pull request.
79-
8. Switch to develop branch and merge main back into it to sync changes.
80-
9. If needed, @hive-mind-orchestrator for complex releases.
81-
82-
10. @github agent to monitor the GitHub Actions workflows (CI, Deploy Docs, Release) to ensure they complete successfully.
83-
84-
Confirm release completion.
87+
4. @docs-agent to update changelog/docs using git-cliff for conventional commits.
88+
5. @git-handler for committing changes and creating a release branch if needed.
89+
6. @github agent to create a pull request from develop to main.
90+
7. @github agent to merge the pull request (ensure main is protected and requires reviews).
91+
8. @git-handler to tag the release on main with semantic version (e.g., v1.2.3).
92+
9. @git-handler to push the tag, triggering GitHub Actions release workflow.
93+
10. Switch to develop branch and merge main back into it to sync changes.
94+
11. If needed, @hive-mind-orchestrator for complex releases.
95+
96+
12. @github agent to monitor the GitHub Actions workflows (CI, Deploy Docs, Release) to ensure they complete successfully. The release workflow will automatically generate changelog using git-cliff and include it in release notes.
97+
98+
Confirm release completion. Ensure changelog is complete by verifying conventional commit format in commits.

0 commit comments

Comments
 (0)