You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
F: close a task's draft PR on cancel, including one opening during the cancel #111
From the #103 review (PR #110). A person can cancel a needs-human task while its draft PR is opening. Two cases:
Cancel before beginPullRequest: its transaction re-reads the status and refuses, so nothing opens.
Cancel while pulls.open is in flight: GitHub opens the PR anyway. recordPullRequestOpened records it and leaves the task cancelled.
The design closes a needs-human task's draft PR on cancel ("What this slice does not do" in docs/implementation/pull-request-opening.md). Nothing does that yet, and #103 makes this reachable in production. The same applies to a draft PR that was already open before the cancel.
Needed
On cancel task, close every open PR the task's records name, and record that it was closed. Cover openings in flight too: settle them first through the publisher's recovery, then close.
Track the close as an irreversible external action. Order the shutdown and the outcome reporting the same way as a publish.
Decide whether cancel-task waits for a publish in progress or closes the PR afterwards.
Tests
Cancel during a draft opening: the PR ends up closed, and the task stays cancelled.
Cancel with an existing draft PR: the PR is closed.
Shutdown during the close: the next start finishes it.
Decisions, made 2026-10-03. Implemented in PR #115, which is stacked on #110.
Which PRs: every open PR the task opened is closed, draft or ready, whatever the task's status was when it was cancelled.
Branch: the codeboost/… branch is kept; only the PR is closed.
Cancel during a publish: the cancel goes through at once and stops the publish. Once the publish has settled, the close runs. A PR that GitHub opened in the meantime is found by its marker.
Retry: the close outcome is saved like a publish's. A close that is still owed runs at startup. It also runs once the settle time has passed, if an opening was still unsettled. The new close-pull-requests runner action retries it.
Known limits, documented in pull-request-opening.md:
No re-check after a successful close. Once a close has recorded closed, nothing looks again. An abandoned opening's PR that GitHub shows only later, or a PR a person reopens, stays open until someone runs close-pull-requests.
Older cancelled tasks. On the first start with this change, tasks that were cancelled earlier and still have a PR record get their PRs closed.
Activity
mchwang commentedon Oct 3, 2026
Decisions, made 2026-10-03. Implemented in PR #115, which is stacked on #110.
codeboost/…branch is kept; only the PR is closed.close-pull-requestsrunner action retries it.Known limits, documented in
pull-request-opening.md:closed, nothing looks again. An abandoned opening's PR that GitHub shows only later, or a PR a person reopens, stays open until someone runsclose-pull-requests.F: report a cancelled task's PR recorded in another repository instea…
F: retry a refused close at the opening's own deadline; test the aban…
F: owe a job an unsettled action asked for; test close order and canc…
F: close a cancelled task's pull requests (#111) (#115)