Repository navigation
feat(gitgud-ship-issue): status labels for shipped issues - #31
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l block Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n-stau
left a comment
There was a problem hiding this comment.
Review 1 · Claude Opus 5.5 - 5 findings (2 bugs, 1 risk, 2 nits).
skills/gitgud-branch/SKILL.mdline 128 (outside the diff hunk lines), bug: the label removal runs even when the release did not merge. Fix: guard withstate = MERGED.
| cd "<main checkout>" # leave the issue worktree before removing it | ||
| git worktree remove "../<repo>-<N>" # if a worktree was used: the branch is on GitHub | ||
| gh pr merge <N> --squash --delete-branch --body "Closes #<issue>" --match-head-commit "$sha" | ||
| set_status "status: ready for release" <issue> |
There was a problem hiding this comment.
bug: set_status ready for release runs even when gh pr merge fails.
Fix: chain with &&, set blocked on failure.
There was a problem hiding this comment.
Fix 1 · Opus 5.5
Fixed in aae5282 and 670ef5f: the merge sets ready for release only in the success branch of an if/else, blocked otherwise; the release removes the label only when the PR state is MERGED; each set_status means running the Status labels block (idempotent label create + function) in the same call; placeholders are <issue>.
| for l in "status: in progress|fbca04|Branch exists, being built" "status: in review|1d76db|PR open, review loop running" "status: blocked|d93f0b|Loop stopped, needs the user" "status: ready for release|0e8a16|Merged into develop, waits for the release to main"; do | ||
| IFS='|' read -r name color desc <<<"$l"; gh label create "$name" --color "$color" --description "$desc" --force # creates or updates | ||
| done # once per repo, before the first status | ||
| set_status() { # set_status "<label>" <issue>: removes the other three, adds this one; functions do not survive between calls, so define it in each call |
There was a problem hiding this comment.
risk: the step blocks call set_status without defining it, though functions do not survive between calls.
Fix: say each set_status means running the Status labels block in the same call.
There was a problem hiding this comment.
Fix 1 · Opus 5.5
Fixed in aae5282 and 670ef5f: the merge sets ready for release only in the success branch of an if/else, blocked otherwise; the release removes the label only when the PR state is MERGED; each set_status means running the Status labels block (idempotent label create + function) in the same call; placeholders are <issue>.
| Find it, or write one if none matches, and rewrite unclear text per `gitgud-issue` section 5. Closed issue: ask before reopening or working on it. Still unclear what "done" means after reading the code: ask before implementing. | ||
|
|
||
| ## 2. Branch | ||
|
|
There was a problem hiding this comment.
nit: step 2 never runs the label creation; on a fresh repo the edit fails.
Fix: run the label block before the first status.
There was a problem hiding this comment.
Fix 1 · Opus 5.5
Fixed in aae5282 and 670ef5f: the merge sets ready for release only in the success branch of an if/else, blocked otherwise; the release removes the label only when the PR state is MERGED; each set_status means running the Status labels block (idempotent label create + function) in the same call; placeholders are <issue>.
| @@ -41,8 +62,8 @@ No host subagents: ship them one after another. | |||
| 1. Read the code the issue touches, implement the smallest change that meets every "Done when" check, add or update tests. | |||
| 2. Run what CI runs (`gitgud-pr` section 1), plus each "Done when" check you can run. | |||
| 3. Commit per `gitgud-commit`, push with `git push -u origin HEAD`. | |||
There was a problem hiding this comment.
nit: <N> means the PR number in steps 3-5.
Fix: <issue>.
There was a problem hiding this comment.
Fix 1 · Opus 5.5
Fixed in aae5282 and 670ef5f: the merge sets ready for release only in the success branch of an if/else, blocked otherwise; the release removes the label only when the PR state is MERGED; each set_status means running the Status labels block (idempotent label create + function) in the same call; placeholders are <issue>.
… PR blocked Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bel colors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n-stau
left a comment
There was a problem hiding this comment.
Review 2 · Claude Opus 5.5 - 3 findings (1 risk, 2 nits).
| ## 5. Merge into develop | ||
|
|
||
| Merge only when all of these hold; otherwise do not merge and report: | ||
| Merge only when all of these hold; otherwise do not merge, `set_status "status: blocked" <issue>` and report: |
There was a problem hiding this comment.
risk: nothing moves the issue off blocked when the loop resumes.
Fix: one sentence: set the label of the step it resumes at.
There was a problem hiding this comment.
Fix 2 · Opus 5.5
Fixed in 5349e36: resume sentence added; the block comment is at the top of the step 5 snippet and the moved-head stop sets blocked; labels are created only when missing (tested the lookup on this repo).
| cd "<main checkout>" # leave the issue worktree before removing it | ||
| git worktree remove "../<repo>-<N>" # if a worktree was used: the branch is on GitHub | ||
| gh pr merge <N> --squash --delete-branch --body "Closes #<issue>" --match-head-commit "$sha" | ||
| # Status labels block first (set_status) |
There was a problem hiding this comment.
nit: the moved-head stop exits without marking the issue blocked; the block comment sits too late.
Fix: comment at the top, set blocked on the moved-head stop.
There was a problem hiding this comment.
Fix 2 · Opus 5.5
Fixed in 5349e36: resume sentence added; the block comment is at the top of the step 5 snippet and the moved-head stop sets blocked; labels are created only when missing (tested the lookup on this repo).
| ```bash | ||
| for l in "status: in progress|fbca04|Branch exists, being built" "status: in review|1d76db|PR open, review loop running" "status: blocked|d93f0b|Loop stopped, needs the user" "status: ready for release|0e8a16|Merged into develop, waits for the release to main"; do | ||
| IFS='|' read -r name color desc <<<"$l"; gh label create "$name" --color "$color" --description "$desc" --force # creates or updates | ||
| done # idempotent: removing a label the repo lacks would fail the edit |
There was a problem hiding this comment.
nit: --force on every call resets colors the user changed.
Fix: create only missing labels.
There was a problem hiding this comment.
Fix 2 · Opus 5.5
Fixed in 5349e36: resume sentence added; the block comment is at the top of the step 5 snippet and the moved-head stop sets blocked; labels are created only when missing (tested the lookup on this repo).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n-stau
left a comment
There was a problem hiding this comment.
Review 3 · Claude Opus 5.5 - 2 findings (1 risk, 1 nit).
| sha=$(gh pr view <N> --json headRefOid -q .headRefOid) # show it with the body: the go covers exactly this commit | ||
| gh repo view --json deleteBranchOnMerge -q .deleteBranchOnMerge # true would delete develop on merge: stop and ask | ||
| gh pr checks <N> --watch --fail-fast && gh pr merge <N> --merge --match-head-commit "$sha" # merge commit; never squash, never --delete-branch (it would delete develop) | ||
| [ "$(gh pr view <N> --json state -q .state)" = MERGED ] && for n in <each issue the release closes>; do gh issue edit "$n" --remove-label "status: ready for release"; done # only after the merge, also a later one by hand; if the repo has that label |
There was a problem hiding this comment.
risk: only ready for release is removed; an issue whose PR was merged by hand after a stop closes with a stale blocked or in review.
Fix: remove all four.
nit: the comment is hard to read and does not say where the issue numbers come from.
Fix: reword it.
There was a problem hiding this comment.
Fix 3 · Opus 5.5
Fixed in 1943a1b: the release removes all four status labels; the comment names the source of the issue numbers and the skip case. PR body updated.
…itive label lookup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n-stau
left a comment
There was a problem hiding this comment.
Review 4 · Claude Opus 5.5 - 3 findings (1 risk, 2 nits).
| sha=$(gh pr view <N> --json headRefOid -q .headRefOid) # show it with the body: the go covers exactly this commit | ||
| gh repo view --json deleteBranchOnMerge -q .deleteBranchOnMerge # true would delete develop on merge: stop and ask | ||
| gh pr checks <N> --watch --fail-fast && gh pr merge <N> --merge --match-head-commit "$sha" # merge commit; never squash, never --delete-branch (it would delete develop) | ||
| [ "$(gh pr view <N> --json state -q .state)" = MERGED ] && for n in <each issue the release closes>; do gh issue edit "$n" --remove-label "status: in progress,status: in review,status: blocked,status: ready for release"; done # after the merge (also a later manual one); issues from the "issues it closes" line above; skip if the repo has no status labels (the edit fails) |
There was a problem hiding this comment.
risk: the issue list comes from the commit-body grep, which still holds issues switched to Refs #N; they stay open without a status label.
Fix: take the numbers from the release body Closes lines.
There was a problem hiding this comment.
Fix 4 · Opus 5.5
Fixed in 23dd224: issue numbers from the release body's Closes #N lines (tested: Refs lines are skipped), a failed label list prints a message, lookup is case-insensitive (tested).
| | `status: ready for release` | `0e8a16` | the PR is merged into `develop` (step 5); the release removes it | | ||
|
|
||
| ```bash | ||
| have=$(gh label list --limit 200 --json name -q '.[].name') || exit 1 |
There was a problem hiding this comment.
nit: a failed gh label list exits silently before the merge.
Fix: print a message to report.
There was a problem hiding this comment.
Fix 4 · Opus 5.5
Fixed in 23dd224: issue numbers from the release body's Closes #N lines (tested: Refs lines are skipped), a failed label list prints a message, lookup is case-insensitive (tested).
| ```bash | ||
| have=$(gh label list --limit 200 --json name -q '.[].name') || exit 1 | ||
| for l in "status: in progress|fbca04|Branch exists, being built" "status: in review|1d76db|PR open, review loop running" "status: blocked|d93f0b|Loop stopped, needs the user" "status: ready for release|0e8a16|Merged into develop, waits for the release to main"; do | ||
| IFS='|' read -r name color desc <<<"$l"; grep -qxF "$name" <<<"$have" || gh label create "$name" --color "$color" --description "$desc" |
There was a problem hiding this comment.
nit: label names are case-insensitive on GitHub, grep -qxF is not.
Fix: grep -qixF.
There was a problem hiding this comment.
Fix 4 · Opus 5.5
Fixed in 23dd224: issue numbers from the release body's Closes #N lines (tested: Refs lines are skipped), a failed label list prints a message, lookup is case-insensitive (tested).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n-stau
left a comment
There was a problem hiding this comment.
Review 5 · Claude Opus 5.5 - 1 finding (1 risk).
| sha=$(gh pr view <N> --json headRefOid -q .headRefOid) # show it with the body: the go covers exactly this commit | ||
| gh repo view --json deleteBranchOnMerge -q .deleteBranchOnMerge # true would delete develop on merge: stop and ask | ||
| gh pr checks <N> --watch --fail-fast && gh pr merge <N> --merge --match-head-commit "$sha" # merge commit; never squash, never --delete-branch (it would delete develop) | ||
| [ "$(gh pr view <N> --json state -q .state)" = MERGED ] && for n in $(grep -oE '^Closes #[0-9]+' /tmp/release.md | tr -dc '0-9\n'); do gh issue edit "$n" --remove-label "status: in progress,status: in review,status: blocked,status: ready for release"; done # after the merge (also a later manual one); issues from the release body's Closes lines; skip if the repo has no status labels (the edit fails) |
There was a problem hiding this comment.
risk: /tmp/release.md may be gone or stale for a later manual merge.
Fix: read the Closes lines from the merged PR body.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n-stau
left a comment
There was a problem hiding this comment.
Review 6 · Claude Opus 5.5 - 1 finding (1 nit).
| sha=$(gh pr view <N> --json headRefOid -q .headRefOid) # show it with the body: the go covers exactly this commit | ||
| gh repo view --json deleteBranchOnMerge -q .deleteBranchOnMerge # true would delete develop on merge: stop and ask | ||
| gh pr checks <N> --watch --fail-fast && gh pr merge <N> --merge --match-head-commit "$sha" # merge commit; never squash, never --delete-branch (it would delete develop) | ||
| [ "$(gh pr view <N> --json state -q .state)" = MERGED ] && for n in $(gh pr view <N> --json body -q .body | grep -oE '^Closes #[0-9]+' | tr -dc '0-9\n'); do gh issue edit "$n" --remove-label "status: in progress,status: in review,status: blocked,status: ready for release"; done # after the merge (also a later manual one); issues from the merged PR body's Closes lines; skip if the repo has no status labels (the edit fails) |
There was a problem hiding this comment.
nit: only exact Closes #N at line start matches; Fixes #12, closes #12 or - Closes #12 close the issue but keep the label.
Fix: use the closing-keyword matcher of line 118, anchored with optional list markers.
There was a problem hiding this comment.
Fix 6 · Opus 5.5
Fixed in a86acbe: case-insensitive closing keywords with optional list markers (tested: Closes #22, - fixes #24, resolved: #26 match; Refs #9 and mid-line text do not).
n-stau
left a comment
There was a problem hiding this comment.
Review 7 · Claude Opus 5.5 - No findings. Checked: skills/gitgud-ship-issue/SKILL.md, skills/gitgud-branch/SKILL.md
The review loop now keeps one status label on the issue it ships, so the issue list shows where each one stands:
status: in progress(branch exists),status: in review(PR open),status: blocked(loop stopped, needs the user) andstatus: ready for release(merged intodevelop, waiting for the go tomain). The release clears the status label; closed means done.Why: without labels you have to open each issue to see whether it is being built, reviewed, stuck or waiting for the release.
Changes
skills/gitgud-ship-issue/SKILL.md: new Status labels section (labels, colors,set_statushelper), status changes in steps 2, 3.4, 3.5 and 5, Rules allow these labels without an extra yes, description mentions them.skills/gitgud-branch/SKILL.mdsection 8: the release removes every status label from the issues it closes.README.md: the highlight names the status labels.Changes checks
skills/gitgud-ship-issue/SKILL.md,skills/gitgud-branch/SKILL.md(agent instruction files)Tested: created the four labels in this repo with the loop's command and switched issue #30 through in review, blocked and in progress with
set_status; exactly one status label stayed each time. Removing a label that does not exist in the repo fails, which is why the labels are created first.Closes #30
🤖 Generated with Claude Code