Repository navigation
✨ feature: show abandoned counts on contributor cards and status - #15877
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
|
b56a80f to
14bd86a
Compare
|
hive/awaiting-ci: rebased onto v5 (conflict was api-reference citation line drift in 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Intent-alignment re-review (read at current head feedd4e9, dispatched for 19abb4eb; delta since 14bd86a4 is a rebase onto v5 plus docs-citation refreshes and the CSS-class commit).
Badge test now contradicts the badge markup (in-scope, will fail CI). Commit feedd4e9 moved the badge colour from an inline style to .contrib-abandoned { color: var(--status-error) } — src/pkg/dashboard/static-src/js/contributors.js:284 now emits <span class="contrib-abandoned" title=…> with no style attribute. But src/pkg/dashboard/contributor_abandoned_badge_test.go:30 still asserts badge.includes('color-mix(in srgb, var(--red) 70%, var(--muted))') ("muted red missing"). The node-backed render in that test (exec.Command(node, "-e", js), line 40) therefore throws on every runner with node on PATH (v2-ci sets up node before the Go tests, .github/workflows/v2-ci.yml:856). Fix: assert on class="contrib-abandoned" (or that the CSS rule exists in index.html) instead of the removed inline value. Note the issue (#15795) asks for "muted red"; var(--status-error) is the full error red — if the muted tone matters, mix it in the CSS rule rather than reintroducing the inline style.
Previous finding — contribute_abandoned.go duplicates #15802's type and ContributorProfile fields: still present. #15802 is still open; the ContributorAbandonRecord struct in src/pkg/dashboard/contribute_abandoned.go:6-12 and the Abandoned/AbandonedPRs fields in contribute_profiles.go:196-197 are byte-identical to #15802's. Whichever lands second must drop its copy; since this PR has no producer, it is the one that should shed the stub at that point. Sequencing only — not blocking on its own.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (security, delta 14bd86a→19abb4e) — no blocking findings.
Advisory (low): ContributorPoolStatus.AbandonedByLogin (src/pkg/dashboard/api_contribute.go:103) is attached to StatusPayload.ContributorPool (server.go:655, set at server.go:2673), and s.status is served raw by the public /api/snapshot (api_snapshot.go:17-34, isPublicPath /api/snapshot prefix) when Hub.AutoSnapshot is on. This is the first GitHub-login-keyed data in that payload (by_role had none), so operators with public snapshots now publish per-login adoption counts unauthenticated. Logins are already public via /api/leaderboard, so exposure is minor; if undesired, drop AbandonedByLogin from the snapshot copy or move it to /api/contributors only.
Tooltip/badge rendering is safe: contributors.js:283-284 passes the whole tooltip through esc() (quotes, backticks, newlines escaped — debug-logs.js:474-484) and count is coerced via Number(); the test at contributor_abandoned_badge_test.go:42-44 exercises the attribute-breakout case.
Prior intent-alignment note (contribute_abandoned.go duplicating #15802) is unchanged at this head — the file is still a new file against v5.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Correctness (delta re-review) — read at dispatched head 19abb4eb and the PR's current head feedd4e9 (pushed after dispatch).
Stale test assertion breaks TestContributorAbandonedBadge at feedd4e9. Commit feedd4e9 ("style abandoned badge via CSS class") removed the inline style: src/pkg/dashboard/static-src/js/contributors.js:284 and src/pkg/dashboard/static/index.html:40968 now emit <span class="contrib-abandoned" title=…> with the colour in .contrib-abandoned { color: var(--status-error) } (sparklines-indicators.css:29). But src/pkg/dashboard/contributor_abandoned_badge_test.go:30 still asserts badge.includes('color-mix(in srgb, var(--red) 70%, var(--muted))'). The test executes the function under node (LookPath("node"), line 15) and build-and-test installs node (.github/workflows/v2-ci.yml:856), so this test fails in CI; where node is absent it silently skips. Fix: drop that assertion or assert class="contrib-abandoned" instead (the CSS already carries the colour).
Prior intent-alignment note (duplicate contribute_abandoned.go / ContributorProfile.Abandoned* fields vs #15802) is still present — #15802 is still open on v5, so whichever lands second will fail to compile with duplicate declarations; nothing in this PR writes Abandoned, so counts are always 0 until #15802 merges.
— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Expose historical totals and lowercase per-login counts in contributorPool, render recent adoption details on contributor cards, and document counting semantics. Reuse the minimal profile schema from pending #15802; adoption recording remains owned by that PR. Hive-Run: #15795 Hive-Plan: contributor-abandoned-status Hive-Spec: #15795#acceptance Signed-off-by: mendezr <mendezr@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
TestStyleRatchet counts style= attributes in static/index.html; the new contributor abandoned badge added one inline style. Move the colour to a .contrib-abandoned rule in static-src CSS and regenerate index.html. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
822358f to
6db6ed2
Compare
|
hive/awaiting-ci: rebased onto v5 after #15802 and #15894 landed (dropped this branch's stub 🐝 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 v5 at 99afcd2 (merge-base), plus contribute_admin.go and contribute_profiles.go. Looks correct to me.
handleContributorsList(contribute_admin.go:69-98) returns the fullContributorProfile, soabandonedandabandoned_prs(contribute_profiles.go:196-197) reachcontributorAbandonedBadge(c)without an API change; the badge tooltip goes throughesc()and the test covers attribute-breaking input.contributorAbandonedCounts(api_contribute.go:132) reads the persisted counter and includes revoked profiles, while the leaderboard excludes revoked contributors (contribute_leaderboard.go:51). That difference is stated in the code comment and the openapi description ("include offline and revoked profiles"), so I read it as intended, not a bug — noting it only so a maintainer is not surprised whencontributorPool.abandonedexceeds the leaderboard sum.- Not a duplicate of #15895: that PR adds the leaderboard column; this adds pool-status counters and the card badge. The two heads'
contributors.js/index.htmlhunks merge cleanly (git merge-treeconflicts only on theContributorProfile.Abandonedline #15895 still carries from before #15802), so both can land.
— 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) and the current head 6db6ed2. Looks correct to me.
src/pkg/dashboard/api_contribute.go—contributorAbandonedCountsreadsp.Abandonedstraight from the persisted profiles, so revoked/offline contributors are counted (the issue's "presence does not filter historical cost"). Login key is lower-cased + trimmed; the" Alice "/"ALICE"merge inTestContributorAbandonedCountscovers that. Nil-hub path is fine:BuildContributorPoolStatusalready guardss.contributeHub != niland the new call sits outside that block.static-src/js/contributors.jscontributorAbandonedBadge— field names in the tooltip (repo,pr,adopted_into_pr,reason,at) match the JSON tags onContributorAbandonRecord(src/pkg/dashboard/contribute_abandoned.go:16-22);abandoned_prsisomitemptyon the profile and the badge tolerates its absence.esc()is already in scope in that file;--status-erroris defined instatic/tokens.css:70/230.index.htmlmirrors thestatic-srcedits.
The api-reference/*.md churn is citation line-number drift from editing api_contribute.go, not content change.
Note: the conflicts-with-open-pr label is #15895's stale re-add of ContributorProfile.Abandoned (already on v5); it clears once #15895 is rebased. No conflict in this PR's own hunks.
— 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 |
Carry the new 'Abandoned contributor PRs' section (#15877) into operator-reference/README.md and index it from the stub page. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Supersedes #15863 (adopted after CI went red and the contributor was unavailable; original commits by @mendezr preserved).
Fixes #15795
This branch is #15863's head
b56a80f282b9as pushed by @mendezr (forkmendezr/hive), unchanged. Last lane reason on the original:conflicting.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.