Uh oh!
There was an error while loading. Please reload this page.
fix(kanban): reliably route closed issues (close-time race + reconcile backstop) - #99
Merged
Merged
Conversation
…osedByPullRequestsReferences closedByPullRequestsReferences is eventually-consistent and EMPTY at the instant the issues:closed event fires, so the router missed the closing PR and no-oped — completed issues stayed stuck in their pre-close column (confirmed on backend#979: timeline had closer PR #1289->develop, closedByPullRequestsReferences empty). Read timelineItems(CLOSED_EVENT).closer instead — present immediately, and it distinguishes a PR closer (mirror base), a Commit closer (On dev), and a manual close (leave to reconcile). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…inal columns Adds category 5: any CLOSED issue in a non-terminal column is routed by state_reason (not_planned/duplicate -> Cancelled, else -> Prod). Backstops the closure-router's close-time race and the hand-closed case that it deliberately leaves. Widens the pull to the planning columns (Ready/North Stars) so no closed issue hides. Safe now that fr-gate attributes via commits->PRs (a card in Prod can't satisfy the gate). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 28, 2026
ContributorAuthor
bugbot run |
Uh oh!
There was an error while loading. Please reload this page.
…open+reclose) Take the most recent ClosedEvent unconditionally instead of filtering to non-null closers; otherwise a reopen followed by a manual re-close reused the stale PR/commit closer instead of treating the current close as manual. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 28, 2026
ContributorAuthor
bugbot run |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fb2b372. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (investigated)
The closure-router fires on every issue close and runs green, but no-ops for completed issues: it looked up the closing PR via
closedByPullRequestsReferences, which is eventually-consistent and empty at the instant of the close event. So it hit the "no closing PR → leave Status unchanged" branch and completed issues piled up in their pre-close column (~30 found in the board sweep).Proof — backend#979 close-run log:
Routing decision: status=(unchanged), yet its timelineClosedEvent.closer= PR #1289→develop was present at run time;closedByPullRequestsReferenceswas empty.Fix 1 — router reads the authoritative signal
Switch the lookup to
timelineItems(CLOSED_EVENT).closer— the event that triggered the run, present immediately. It cleanly distinguishes:Closes #Npush) → On devFix 2 — reconcile backstops the rest
The weekly reconcile never swept closed issues stuck in non-terminal columns (only open ones). New category 5: any CLOSED issue in a non-terminal column → routed by
state_reason(not_planned/duplicate→Cancelled, else→Prod). Pull widened to Ready/North Stars so none hide. This self-heals the hand-closed case + any residual race.Safe because the fr-gate rework (#90) now attributes promotions via commits→PRs, so a card parked in Prod can no longer satisfy the gate — which is why the router was conservative before.
Test plan
Fixes the recurring closed-issue clutter surfaced in the RFC-0008 board sweep.
Note
Medium Risk
Changes kanban Status for closed issues (including bulk Prod moves in reconcile); mitigated by fr-gate no longer trusting card column alone and existing MAX_MOVES caps.
Overview
Fixes completed issues staying in pre-close kanban columns because the closure router queried
closedByPullRequestsReferences, which is empty when the close webhook runs.Closure router now reads the latest
ClosedEvent.closerfrom the issue timeline: PR closers mirror base branch status; commit closers (Closes #Npushes) go to On dev; manual closes still leave Status unchanged (reconcile handles them).Weekly reconcile adds closed-issue terminalize: any CLOSED issue in a non-terminal column moves to Cancelled (
NOT_PLANNED/DUPLICATE) or Prod (completed/unspecified). The board pull includes Ready and North Stars so stranded closed issues are swept; open issues in planning columns are explicitly left alone.Reviewed by Cursor Bugbot for commit fb2b372. Bugbot is set up for automated code reviews on this repo. Configure here.