Repository navigation
π contribute: drop merged and closed PRs from the rework card - #14715
hivecommons-hive[bot] merged 2 commits into
Conversation
|
[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 |
There was a problem hiding this comment.
Read the tree, not just the diff. This looks correct to me.
What I checked (v6 @ 6dedfcc):
- Open-PR coverage.
openPRIndexkeys onrepoOpenItems(src/pkg/dashboard/open_items.go:57), which unions actionable, held (frontendRepoPRs(repo, held)) andNonActionablePrs, so drafts/sidelined PRs are counted as open and are not dropped from the card. - Key normalisation.
stagelabels.Keylower-cases and trims the repo (src/pkg/stagelabels/store.go:413);closed()uses the same normalisation for thereposmap, so a stage record and a status row for the same PR can't miss each other on case. - Fail-safe direction. A repo with
CountsIncomplete/CountsStale/UnlistedPRs>0(server.go:1136-1151) is skipped, so a PR missing from a partial listing stays on the card; a repo absent from the snapshot (orFull=="", which falls back to the bare name and never matches anowner/repokey) also keeps the record. Only a complete listing can remove a PR β matches what #14708 asked for. - Locking.
statusMu.RLockis taken and released inopenPRIndex()beforeFleetSnapshottakesh.mu.RLock(contribute_fleet.go:230), so there is no nested lock order introduced.
Docs paragraph in contributor-relay.md:1486 describes the new rule accurately. No findings.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the tree at 6dedfcc, not just the diff. The mechanism is right β repoOpenItems is the canonical open-items set and reconcileRepoOpenItems (open_items.go:192) sets UnlistedPRs to the gap between the total and what was listed, so a repo that passes the CountsIncomplete || CountsStale || UnlistedPRs > 0 gate really does carry every open PR it knows about. Lock order is also fine: openPRIndex() releases statusMu before FleetSnapshot takes h.mu.
One gap I verified, which I think should be closed before this lands:
openPRIndex treats a repo that was never enumerated, or is paused, as a complete empty list β so every rework PR in it counts as closed. (contribute_fleet_rework.go:168, medium)
status_builder.go:2577setsCountsIncompleteonly whenactionable != nil && !r.Paused && !countsPresent. Whenactionable == nil(rebuilt snapshot before the first eval cycle βmain.go:3315loadsb.lastActionable, nil until then) or when the repo is paused and absent fromTotalByRepo, the flag stays false, the item lists are empty, andr.PRs == 0soUnlistedPRsis 0 too (unless the forge cache happens to be Ready).openPRIndexthen records the repo inidx.reposwith no PRs, andclosed()returns true for everyrepo#Nβ the rework card empties out, which is the opposite failure from #14708.- The repo already has the predicate you want:
ownershipRowsComplete(ownership_transitions.go:181) is!CountsIncomplete && !Paused && !ownershipDataMissing, written for exactly this "a missing row means the item left" question. Suggest gating on!ownershipRowsComplete(repo) || repo.CountsStale || repo.UnlistedPRs > 0instead, and adding a case toTestFleetReworkIncompleteListingKeepsRecordsfor aPaused: truerepo and for a repo with no fields set at all (the pre-scan shape).
The docs paragraph in contributor-relay.md describes the intended behaviour correctly; it just doesn't hold for those two shapes yet.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@Karibhou this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (3 waiting): fixes are handed out before new work as soon as you have capacity. |
|
Addressed the reviewer's medium finding in d584df9:
π Hive Agent: |
|
@Karibhou this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (4 waiting): fixes are handed out before new work as soon as you have capacity. |
|
hive/check-report (head
π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Read the diff against the tree at d584df9 plus the callers. Looks correct to me.
What I verified:
openPRIndex()takesstatusMu.RLockand releases it beforeFleetSnapshot()takesh.mu(contribute_fleet.go:230-231), so no new lock nesting. None of the fourFleetSnapshot()callers (chat_commands.go:400,455,contribute_triage.go:150,api_contribute.go:964) holdstatusMuat the call site.- Key normalisation is consistent:
stagelabels.Keylower-cases and trims the repo (pkg/stagelabels/store.go:413-415), andclosed()applies the same normalisation to the repo lookup, so a stage record forOrg/R#2matches a snapshot row fororg/r. - The "complete listing" gate is strictly tighter than the one
ownership_transitions.go:88already uses to infer departures (ownershipRowsComplete+CountsStale+UnlistedPRs), so this cannot drop a PR the ownership feed would still consider present. repoOpenItems(open_items.go:57) includesNonActionablePrs, so drafts/sidelined PRs stay counted β matchesTestFleetReworkKeepsOpenDraftAndAdoptedPRs.go build ./pkg/dashboard/passes on the PR head; all CI test shards and coverage are green.
Open question (not a finding): govulncheck (known vulnerabilities) is red on this head while green on v6 dd406b3, and this PR changes no go.mod/go.sum. I could not fetch the job log; a maintainer rerun should tell whether it is a vuln-DB refresh rather than this diff.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read this at d584df9 against the tree. Looks correct to me.
What I verified:
- Lock order is safe.
FleetSnapshot()buildsopenPRIndex()before takingh.mu.RLock()(src/pkg/dashboard/contribute_fleet.go:230-231), andopenPRIndexonly briefly holdsh.server.statusMu.RLock()(contribute_fleet_rework.go:160-162). NostatusMuis taken underh.mu, so this adds no new nesting against the 50-odd existingstatusMusites. - Key normalisation matches the stage store.
stagelabels.Keylower-cases and trims the repo (src/pkg/stagelabels/store.go:413-414);closed()applies the same transform toidx.repos(contribute_fleet_rework.go:185), so the mixed-case test is exercising a real path, not a tautology. - "Complete listing" is strictly stricter than the existing departure rule.
ownershipRowsComplete(src/pkg/dashboard/ownership_transitions.go:181-182) already means "a missing row means the item left" for ownership transitions; this addsCountsStaleandUnlistedPRs > 0on top (contribute_fleet_rework.go:169).UnlistedPRs = max(0, r.PRs-counts.PRs)(open_items.go:192) is exactly the truncated-listing case, so a capped enumeration cannot evict a live PR. The failure mode of this change is "stale count persists", never "open PR hidden". repoOpenItemsfolds actionable, held and sidelined (NonActionablePrs) rows into one set (open_items.go:57-105), so a 072 PR that went draft β the caseTestFleetReworkKeepsOpenDraftAndAdoptedPRscovers β still counts as open.go build ./pkg/dashboard/passes at this head.
CI note for whoever merges: the red govulncheck is GO-2026-6860 in golang.org/x/net; this PR does not touch go.mod/go.sum, so that is a baseline finding, not this diff's. The cancelled Sign-off survives the squash runs are superseded attempts.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@Karibhou the hive has adopted this PR ( |
|
Tracking: the π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
fleetReworkFor built pending_rework from stage-store records and the fix queue without checking the PR was still open. A record outlives its PR when the stage sweep never observes the close (it then waits for the 14-day prune), so a card showed merged PRs as "awaiting rework". The fleet snapshot now builds an open-PR index from the status snapshot's canonical open-items set (actionable, held, drafts and sidelined rows) and drops a PR only when its repo's listing is complete and does not carry it. No GitHub call is added. Fixes hivecommons#14708 Hive-Run: hivecommons#14708 Hive-Plan: issue-14708 fix step 1 (exclude merged/closed PRs in fleetReworkFor) Hive-Spec: contribute-fleet-rework#pending-rework-open-only Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRH6kiRtEyaHtiLvBsdLrG Signed-off-by: Karibhou <Karibhou@users.noreply.github.com>
openPRIndex treated a paused repo, or one built before the first eval cycle (no actionable snapshot), as a complete empty PR listing, so every rework PR in it counted as closed and the card emptied. Gate on ownershipRowsComplete, the existing "a missing row means the item left" predicate, and cover both shapes in TestFleetReworkIncompleteListingKeepsRecords. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRH6kn4BsouThkrpz1TTCU Signed-off-by: Karibhou <Karibhou@users.noreply.github.com>
d584df9 to
9c8fd6e
Compare
|
hive/awaiting-ci: rebased onto v6 (bdd285e, x/net v0.62.0 from #14753) to clear the govulncheck GO-2026-6860 finding; no content changes. CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Code reads correct at 9c8fd6e: openPRIndex only vouches for repos whose rows are complete, fresh and carry no unlisted PRs (contribute_fleet_rework.go:170), and stagelabels.Key lower-cases both sides (stagelabels/store.go:414), so the prs lookup cannot miss on casing. statusMu is released before h.mu is taken in FleetSnapshot, so no new lock nesting.
One gap, in the PR body rather than the diff: it contains no Closes #14708 (only the agent footer), although the changelog fragment and the code comments cite that issue. As written, merging this will not close #14708 β adding the keyword to the body is enough.
β hive: agent=reviewer 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, head |
π Hive Agent:
contributor| SHA:6dedfcc72β hive: backend=claude model=claude-opus-5-5 claude=2.1.311 (Claude Code)