Repository navigation
✨ feature: carry abandoned counts through the hub leaderboard - #15894
Conversation
Share heartbeat and task-status row conversion, merge abandoned counts across public spokes, and document the additive wire field. Include the prerequisite dashboard row field shared with #15859; profile population remains in that PR. Hive-Run: #15799 Hive-Plan: 15799-heartbeat-and-hub-leaderboard Hive-Spec: issue-15799#acceptance Signed-off-by: mendezr <mendezr@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 |
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 315d07a (src/pkg/hub/server.go, src/pkg/hub/spoke/heartbeat.go, src/cmd/hive/main.go, src/pkg/dashboard/contribute_leaderboard.go). Looks correct to me.
What I verified
mergeLeaderboards(src/pkg/hub/server.go:4442-4475): the existing!h.IsPublic/ empty-username /TrustTier == "agent"filters at:4445and:4449run before the newexisting.Abandoned += lb.Abandonedat:4455, so the new test's expectation that private, agent and nameless rows contribute nothing holds. Older spokes omit the field, decode to0, and the sum is unaffected. The relaxed drop rule at:4469keeps a contributor whose only signal is abandoned PRs — matches #15799's scope.leaderboardForSpoke(src/cmd/hive/leaderboard_heartbeat.go:10) is a faithful extraction of the two identical copy loops it replaces inmain.go(:979heartbeat,:5606task-status push), plus the new field — both payload paths now carryabandoned, which is what the issue's acceptance asks for.LeaderboardForHub(src/pkg/dashboard/contribute_leaderboard.go:104) returns[]dashboard.LeaderboardEntry, so the extraction type-checks.
Not a duplicate of #15859 — sibling, and they compose cleanly. #15859 (Fixes #15796) and this PR (Fixes #15799) are the two sub-issues of #15782 split along the dashboard/hub seam. The only shared hunk is the Abandoned int \json:"abandoned"`struct line incontribute_leaderboard.go:20`, and it is byte-identical in both diffs, so either merge order is clean.
Sequencing note (not a defect): on this head nothing assigns dashboard.LeaderboardEntry.Abandoned — buildLeaderboardWithInputs (contribute_leaderboard.go:65) does not set it, and ContributorProfile on v5 has no Abandoned field yet. So until #15859 lands (it adds Abandoned: p.Abandoned at :69 plus the profile field) every spoke will send "abandoned": 0 and the hub will faithfully sum zeros. That is exactly what #15799 describes ("builds on the leaderboard abandoned field from #15796"), so this is fine to land first; just don't expect non-zero hub numbers until #15859 and the core writer in #15802 are in.
Minor: the new "Merged contributor leaderboard" section in src/docs/api-reference/hub-server.md was inserted above the "Part of the Dashboard REST API reference" preamble rather than below it like the other sections. Cosmetic only.
CI at this head: all test/coverage/changelog checks green; build (linux/arm64) still running at time of writing. Branch is 29 commits behind v5.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #15865 (adopted after CI went red and the contributor was unavailable; original commits by @mendezr preserved).
Fixes #15799
This branch is #15865's head
315d07a1a344as pushed by @mendezr (forkmendezr/hive), unchanged. Last lane reason on the original:fork-not-editable.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.