Skip to content

Commit c311647

Browse files
authored
feat: auto-release after merge + version in issue closing comments (#4957)
Two gaps in the full-loop workflow: 1. After merging a PR on the aidevops repo, no release was cut — fixes sat on main until someone manually released. Contributors running aidevops update got nothing. Now the full-loop auto-bumps a patch version, tags, and creates a GitHub release after every merge. 2. Issue closing comments didn't tell the reporter which version contained the fix. Now the template includes a 'Released in: vX.Y.Z' line with 'run aidevops update to get this fix' so reporters know exactly when and how to pick up the solution. Auto-release is aidevops-repo-only and always uses patch (workers can't determine if a change is minor/major — that requires human judgment).
1 parent 8afdae8 commit c311647

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

.agents/scripts/commands/full-loop.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,11 @@ After task completion, the loop automatically:
741741
4. **PR Review**: Monitors CI checks and review status
742742
5. **Review Bot Gate (t1382)**: Wait for AI review bots before merge (see below)
743743
6. **Merge**: Squash merge (without `--delete-branch` when in worktree)
744-
7. **Issue Closing Comment**: Post a summary comment on linked issues (see below)
745-
8. **Worktree Cleanup**: Return to main repo, pull, clean merged worktrees
746-
9. **Postflight**: Verifies release health after merge
747-
10. **Deploy**: Runs `setup.sh --non-interactive` (aidevops repos only)
744+
7. **Auto-Release**: Bump patch version + create GitHub release (aidevops repo only — see below)
745+
8. **Issue Closing Comment**: Post a summary comment on linked issues, including release version (see below)
746+
9. **Worktree Cleanup**: Return to main repo, pull, clean merged worktrees
747+
10. **Postflight**: Verifies release health after merge
748+
11. **Deploy**: Runs `setup.sh --non-interactive` (aidevops repos only)
748749

749750
**Issue-state guard before any label/comment modification (t1343 — MANDATORY):**
750751

@@ -822,6 +823,44 @@ Before merging any PR, wait for AI code review bots to post their reviews. This
822823
| Augment Code | `augment-code[bot]` | 2-4 minutes |
823824
| GitHub Copilot | `copilot[bot]` | 1-3 minutes |
824825

826+
**Auto-release after merge (aidevops repo only — MANDATORY):**
827+
828+
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.
829+
830+
```bash
831+
# Only for the aidevops repo — skip for all other repos
832+
REPO_SLUG=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "")
833+
if [[ "$REPO_SLUG" == "marcusquinn/aidevops" ]]; then
834+
# Pull the merge commit to the canonical repo directory
835+
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
836+
CANONICAL_DIR="${REPO_ROOT%%.*}" # Strip worktree suffix if present
837+
git -C "$CANONICAL_DIR" pull origin main
838+
839+
# Bump patch version (updates VERSION, package.json, setup.sh, etc.)
840+
"$HOME/.aidevops/agents/scripts/version-manager.sh" bump patch
841+
NEW_VERSION=$(cat "$CANONICAL_DIR/VERSION")
842+
843+
# Commit, tag, push, create release
844+
git -C "$CANONICAL_DIR" add -A
845+
git -C "$CANONICAL_DIR" commit -m "chore(release): bump version to ${NEW_VERSION}"
846+
git -C "$CANONICAL_DIR" push origin main
847+
git -C "$CANONICAL_DIR" tag "v${NEW_VERSION}"
848+
git -C "$CANONICAL_DIR" push origin "v${NEW_VERSION}"
849+
850+
# Create GitHub release with auto-generated notes
851+
gh release create "v${NEW_VERSION}" --repo "$REPO_SLUG" \
852+
--title "v${NEW_VERSION} - AI DevOps Framework" \
853+
--generate-notes
854+
855+
# Deploy locally
856+
"$CANONICAL_DIR/setup.sh" 2>/dev/null || true
857+
fi
858+
```
859+
860+
**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.
861+
862+
**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.
863+
825864
**Issue closing comment (MANDATORY — do NOT skip):**
826865

827866
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'
859898
**Follow-up needs:**
860899
- <anything that should be done next but was out of scope>
861900
- None (if complete)
901+
902+
**Released in:** v<VERSION> — run `aidevops update` to get this fix.
862903
COMMENT
863904
)"
864905
```
@@ -868,6 +909,7 @@ COMMENT
868909
- Be specific — "fixed the bug" is useless; "fixed race condition in worktree creation by adding `sleep 2` between dispatches" is useful
869910
- Include file paths with brief descriptions so future workers can find the changes
870911
- If the task was dispatched by the supervisor, include the original dispatch description for traceability
912+
- **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.
871913
- This is a gate: do NOT emit `FULL_LOOP_COMPLETE` until closing comments are posted
872914

873915
**Worktree cleanup after merge:**

0 commit comments

Comments
 (0)