Bot PR-authoring: emit a Closes #NN keyword when a PR resolves an issue #372

Closed
opened 2026-07-09 23:00:58 +00:00 by igor · 0 comments
Collaborator

Problem

When a bot PR resolves a tracked issue, the PR-authoring step names the issue in the PR title (e.g. review: ... (#369)) but doesn't put a closing keyword in the body. Forgejo only auto-closes on a Closes #NN / Fixes #NN keyword (immediately before the ref), so the merge leaves the issue orphaned — open despite being fixed — and a human has to notice and close it by hand.

Evidence

  • #371 (fixes #369) merged 2026-07-09 with body ref #369 as a plain link → #369 stayed open, closed manually after the fact.
  • #370 (fixes #367) merged the same day with a proper Closes #367#367 auto-closed. Same author, same tick, opposite outcome — purely the keyword.

Fix

Where the harness composes a bot PR body for issue-resolving work, emit a properly-formatted Closes #NN line (keyword directly before the ref) for the issue the PR resolves. The linkage is already known — it's the number put in the title today — so this is wiring an existing value into the body in the right format, not inferring anything new.

Scope note: only add the keyword when the PR genuinely resolves the issue (a PR that merely references related work should stay a plain link). The issue-work path already knows which issue it's building, so key off that, not a title regex.

Acceptance

  • A bot PR opened to resolve issue #NN contains a Closes #NN keyword that auto-closes it on merge.
  • A test covering the PR-body composition (if there's a seam for it) so this doesn't silently regress.

Backlog — not urgent. Relates to the manual close of #369.

## Problem When a bot PR resolves a tracked issue, the PR-authoring step names the issue in the PR **title** (e.g. `review: ... (#369)`) but doesn't put a closing keyword in the **body**. Forgejo only auto-closes on a `Closes #NN` / `Fixes #NN` keyword (immediately before the ref), so the merge leaves the issue orphaned — open despite being fixed — and a human has to notice and close it by hand. ## Evidence - **#371** (fixes #369) merged 2026-07-09 with body ref `#369` as a plain link → #369 stayed **open**, closed manually after the fact. - **#370** (fixes #367) merged the same day with a proper `Closes #367` → #367 **auto-closed**. Same author, same tick, opposite outcome — purely the keyword. ## Fix Where the harness composes a bot PR body for issue-resolving work, emit a properly-formatted `Closes #NN` line (keyword directly before the ref) for the issue the PR resolves. The linkage is already known — it's the number put in the title today — so this is wiring an existing value into the body in the right format, not inferring anything new. Scope note: only add the keyword when the PR genuinely *resolves* the issue (a PR that merely references related work should stay a plain link). The issue-work path already knows which issue it's building, so key off that, not a title regex. ## Acceptance - A bot PR opened to resolve issue #NN contains a `Closes #NN` keyword that auto-closes it on merge. - A test covering the PR-body composition (if there's a seam for it) so this doesn't silently regress. Backlog — not urgent. Relates to the manual close of #369.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joshtronic/igor#372
No description provided.