← Back to Pull requests

[AAP-95471] Empty State Bug Fix #3691

Closed
unknown closed this pull request without merging on Oct 01, 2026 19:48 UTC
View on GitHub
unknown unknown commented on Oct 01, 2026 18:52 UTC
Author

https://redhat.atlassian.net/browse/AAP-95471

Summary


The Leaderboard had a bug, where if there's no data and we have a fresh instance, the Leaderboard tab would be in error state

Root Cause:
the admin user isn't in any organization, so the API returns org_streak: null and user_organization_rank: null. The mapping function assumed these would always be populated objects.

Type of Change

  • Bug fix

  • Enhancement

  • Tests

  • Documentation

  • Other (please specify)
  • Risk Analysis - REQUIRED

    <!-- SELECT ONE. This is required — the PR check will fail if none is selected. -->

  • High — Broad platform impact (e.g., SWR config, shared framework components, authentication, routing, API wrappers, build/bundler config). Changes affect multiple workspaces or could cause widespread regressions.

  • Medium — Scoped but cross-cutting (e.g., shared utility functions, changes to multiple pages within one workspace, component library updates, test infrastructure). Limited blast radius but touches common code paths.

  • Low — Narrowly scoped (e.g., single page fix, styling tweak, documentation, test-only changes, copy/string updates). Minimal risk of unintended side effects.
  • Screenshots


    Pre Fix console error:
    Uncaught TypeError: Cannot read properties of null (reading 'streak')
    at mapLeaderboardReport (useAutomationLeaderboardsView.ts:109:40)
    at useAutomationLeaderboardsView (useAutomationLeaderboardsView.ts:173:15)
    at AutomationLeaderboards (AutomationLeaderboards.tsx:148:69)

    Post fix:
    <img width="1036" height="468" alt="image" src="https://github.com/user-attachments/assets/c723fe9c-6698-408e-a6da-c1e6d1baf375" />

    <!-- If applicable. Any visual/UI changes MUST include before and after screenshots. -->

    Diff: 227 lines (+170 / -57) across 2 files Reviewer: lgalis Review duration: 56m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 227 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.325
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3691"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.9% (MEDIUM) · Higher = larger blast radius
    36.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.6% · Safe to merge
    14.6%