Skip to content

[architect] refactor: delete dead trust-tier render helpers (trustTierColor, trustTierBadgeCSS, rankDisplay in pkg/dashboard/api_contribute.go) - #6214

Open
kubestellar-hive[bot] wants to merge 1 commit into
v4from
arch/refactor-trusttier-render-helpers
Open

[architect] refactor: delete dead trust-tier render helpers (trustTierColor, trustTierBadgeCSS, rankDisplay in pkg/dashboard/api_contribute.go)#6214
kubestellar-hive[bot] wants to merge 1 commit into
v4from
arch/refactor-trusttier-render-helpers

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Refactor

Deletes three production-dead server-side leaderboard render helpers from src/pkg/dashboard/api_contribute.go:

  • trustTierColor — tier→hex colour map for badges
  • trustTierBadgeCSS — tier→Tailwind-style bg/text/border classes
  • rankDisplay — medal-emoji/rank HTML snippets

golang.org/x/tools/cmd/deadcode ./... at fe34da5 marks all three unreachable from every binary — leftovers from before leaderboard badges rendered client-side. Their styling tables can silently drift from the real client-side styling while coverage tests pin behavior no user can reach. Only callers were assertions in api_contribute_test.go and api_contribute_more_coverage_test.go (removed here). agentTierLabel and buildAgentLeaderboardEntries stay — both live.

Files claimed: src/pkg/dashboard/api_contribute.go, src/pkg/dashboard/api_contribute_test.go, src/pkg/dashboard/api_contribute_more_coverage_test.go, changelog.d/changed-6210-trusttier-render-helpers.md. Disjoint from open hold-gated PRs #6156 (api_leaderboard_style.go), #6132 (server.go constructors), and #6095 (contribute_ws.go) — different files and functions.

Verified: go vet ./pkg/dashboard/ passes; targeted go test ./pkg/dashboard/ -run 'TestCovK2|TestIsValidUsername|TestContributeLeaderboard' passes.

Fixes #6210


Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=architect backend=copilot model=claude-opus-4-6

…rColor, trustTierBadgeCSS, rankDisplay)

golang.org/x/tools/cmd/deadcode at fe34da5 marks all three helpers in
src/pkg/dashboard/api_contribute.go unreachable from every binary. They
are server-side HTML/CSS renderers for leaderboard badges, leftovers
from before the leaderboard rendered client-side; their tier→colour
tables and medal-emoji HTML can silently drift from real styling.
Only callers were assertions in api_contribute_test.go and
api_contribute_more_coverage_test.go, removed here. agentTierLabel and
buildAgentLeaderboardEntries stay (live).

Disjoint from PR #6156 (api_leaderboard_style.go) and PR #6095
(contribute_ws.go) — different files.

Fixes #6210

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
@kubestellar-hive kubestellar-hive Bot added the hold label Sep 7, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

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

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hold 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.

[architect] pkg/dashboard dead server-side leaderboard render helpers: trustTierColor, trustTierBadgeCSS, rankDisplay (api_contribute.go)

0 participants