Skip to content

bug(analytics): the code quality overview reads fields its endpoints don't return #20498

Closed

Description

@mrveiss

Found by code review of the first #20491 change. Read from the code; not run.

Problem

loadCodeQuality in autobot-frontend/src/composables/analytics/useDashboardLoaders.ts reads fields the backend does not put where it looks:

  • It reads healthData.health_score, but the handler in api/analytics_quality.py:1080-1090 returns overall and breakdown. The overall score falls back to the performance breakdown.
  • It reads debtData.total_debt_hours and total_items at the top level, but /api/debt/summary in api/analytics_debt.py nests its figures under summary. Technical debt is probably always 0.

The duplicate count had the same defect (total_count), and the #20491 change fixes that one.

Acceptance criteria

  • The overview score and technical debt show the values the endpoints return (test against the real response shapes).
  • A missing value shows as not available, not as 0.

Parent: #20491

Activity

  1. mrveiss commented on Nov 12, 2026

    @mrveiss
    OwnerAuthor

    Merged via #21397, in main as merge commit 650d062 (train #21398), 2026-11-12 ~21:30 Riga. Evidence read from origin/main.

    AC Status Evidence
    Overview score and debt show endpoint values, tested against real response shapes Delivered autobot-frontend/src/composables/analytics/codeQualityOverview.ts buildCodeQuality: score from health.overall, debt from debt.summary.total_hours; wired in useDashboardLoaders.ts. Tests: __tests__/codeQualityOverview.test.ts, useDashboardLoaders.codeQuality.test.ts ("populates the state from the endpoints' real response shapes").
    Missing value shows as not available, not 0 Delivered num() returns null for non-numbers; tests "reports missing values as null (not available), never 0", "keeps a real zero as 0", "every endpoint failing yields four nulls".

    UI rendering of "not available" and the live dashboard were not seen on the install (still pre-update, #21343); the ACs are test-based, so the issue stays closed.

  2. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21398, merge 650d06217f) via #21397

  3. added
    needs-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)
    on Nov 12, 2026
  4. mrveiss commented on Nov 12, 2026

    @mrveiss
    OwnerAuthor

    Closure evidence (acceptance criteria quoted verbatim)

    Closure evidence read from origin/main at 650d062. Gate 2 (check-issue-close-refs.sh) was not run in this read-only pass; instead a grep of origin/main for forward-tracking references (TODO / deferred to / tracked in / follow-up) naming this issue found none.

    Criterion Evidence on main Status
    "The overview score and technical debt show the values the endpoints return (test against the real response shapes)." autobot-frontend/src/composables/analytics/codeQualityOverview.ts:46 overall_score from health.overall, :49 technical_debt from debt.summary.total_hours; backend shapes match: autobot-backend/api/analytics_quality.py:871 returns "overall", analytics_debt.py:154-156 nests total_hours under "summary". Wired at useDashboardLoaders.ts:207 (buildCodeQuality). Tests __tests__/codeQualityOverview.test.ts:31 (score from overall), :36 (hours from summary.total_hours), :56 (total_items not used as hours); __tests__/useDashboardLoaders.codeQuality.test.ts:35 "populates the state from the endpoints' real response shapes". met
    "A missing value shows as not available, not as 0." codeQualityOverview.ts:30-31 num() returns null for a non-number; panels render null as not available: components/analytics/CodebaseOverviewPanel.vue:95 and :109, AnalyticsGrid.vue:88 and :102 (?? $t('...notAvailable')). Tests codeQualityOverview.test.ts:46 "reports missing values as null (not available), never 0", :40 "keeps a real zero as 0"; useDashboardLoaders.codeQuality.test.ts:55 "every endpoint failing yields four nulls, not zeros". met

    Merged: PR #21397 via train #21398, main 650d062.
    CI on train PR #21398: 89 SUCCESS, 8 SKIPPED (the aggregate/duplicate-named skipped jobs), 1 NEUTRAL (CodeRabbit), 1 IN_PROGRESS (post-merge "Post landing notes on referenced issues"). python-suite shards 1/8 to 8/8: SUCCESS; python-suite aggregate: SUCCESS; frontend-tests: SUCCESS.
    Nothing left unchecked. The rendered panel was not observed in a browser or on a running install; the not-available rendering is read from the templates above.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendneeds-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)phase:M4.11Safety net: tests and analysers reach the whole treepriority: medium

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions