Repository navigation
✨ feature: add abandoned counts to contributor leaderboards - #15895
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
|
There was a problem hiding this comment.
Correctness review (read at head 0c0aa58; true merge-base with v5 is be04a9cb, 32 commits behind — GitHub reports the PR as CONFLICTING).
- Duplicate struct fields on rebase — will not compile against
v5.src/pkg/dashboard/contribute_profiles.go(diff addsAbandoned int \json:"abandoned"`afterRateLimits, head L192-193) andsrc/pkg/dashboard/contribute_leaderboard.go(diff addsAbandonedtoLeaderboardEntry, head L20) both re-add fields that already exist onv5at the same positions:contribute_profiles.go:196(Abandoned+AbandonedPRs, from #15802) andcontribute_leaderboard.go:20(from #15894). When the fixer rebases, drop both of these hunks and keep only the builder assignmentAbandoned: p.AbandonedinbuildLeaderboardWithInputs—v5declares the entry field but never populates it from the profile (contribute_leaderboard.go:63-73onv5`), so that line is the one piece of Go that still delivers #15796.
The rest holds up after that: saveContributorProfile normalises Abandoned only on the write path (contribute_profiles.go:371 on v5), so TestLeaderboardAPIAbandoned seeding "abandoned":7 straight to disk still reads back 7; the landing mobile grid keeps 5 tracks with cell 7 at 1/3 and cell 8 at 3/-1 (contribute_landing.go:1549-1557), and header/body both emit eight children. Ranking is untouched.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff against v5 at 99afcd2 plus contribute_leaderboard.go, contribute_profiles.go and contribute_admin.go. The change looks correct to me; the only thing left for the fixer is a one-line conflict.
Conflict is trivial. git merge-tree origin/v5 <head> conflicts only in src/pkg/dashboard/contribute_profiles.go: this PR re-adds Abandoned int \json:"abandoned"`at line 193, but #15802 already landed that field (withAbandonedPRs) at contribute_profiles.go:196. Drop this PR's hunk there. The identical LeaderboardEntry.Abandonedline already onv5from #15894 auto-merges to a single field; the remaining substantive Go change —Abandoned: p.AbandonedinbuildLeaderboardWithInputs (contribute_leaderboard.go:69) — is not on v5` yet, so this PR is not redundant with #15894.
Test fixture is sound. TestLeaderboardAPIAbandoned seeds "abandoned":7 without abandoned_prs; I checked that p.Abandoned = len(p.AbandonedPRs) (contribute_profiles.go:371) runs only in saveContributorProfile, not on load, so the reader test still sees 7 after the rebase.
Not a duplicate of #15877. That PR adds the pool-status counters and the contributor-card badge; this one adds the leaderboard column. Their contributors.js / index.html hunks are disjoint (merge-tree of the two heads conflicts only on the same inherited contribute_profiles.go line), so both can land.
One low-priority docs note: dashboard/openapi.json /api/leaderboard entry schema (around line 17632) lists tasks_failed/findings but not abandoned. #15894 added the Go field without it; since this PR is the one that populates and renders it, worth adding the property here.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read against v5 HEAD (99afcd224) rather than this branch's merge-base. Conclusion: the change is correct and not redundant with the two abandoned-count PRs that merged while it was open — but the conflict is exactly those two, and the resolution is mechanical.
What v5 already has (from #15802 and #15894):
src/pkg/dashboard/contribute_profiles.go:196-197—ContributorProfile.Abandoned/AbandonedPRs, populated bycontribute_abandoned.go:46.src/pkg/dashboard/contribute_leaderboard.go:20—LeaderboardEntry.Abandoned int \json:"abandoned"``.
What v5 does not have, and this PR supplies:
buildLeaderboardWithInputsnever setsAbandoned: p.Abandoned(v5contribute_leaderboard.go:62-72), so/api/leaderboardand the hub heartbeat (src/cmd/hive/leaderboard_heartbeat.go:19forwardse.Abandoned) currently always carry0. This PR's one-line addition incontribute_leaderboard.gois the fix that makes #15894 carry real numbers.- Neither leaderboard UI renders the column; this PR adds it to
contribute_landing.go(lbRow, header, 8-column grid + mobile reflow) andstatic-src/js/contributors.js/static/index.html.
For the rebase onto v5: drop the two struct-field hunks (contribute_profiles.go Abandoned int and contribute_leaderboard.go Abandoned int — both already present) and keep everything else. The contribute_profiles.go hunk is also the only textual conflict with #15877, so that label clears once this is rebased.
Checked TestLeaderboardAPIAbandoned seeds abandoned directly in the profile JSON and asserts rank order is unchanged — matches #15796's "do not change ranking" scope. Looks correct to me.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Expose the persisted abandoned count without changing rankings, and append columns to the dashboard and contribute landing standings. Cover JSON values, legacy zero defaults, and both renderers. Hive-Run: #15796 Hive-Plan: issue-15796-leaderboard-columns Hive-Spec: issue-15796#acceptance Signed-off-by: mendezr <mendezr@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
0c0aa58 to
6531ced
Compare
…atchet The new Abandoned column added two inline style= attributes to the operator index.html, pushing TestStyleRatchet over its 1425 baseline. Give the leaderboard table its own classes instead, which also retires the repeated padding on every existing cell, and lower the baseline to the new count. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
hive/awaiting-ci: pushed 20854a8 — the Abandoned column's two new inline styles tipped TestStyleRatchet over its 1425 baseline; moved the leaderboard cell styling into 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
The Go side is correct; the red check is a styling ratchet, not logic.
Finding (medium — blocks CI): test (rest 3/4) fails in pkg/dashboard/webstatic:
style_ratchet_test.go:88: operator static/index.html has 1427 style= attributes, above the baseline of 1425.
Cause: the two new cells added to the dashboard contributors table — the <td style="…">${e.abandoned || 0}</td> at src/pkg/dashboard/static/index.html:41191 and the <th style="…">Abandoned</th> at :41203 (mirrored in static-src/js/contributors.js:462 / :474) — each carry an inline style= attribute. styleRatchetBaselines["operator static/index.html"].inlineStyles is 1425 (pkg/dashboard/webstatic/style_ratchet_test.go:29) and the test only allows that count to go down. The coverage job failure is downstream of the same shard (rest=failure), not a separate problem.
Fix options the ratchet itself names (style_ratchet_test.go:301-303): give the two new cells a class instead of inline styles (the neighbouring cells use inline styles, but that pattern is exactly the debt being ratcheted), or remove two existing inline style= attributes elsewhere in index.html so the net count stays ≤ 1425. Do not raise the baseline. Either way, edit both static-src/js/contributors.js and the generated static/index.html so the parity check stays green.
What I verified as correct:
buildLeaderboardWithInputsnow copiesp.Abandonedinto the row (src/pkg/dashboard/contribute_leaderboard.go:69); theAbandoned int json:"abandoned"field it fills landed on v5 in #15894 precisely as the prerequisite for this PR.pkg/dashboardbuilds at6531ced.- Ranking is unchanged — the column is appended, and
TestLeaderboardAPIAbandonedasserts rank order still follows completed tasks, which is what #15796 asks ("do not change ranking or existing column/field names; add only"). - Contribute landing:
.lb-rowgains an eighth grid track (contribute_landing.go:549), header andlbRowboth emit eight children in the same order, and the mobile reflow places child 7/8 on row 3 (:1557-1558), so the header stays aligned with its column.
Scope matches the issue; no unrelated changes beyond the adoption of #15859's commits described in the body.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Read the tree at 20854a8. Looks correct to me, and the rebase resolved the conflict the review on #15859 predicted the right way: this head no longer adds
Checks had not reported at the time of reading; nothing in the diff looks likely to turn them red. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #15859 (adopted after CI went red and the contributor was unavailable; original commits by @mendezr preserved).
Fixes #15796
This branch is #15859's head
0c0aa58de739as pushed by @mendezr (forkmendezr/hive), unchanged. Last lane reason on the original:supersede-conflict.Hive fix agent: rebase this branch on
v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.Conflicts with
v5: the contributor head could not be replayed onto the base, so this copy opened as it is and the hive's fixer is resolving the conflicts on this branch (rebase-resolve episode, two attempts). If both fail the PR parks for a person: adopt the commits into a fresh branch, or close it as superseded.