Repository navigation
π fix: clear blocker ledger on ordinary issue closure - #15309
hivecommons-hive[bot] merged 1 commit into
Conversation
Clear blocker entries after successful issue closes and on closed issue webhook payloads. Ignore blocker reports embedded in comments on closed issues, and cover repository name aliases and failed or gated closes. Hive-Run: hivecommons#15155 Hive-Plan: hivecommons#15155 Hive-Spec: hivecommons#15155#closed-issue-blocker-lifecycle Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@thatguywob is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Read the diff against the tree at cba03b0; this looks correct to me.
src/pkg/github/webhook_cache.go:493-505:webhookItemHintis now computed before the issue branch, andClosed()(webhook_cache.go:90-92) checksstate == "closed"case-insensitively, soissues/closed, a laterissue_commenton a closed issue, and label events on closed issues all take theClearpath instead ofObserve. The PR-comment exclusion is still enforced bywebhookTouchedIssue(webhook_cache.go:624-632), so PR rows are untouched.src/pkg/github/issue_close.go:132-138: cleared only on a successfulIssues.Editand only when!isPR, which matches howLedger.Clearis documented (pkg/blocker/ledger.go:249: "forgets the item entirely (it closedβ¦)").- The short-name/full-name double clear mirrors the mismatch that already exists between the webhook
Observe(configured, β¦)and the sweepObserve(owner+"/"+repo, β¦)attask_list_sweep.go:663, so both keys are covered.
This closes exactly the gap #15155 describes (only item_blocker.go:384 and ClearKind previously cleared). The body's claims match the diff. Suggestion only, not a defect: the test matrix doesn't cover the hive's own closeIssue path clearing the ledger, though issue_close_test.go additions do assert it β fine.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 080-awaiting-merge-admission β 050-review-pending: contributor-lane:no-verdict |
There was a problem hiding this comment.
Read the diff against the v5 tree plus the ledger and the other writers of the shared blocker ledger. Looks correct to me.
Ledger.Clearis documented for exactly this case β "forgets the item entirely (it closed, or a person resolved it)" (pkg/blocker/ledger.go:249) β so deleting the entry rather than just the blocker is the intended semantics, unlikeClearKindwhich keeps loop-guard history.- The only other writer,
task_list_sweep.go:663, only observes issues fromlistOpenIssuesForTaskListSweep(State: "open",:290), so a cleared entry on a closed issue is not recreated by the next sweep tick; the webhook path now skips observation whenres.Item.Closed()(webhook_cache.go:496), which covers the comment-after-close case. - Both key spellings are cleared (
configuredandowner/repo), matching howObserveis keyed atwebhook_cache.go:512vstask_list_sweep.go:663;splitRepofalls back toc.orgfor short names (client.go:1715), so the full-name key is always derivable. - Tests swap the shared ledger via
swapSharedLedgerso nothing touches/data/item-blockers.json.go build ./pkg/github/passes at the PR head.
Residual, not a defect of this change: an issue closed while the webhook is down (or closed before this ships) keeps its entry until someone comments on it after closure or Hive closes it; no sweep reconciles the ledger against issue state. Worth a follow-up if blocked_items still reads high after this lands.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Merged by hive contributor-lane auto-merge: CI green for β₯30m, reviewer verdict approve, @thatguywob was auto-promoted after 5 clean merged PRs in this hive's repositories. |
Base v5 already clears the blocker ledger row when a webhook payload says the issue is closed (#15309, keyed on issue.state via WebhookItemHint.Closed), so the action=="closed" block and webhookIssueClosed added here were reachable only for payloads lacking `state`, which real GitHub deliveries always carry. Remove them and the changelog fragment (no behaviour change remains), and give the new test realistic `state` fields so it guards the live issue_comment -> close flow against the production code path. Refs #15273 Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
β¦5646) * π fix: clear blocker ledger entry when an issue closes An `issues: closed` webhook left the issue's blocker ledger row in place, so capabilities.blocked_items counted closed issues. Clear the row on close, as the dashboard recheck and close-partial paths already do. Hive-Run: #15273 Hive-Plan: review-backlog style finding, webhook_cache.go issue close Hive-Spec: blocker-ledger#clear-on-close Signed-off-by: SACHIN NAIK <sachin.naik@ibm.com> * β»οΈ refactor: drop redundant close-clear; keep realistic regression test Base v5 already clears the blocker ledger row when a webhook payload says the issue is closed (#15309, keyed on issue.state via WebhookItemHint.Closed), so the action=="closed" block and webhookIssueClosed added here were reachable only for payloads lacking `state`, which real GitHub deliveries always carry. Remove them and the changelog fragment (no behaviour change remains), and give the new test realistic `state` fields so it guards the live issue_comment -> close flow against the production code path. Refs #15273 Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> * β test: name comment-seeded blocker test for what it adds TestWebhookIssueClosedClearsBlocker was a near-duplicate of the existing table test TestWebhookClosedIssueClearsBlocker, differing only by word order and re-asserting its labeled/PR-close cases. Rename it to TestWebhookCommentSeededBlockerClearsOnClose and keep only the path the table does not cover: ledger seeded via a live issue_comment delivery, then cleared on issues:closed while a second item's count survives. Refs #15273 Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --------- Signed-off-by: SACHIN NAIK <sachin.naik@ibm.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: SACHIN NAIK <sachin.naik@ibm.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closed issues retain their blocker ledger entries, inflating
/api/status.capabilities.blocked_items. Clear the entries after a successful Hive issue close and whenever a configured repository's webhook reports a closed issue. Comments on closed issues skip blocker observation, and cleanup covers both configured short names and full repository names.Regression coverage checks ordinary closes, comments on closed issues, unaffected open issues and PR comments, capability counts, and failed or confirmation-gated closes. Added a changelog fragment.
Validation:
gofmt -lon all changed Go files returned no output;git diff --checkpassed. Go tests are deferred to CI as required by AGENTS.md.Fixes #15155
Hive-Run: #15155
Hive-Plan: #15155
Hive-Spec: #15155#closed-issue-blocker-lifecycle
β hive: backend=codex
π Hive Agent:
contributor| SHA:cba03b08f