-
Notifications
You must be signed in to change notification settings - Fork 9
feat: auto-release after merge + version in issue closing comments #4957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -741,10 +741,11 @@ After task completion, the loop automatically: | |||||
| 4. **PR Review**: Monitors CI checks and review status | ||||||
| 5. **Review Bot Gate (t1382)**: Wait for AI review bots before merge (see below) | ||||||
| 6. **Merge**: Squash merge (without `--delete-branch` when in worktree) | ||||||
| 7. **Issue Closing Comment**: Post a summary comment on linked issues (see below) | ||||||
| 8. **Worktree Cleanup**: Return to main repo, pull, clean merged worktrees | ||||||
| 9. **Postflight**: Verifies release health after merge | ||||||
| 10. **Deploy**: Runs `setup.sh --non-interactive` (aidevops repos only) | ||||||
| 7. **Auto-Release**: Bump patch version + create GitHub release (aidevops repo only — see below) | ||||||
| 8. **Issue Closing Comment**: Post a summary comment on linked issues, including release version (see below) | ||||||
| 9. **Worktree Cleanup**: Return to main repo, pull, clean merged worktrees | ||||||
| 10. **Postflight**: Verifies release health after merge | ||||||
| 11. **Deploy**: Runs `setup.sh --non-interactive` (aidevops repos only) | ||||||
|
|
||||||
| **Issue-state guard before any label/comment modification (t1343 — MANDATORY):** | ||||||
|
|
||||||
|
|
@@ -822,6 +823,44 @@ Before merging any PR, wait for AI code review bots to post their reviews. This | |||||
| | Augment Code | `augment-code[bot]` | 2-4 minutes | | ||||||
| | GitHub Copilot | `copilot[bot]` | 1-3 minutes | | ||||||
|
|
||||||
| **Auto-release after merge (aidevops repo only — MANDATORY):** | ||||||
|
|
||||||
| After merging a PR on the aidevops repo (`marcusquinn/aidevops`), cut a patch release so contributors and auto-update users receive the fix immediately. Without this step, fixes sit on main indefinitely until someone manually releases. | ||||||
|
|
||||||
| ```bash | ||||||
| # Only for the aidevops repo — skip for all other repos | ||||||
| REPO_SLUG=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "") | ||||||
| if [[ "$REPO_SLUG" == "marcusquinn/aidevops" ]]; then | ||||||
| # Pull the merge commit to the canonical repo directory | ||||||
| REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) | ||||||
| CANONICAL_DIR="${REPO_ROOT%%.*}" # Strip worktree suffix if present | ||||||
| git -C "$CANONICAL_DIR" pull origin main | ||||||
|
|
||||||
| # Bump patch version (updates VERSION, package.json, setup.sh, etc.) | ||||||
| "$HOME/.aidevops/agents/scripts/version-manager.sh" bump patch | ||||||
| NEW_VERSION=$(cat "$CANONICAL_DIR/VERSION") | ||||||
|
|
||||||
| # Commit, tag, push, create release | ||||||
| git -C "$CANONICAL_DIR" add -A | ||||||
| git -C "$CANONICAL_DIR" commit -m "chore(release): bump version to ${NEW_VERSION}" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The git tag for the release is created with a 'v' prefix (e.g.,
Suggested change
|
||||||
| git -C "$CANONICAL_DIR" push origin main | ||||||
| git -C "$CANONICAL_DIR" tag "v${NEW_VERSION}" | ||||||
| git -C "$CANONICAL_DIR" push origin "v${NEW_VERSION}" | ||||||
|
|
||||||
| # Create GitHub release with auto-generated notes | ||||||
| gh release create "v${NEW_VERSION}" --repo "$REPO_SLUG" \ | ||||||
| --title "v${NEW_VERSION} - AI DevOps Framework" \ | ||||||
| --generate-notes | ||||||
|
|
||||||
| # Deploy locally | ||||||
| "$CANONICAL_DIR/setup.sh" 2>/dev/null || true | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR description and the step list in this document both state that
Suggested change
|
||||||
| fi | ||||||
| ``` | ||||||
|
|
||||||
| **Why patch (not minor/major)?** Workers cannot determine release significance — that requires human judgment about breaking changes and feature scope. Patch is always safe. The maintainer can manually cut a minor/major release when appropriate. | ||||||
|
|
||||||
| **Headless mode:** Auto-release runs in headless mode too. The version bump is atomic (single commit + tag), and `--generate-notes` avoids the need to compose release notes. | ||||||
|
|
||||||
| **Issue closing comment (MANDATORY — do NOT skip):** | ||||||
|
|
||||||
| After the PR merges, post a closing comment on every linked GitHub issue. This preserves the context that would otherwise die with the worker session. The comment is the permanent record of what was done. | ||||||
|
|
@@ -859,6 +898,8 @@ gh issue comment <ISSUE_NUMBER> --repo <owner/repo> --body "$(cat <<'COMMENT' | |||||
| **Follow-up needs:** | ||||||
| - <anything that should be done next but was out of scope> | ||||||
| - None (if complete) | ||||||
|
|
||||||
| **Released in:** v<VERSION> — run `aidevops update` to get this fix. | ||||||
| COMMENT | ||||||
| )" | ||||||
| ``` | ||||||
|
|
@@ -868,6 +909,7 @@ COMMENT | |||||
| - Be specific — "fixed the bug" is useless; "fixed race condition in worktree creation by adding `sleep 2` between dispatches" is useful | ||||||
| - Include file paths with brief descriptions so future workers can find the changes | ||||||
| - If the task was dispatched by the supervisor, include the original dispatch description for traceability | ||||||
| - **Include the release version** in the "Released in" line if an auto-release was cut (aidevops repo). Read the version from `VERSION` after the release step. For non-aidevops repos, omit the "Released in" line. | ||||||
| - This is a gate: do NOT emit `FULL_LOOP_COMPLETE` until closing comments are posted | ||||||
|
|
||||||
| **Worktree cleanup after merge:** | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
version-manager.shscript is called without changing the directory to$CANONICAL_DIR. If this script operates on the current working directory, it will modify files in the worktree instead of the main repository checkout. This would lead to the version bump not being part of the release commit. To ensure the version is bumped in the correct location, you should change into the canonical directory before running the script.