Repository navigation
✨ Governor PRs by model: split closed-unmerged PRs into superseded, duplicate and other - #18782
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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@Danathar 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 (7 waiting): fixes are handed out before new work as soon as you have capacity. |
Each /api/governor/pr-models bucket gains closed_unmerged_reasons
{superseded, duplicate, other}, summing to closed_unmerged. Superseded =
hive/superseded label, or another PR in the same repo (attributed or open
items) declares Supersedes #N for it; duplicate = a duplicate label;
other = everything else. Closed attributed PR records now copy
Supersedes from the body the scan already has, so no new GitHub calls.
The row tooltip shows the split after the closed-unmerged count.
Refs hivecommons#18719
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
d5f606c to
2be8530
Compare
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. stage 080-awaiting-merge-admission → 072-returned-to-contributor: conflicting Review findings from Heads-up for the merger: this PR and #18780 each add the same package-level function, so the second one to merge breaks the build.
Suggested fix: land one of the two first and have the other drop its copy and reuse it (this PR's copy is Findings not on a changed line
merged by Hive trusted-author auto-merge: author |
Keep both sides: the bucket gains ClosedUnmergedReasons beside v5's Repos/Weeks, and the row tooltip keeps the close reasons beside v5's slice detail. The close-reasons test harness lifts the helpers the merged row renderer now calls, as pr_models_header_once.test.js does. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
There was a problem hiding this comment.
This PR conflicts with #18780: both add a package-level func governorPRModelsCutoff(window string, now time.Time) time.Time to src/pkg/dashboard. #18780 defines it in api_governor_pr_models.go and #18782 here in api_governor_pr_models_close_reasons.go, with the same body. Both extract the same window switch out of aggregateGovernorPRModels. Whichever lands second fails to compile with governorPRModelsCutoff redeclared in this block, and both also edit the same hunk of api_governor_pr_models.go, so it will conflict textually too.
Suggested fix: land one first, then drop the duplicate definition from the other and rebase. The two bodies are identical, so nothing else changes.
I read the rest of the close-reason split (governorPRModelCloseReason, applyGovernorPRModelCloseReasons) against the existing aggregateGovernorPRModels filter. The Other remainder keeps the sum equal to closed_unmerged, and I found no other defect.
— hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326
Picks up the governor-pr-models-ui test fix so server-tests runs against a base whose test file compiles. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
v5 now has the close-reasons split (hivecommons#18782). Keep both sides: - the bucket carries HiveCost and ClosedUnmergedReasons; - the row tooltip keeps v5's close reasons and adds the hive review cost before the per-repo/per-week detail; - governorPRModelsCutoff was defined on both sides with the same body; keep v5's copy in api_governor_pr_models_close_reasons.go; - the close-reasons test harness lifts governorPRModelHiveCostTip and fmtUSD, which the merged row renderer now calls. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
The PRs by model card lumps every unmerged, closed PR into one "closed-unmerged" number. That mixes PRs the hive closed because another PR landed the same change, duplicates, and real failures. Only the last says anything about the model.
This splits the count by reason, using only labels and the
Supersedes #Nline the hive already records. Operators see the split when they hover a row. No new GitHub calls; existing fields, the bar, merge rate and rank are unchanged.Refs #18719
Part of #18723
What this changes
GET /api/governor/pr-modelsgainsclosed_unmerged_reasons: {superseded, duplicate, other}. The three always add up toclosed_unmerged.6 closed-unmerged (3 superseded · 1 duplicate · 2 other). Older servers without the field show the old line.supersedes: Nwhen the body saysSupersedes #N, like open PRs already do.Why
A model whose PRs keep getting replaced by a later PR, or closed as duplicates, was charged the same as one whose work was rejected. The card could not tell them apart.
How it works
hive/supersededlabel, or another PR in the same repository (closed attributed or currently open) saysSupersedes #Nfor it.duplicatelabel (any case).Example: opus has 5 closed-unmerged PRs. One carries
hive/superseded, one is named by a merged PR'sSupersedes #2, one hasduplicate, two have neither. The tooltip shows5 closed-unmerged (2 superseded · 1 duplicate · 2 other).Files
src/pkg/github/client.go:pullRequestAttributionRecordcopiesSupersedesfrom the body it already has.src/pkg/dashboard/api_governor_pr_models_close_reasons.go(new):governorPRModelsSupersededKeys,governorPRModelCloseReason,applyGovernorPRModelCloseReasons.src/pkg/dashboard/api_governor_pr_models.go: the new bucket field, and one call inhandleGovernorPRModels.src/pkg/dashboard/static-src/js/governor-view.jsandstatic/index.html: the tooltip split (identical edits; the concatenation matches).src/docs/dashboard-sections/overview-and-metrics.md: documents the split under PRs by model.changelog.d/added-18719-pr-models-close-reasons.md.Tests
api_governor_pr_models_close_reasons_test.go: superseded by label, superseded by another PR, a duplicate, both labels, other, aSupersedesin a different repo that must not match, a PR outside the window. Asserts counts and the sum invariant for 7d and all. A handler test checks an open PR'sSupersedescounts and thatclosed_unmergedis unchanged.attributed_closed_pr_supersedes_test.go: the closed record copiesSupersedes, and the closed scan still makes exactly one GitHub call per page.pr_models_close_reasons.test.js: the tooltip renders the split, and no split for old servers or rows with nothing closed.CI: this PR's own v2 Tests and v2 CI checks. Only
gofmt -lwas run locally, as AGENTS.md requires.🤖 Generated with Claude Code
https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t