finish: close a held branch issue once its blockers close, with a label queue and a reconcile action #825

Open
opened 2026-10-20 01:52:59 +00:00 by hexajon · 0 comments
Owner

When finish runs on an issue branch while that issue still depends on an open issue, it merges and writes Refs #N, because the forge would drop a close of a blocked issue. Nothing closes #N later, so its work is merged while it stays open.

Decision: the merge still goes through, and madtea closes the held issue itself once nothing blocks it.

  1. When finish merges an issue branch but leaves the issue open, it adds the label madtea/held to the issue (creating the label if the repo lacks it) and writes Held: #N waits on #M in the PR body.
  2. Catch-up check: list the open issues labelled madtea/held (one list call per 50 issues), and read each one's dependencies. An issue with no open dependency is closed, with a note that names the PR that did its work and the blockers that closed, and the label comes off.
  3. The catch-up check runs at the end of every finish, after the merge. It also runs as a reconcile action on madt_issues and the matching CLI command, for a manual sweep.

This catches a blocker closed outside madtea: the next finish or reconcile in the repo closes the held issue. It also covers the after-merge step for a held issue whose last blocker this merge closed. #823 does the same for epics.

Forge facts, from the probes in internal/testforge/closeprobe (Forgejo and Gitea, baseline and latest pins):

  • The issues list with a labels= filter returns exactly the open issues that carry the label, for a plain name and a name with a slash, within about 130 ms of the label being added.
  • One page holds at most 50 issues.

Acceptance, against throwaway Forgejo and Gitea servers:

  • Finish on a blocked branch issue merges, labels the issue madtea/held, and writes the Held: line.
  • A held issue closes, with the note, when finish merges its last blocker, and the label comes off.
  • A held issue closes on a later finish, or on reconcile, after its last blocker was closed by hand.
  • A held issue with a blocker still open stays open and keeps the label.
  • An open issue without the label is never closed by the catch-up check.
When finish runs on an issue branch while that issue still depends on an open issue, it merges and writes `Refs #N`, because the forge would drop a close of a blocked issue. Nothing closes #N later, so its work is merged while it stays open. Decision: the merge still goes through, and madtea closes the held issue itself once nothing blocks it. 1. When finish merges an issue branch but leaves the issue open, it adds the label `madtea/held` to the issue (creating the label if the repo lacks it) and writes `Held: #N waits on #M` in the PR body. 2. Catch-up check: list the open issues labelled `madtea/held` (one list call per 50 issues), and read each one's dependencies. An issue with no open dependency is closed, with a note that names the PR that did its work and the blockers that closed, and the label comes off. 3. The catch-up check runs at the end of every finish, after the merge. It also runs as a `reconcile` action on `madt_issues` and the matching CLI command, for a manual sweep. This catches a blocker closed outside madtea: the next finish or reconcile in the repo closes the held issue. It also covers the after-merge step for a held issue whose last blocker this merge closed. #823 does the same for epics. Forge facts, from the probes in `internal/testforge/closeprobe` (Forgejo and Gitea, baseline and latest pins): - The issues list with a `labels=` filter returns exactly the open issues that carry the label, for a plain name and a name with a slash, within about 130 ms of the label being added. - One page holds at most 50 issues. Acceptance, against throwaway Forgejo and Gitea servers: - Finish on a blocked branch issue merges, labels the issue `madtea/held`, and writes the `Held:` line. - A held issue closes, with the note, when finish merges its last blocker, and the label comes off. - A held issue closes on a later finish, or on `reconcile`, after its last blocker was closed by hand. - A held issue with a blocker still open stays open and keeps the label. - An open issue without the label is never closed by the catch-up check.
Sign in to join this conversation.
No milestone
No project
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
sixfold-space/madtea#825
No description provided.