Skip to content

🐛 dashboard: align contributor presence counts and person IDs - #16228

Merged
clubanderson merged 6 commits into
v5from
fix/contributor-sidebar-person-ids
Nov 2, 2026
Merged

clubanderson merged 6 commits into
v5from
fix/contributor-sidebar-person-ids

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Summary

  • Refresh the Contributors cards, sidebar count, header and online tooltip from one /api/contributors response, not an independently cached /api/status pool.
  • Show deduplicated GitHub usernames only under one Online contributors heading; never expose associated relay IDs or repeat ClankeR on each line. Keep the legacy pool ID field available to existing API clients.
  • Ignore out-of-order responses, explicitly mark failed presence refreshes unavailable while preserving the last roster, and serialize empty rosters as arrays so deleting the final contributor clears the count.
  • Keep the freshest heartbeat across case variants of a login.

Review and validation

Independent pre-commit review identified an empty-roster regression; corrected it and added backend/frontend coverage. Added same-snapshot, person-only tooltip, multiple-session/login, stale-response, failed-refresh and zero-roster regressions. Regenerated the canonical dashboard asset and formatted Go changes. Repository policy is CI-only: no local test/build/lint suites were run. Fresh PR CI is the executable verdict.

No production deployment is included.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

hivecommons-hive Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the branch conflicts with the base and needs a rebase

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Looks correct to me. The diff does what the body says: one /api/contributors response now drives cards, sidebar pill, header and tooltip; the tooltip lists deduplicated logins instead of ClankeR IDs; online_ids stays on the wire for existing clients.

What I verified against the tree at 847e870:

  • contributorPoolStatus() (src/pkg/dashboard/api_contribute.go:124) derives Online/OnlineIDs/OnlineLogins from the same profiles[i].Online flags handleContributorsList just computed (contribute_admin.go:84), so the count, the pill and the card badges come from one snapshot — the stated goal. /api/status still gets its pool via BuildContributorPoolStatus() (server.go:2682), which now sets the same flags first, so the two endpoints agree.
  • onlineContributorIDs keeps the freshest heartbeat per lower-cased login (api_contribute.go:195-198); previously a later map iteration order could overwrite a newer timestamp with an older case-variant.
  • GET /api/contributors and GET /api/status are registered on the same mux with no per-route gate (api_contribute.go:340, server.go:1651), so moving the badge's source does not change who can see it.
  • Removing updateContributorBadge from the status refresh (refresh.js:557) is safe: fetchContributors is polled unconditionally from _deferredInit every CONTRIBUTOR_POLL_MS (10 s, shimmy-handlers.js:110, review-queue.js:480), so the pill keeps updating on every page. _contributorFetchID correctly drops stale responses on both the success and the error path.
  • go build ./pkg/dashboard/ on the head succeeds; node --test src/pkg/dashboard/nav_count_delta.test.js dashboard/test/config-tooltip.test.js → 29/29 pass. (go test is disabled on this host; the Go cases are left to CI.)

One note, not a blocker: the sidebar pill now first paints when the deferred init chain reaches fetchContributors, slightly later than the first /api/status render it used to piggy-back on. Fine for a 10 s poll, just a visible change in first-paint order.

build-contributor (linux/arm64, …) was FAILURE at the time of this review; I did not triage it.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson

Copy link
Copy Markdown
Member Author

Addressed the first CI findings: refreshed the 54 shifted API citations with the existing fixer and updated the dashboard tooltip contracts to assert usernames rather than the old relay IDs, preserving escaping/focus/hover/navigation coverage. Added failure-while-open portal coverage and made the fake DOM textContent setter reflect browser escaping so that assertion exercises the actual refresh path. Fresh exact-head CI is required; no checks bypassed.

@clubanderson

Copy link
Copy Markdown
Member Author

Current head 847e870 has all required contexts green, including native-queue-policy, build-and-test, coverage, lint and security checks; both server-tests and link/citation checks now pass. The remaining failed optional ARM contributor build is a dependency-download transport error: proxy.golang.org returned HTTP/2 INTERNAL_ERROR while downloading golang.org/x/text@v0.43.0 (job 125333169263), not a compiler error in this PR. No new author commit is justified for that failure. Preserve checks; retry the failed job when its parent workflow permits it.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against v5 plus the callers; looks correct to me. Each claim in the body checks out against the code:

  • Same snapshot. handleContributorsList now returns contributorPool built from the same profiles slice whose .Online it just computed (contribute_admin.go:84,103), and refresh.js no longer overwrites the badge from /api/status. fetchContributors is still started from _deferredInit and polled every CONTRIBUTOR_POLL_MS (10s) (shimmy-handlers.js:110), so the sidebar badge keeps refreshing without the Contributors section being open. Both routes hang off the same mux (api_contribute.go:340, server.go:1651), so no viewer-vs-admin access difference is introduced.
  • Back-compat. OnlineIDs/online_ids is retained and still populated (api_contribute.go:97,153); online_logins is additive. /api/status still calls BuildContributorPoolStatus() (server.go:2682), which now routes through the shared contributorPoolStatus.
  • Empty roster. profiles == nil → []ContributorProfile{} (contribute_admin.go:71) makes contributors serialize as [], which the new Array.isArray guard in fetchContributors requires — without it, deleting the last contributor would have hit the catch branch and shown "unavailable".
  • Stale responses. _contributorFetchID is compared after await res.json() and again in catch, so a slow earlier response cannot clobber a newer one.
  • Case-variant heartbeats. onlineContributorIDs now keeps the latest timestamp per lower-cased login (api_contribute.go:194-197) instead of last-map-iteration-wins.

node --test src/pkg/dashboard/nav_count_delta.test.js dashboard/test/config-tooltip.test.js → 29/29 pass at 847e870. Go tests are CI-only on this host; build-and-test and server-tests are green on this head. The arm64 image builds are still pending/re-running and are unrelated to this diff.

Not approving — that is a human's signature — but I have no findings.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@clubanderson

Copy link
Copy Markdown
Member Author

/approve

Owner-requested, agent-assisted decision under @clubanderson's explicit delegation for this batch; this is not a separate independent human review. Reviewed the current diff and surrounding source at the exact commit below.

Inspected head: abfb1a350c3db717858a685cff1e39bbf7f15214.

The production diff at the refreshed head remains byte-identical to the inspected canonical diff: roster/cards/badge share one presence snapshot; usernames are normalized/deduplicated without changing relay-count identity; failure marks presence unavailable and a stale response cannot overwrite a newer poll. Preserve escaping/focus/hover contracts and the author’s durable preparation ownership. Current refreshed head still has CI in progress; the older 847e870 green comment is NOT this head’s evidence. This approval direction does not mark preparation-ready, displace a train seat, or authorize merging pending checks.

This PR is authored by the stored account. I am not submitting an impossible native self-approval or pretending this is a separate human review. /approve, where present, records owner direction through Prow; an eligible reviewer still supplies the genuine lgtm/review path. No durable ownership, unrelated hold, CI gate or branch protection is removed. No local Hive suite/build/vet was run.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clubanderson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 2, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 2, 2026
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson

Copy link
Copy Markdown
Member Author

Resolved the actual v5 conflict and pushed DCO merge d57b915. Started from the latest remote PR head d975782, preserved intervening updates, reconciled the conflicting generated citation rows with upstream route documentation, and regenerated the canonical dashboard from static-src. The contributor presence behavior is unchanged: roster/cards/counts share one snapshot and tooltips list person logins only. Fresh exact-head CI is required; older-head green checks are not this commit’s proof. No empty commit, forced push, workflow/protection change or local test suite.

@clubanderson
clubanderson merged commit ae1ffdf into v5 Nov 2, 2026
85 of 86 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/contributor-sidebar-person-ids branch November 2, 2026 16:48
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant