Repository navigation
🐛 fix(claims): record PR→issue claims from pull_request webhooks so claimed issues stop being offered - #14823
Conversation
The duplicate-PR claim ledger only learned which issues an open PR claims
from FetchClaimScan on the full reconcile pass; cached eval cycles skip
applyDuplicatePRGuard (SkipOptional) and the pull_request webhook patched
the PR row but never linked its Fixes #N. An owner PR opened between passes
left its issue offerable for up to an hour and the contribute lane handed it
to a contributor minutes later.
- parse claims from the pull_request payload (same claimsFromPR grammar) and
apply them to the ledger via a process-wide PRClaimsHook: open → record,
edited/closed-unmerged → release, merged → merged claim
- governor hook persists the ledger and re-filters the cached actionable
snapshot through FilterClaimedIssues; open-PR link cache invalidated
- IssueDispatchBlockReason refuses a closed issue ("issue closed")
- webhook response lists claimed_issues; docs + changelog fragment
Fixes #14814
Signed-off-by: Andrew Anderson <andy@clubanderson.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 |
|
@clubanderson 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
|
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 9e1e4c1. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Fixes #14814
Root cause
src/cmd/hive/main.go~L7186:applyDuplicatePRGuard(→FetchClaimScan→FilterClaimedIssues) runs only when!budgetDecision.SkipOptional, i.e. on the full enumeration pass (~66 min apart on hive's spoke during the incident).src/pkg/github/webhook_cache.goHandleWebhookEvent: apull_requestdelivery patched the PR row into the cached snapshot but never parsed itsFixes #N/ branch claims into theClaimLedger.selectTask(which reads the ledger viadeps.IssueClaimed) assigned 🐛 stage tracker: issues withheld for open GitHub blockers show as plain Actionable #14765 nine minutes after 🐛 Surface GitHub blocked-by dependencies on Actionable stage-tracker rows #14772 (Fixes 🐛 stage tracker: issues withheld for open GitHub blockers show as plain Actionable #14765) opened, terminal attach does not find the default tmux socket under an arbitrary container UID #14789 thirteen minutes after 🐛 fix(terminal): find default tmux socket under arbitrary container UID #14791.Fix
pkg/github/webhook_pr_claims.go(new):PRClaimDeliveryparsed from the webhook payload with the sameclaimsFromPRgrammar (title/body keywords, branch name, references; hive vs external author); process-widePRClaimsHook(pattern ofSetIssueReopenedHook);ClaimLedger.ApplyPRDelivery— open → record (rank rules intact), edited to drop an issue / closed unmerged → release, merged →MergedPRclaim anchored at merge;FirstObservedAtcarried forward.webhook_cache.go: fires the hook for opened/reopened/edited/synchronize/ready_for_review/converted_to_draft/closed, invalidates the Scanner dispatches issues that already have an open linked PR; duplicates escalate to owner instead of auto-resolving #14799 open-PR link cache for the repo, reportsClaimedIssues.cmd/hive/webhook_pr_claims.go(new): governor hook —ApplyPRDelivery,Save(), thensnapshotPatcher.suppressClaimedre-filters the cached actionable snapshot throughFilterClaimedIssuesso the hub's own agents stop seeing the issue too. Installed inapplyWebhookItemsFunc.issue_claim_gate.go:IssueDispatchBlockReasonrefuses an issue whose confirming GET saysclosed(issue closed) before the open-PR listing step — belt-and-braces for closed issues still in a cached snapshot.api_github_webhook.go: response gainsclaimed_issues.issues.closedalready existed (evictClosedWebhookItem, ✨ feature: evaluate Microsoft NVX as a per-task sandbox runtime #14159); pinned by a test here.Tests (no sleeps)
pkg/github: webhookpull_requestwithFixes #7/Refs #8→ hook fires with external closing + reference claims, response lists them, cache invalidated, no-op actions/unknown repo skipped, merged vs closed state;ApplyPRDeliveryrecord/edit-release/close-release/merge; snapshot filter;IssueDispatchBlockReason→issue closed.pkg/dashboard: end-to-end — signed webhook POST withFixes #353→ real ledger via hook →selectTaskwithholds feat: copy existing agent when adding new agents #353, offers it again after the PR closes unmerged;issuesclosed delivery → row evicted → not offered.cmd/hive: hook records, persists, filters snapshot, callsonPatch, nil-safe.Docs
src/docs/operator-reference.md(Open-PR dispatch guard section): new "Webhook claim linking" bullet + closed-issue refusal.changelog.d/fixed-14814-webhook-pr-claims.md.