← Back to Pull requests

XLAB Showing the "Your organization" badge #3703

Closed
unknown closed this pull request without merging on Oct 07, 2026 14:02 UTC
View on GitHub
unknown unknown commented on Oct 05, 2026 08:11 UTC
Author

Summary


AAP-94296 Showing the "Your organization" badge once organization-ownership data lands
<!-- What changed and why? -->
This pull request updates the way the user's organization is identified and flagged in the automation dashboard leaderboards. Instead of determining the user's organization row by matching ranks, the code now uses an explicit user_organization boolean property from the backend data. This change improves accuracy and clarity, especially in edge cases where the user's organization rank does not match any leaderboard row. The update is reflected across the data model, mapping logic, tests, and UI.

Data model and mapping updates:

Changed the LeaderboardItem interface and all related code to use isUserOrg instead of isCurrentOrg, and to rely on the user_organization boolean property from the backend data (useAutomationLeaderboardsView.ts, useAutomationLeaderboardsView.fixtures.ts, useAutomationLeaderboardsView.test.tsx, mapLeaderboardReport) [[1]](diffhunk://#diff-f4b109852b70c17942487ca07efeb4a5047392af79331dbe4b169edfe405ca98L58-R58) [[2]](diffhunk://#diff-f4b109852b70c17942487ca07efeb4a5047392af79331dbe4b169edfe405ca98R134-R135) [[3]](diffhunk://#diff-f4b109852b70c17942487ca07efeb4a5047392af79331dbe4b169edfe405ca98L285-R287) [[4]](diffhunk://#diff-f4b109852b70c17942487ca07efeb4a5047392af79331dbe4b169edfe405ca98L310-R310) [[5]](diffhunk://#diff-97808a7d1e937ab1484374df9ece2b7c503c44f64b1b3598fd579abcede44eb3L33-R35) [[6]](diffhunk://#diff-f552db2597f5996857e5f3b44c7c33e112f5c4e92ef28494ab1c35ac578292eaL81-R88) [[7]](diffhunk://#diff-f552db2597f5996857e5f3b44c7c33e112f5c4e92ef28494ab1c35ac578292eaL200-R233) [[8]](diffhunk://#diff-f552db2597f5996857e5f3b44c7c33e112f5c4e92ef28494ab1c35ac578292eaR246-R256).

UI and component changes:

Updated the highlights leaderboard panel to use isUserOrg for displaying the "Your organization" label, ensuring only the correct row is tagged (HighlightsLeaderboardPanel.tsx, HighlightsLeaderboardPanel.test.tsx) [[1]](diffhunk://#diff-d049f2d4a00db59b37e92ac5556cca2d11247ba27d444c06858ddd9a4636750fL53-R53) [[2]](diffhunk://#diff-023a494d6b565355da6d072cebc419e0c9141dab4ca635ce30ada46b774923e1L10-R10) [[3]](diffhunk://#diff-023a494d6b565355da6d072cebc419e0c9141dab4ca635ce30ada46b774923e1R62-R76).

Test and fixture improvements:

  • Modified fixtures and tests to set and check the new user_organization property, and to verify that only the explicitly flagged row is marked as the user's organization (useAutomationLeaderboardsView.fixtures.ts, useAutomationLeaderboardsView.test.tsx, HighlightsLeaderboardPanel.test.tsx, automation-dashboard.spec.ts) [[1]](diffhunk://#diff-97808a7d1e937ab1484374df9ece2b7c503c44f64b1b3598fd579abcede44eb3L33-R35) [[2]](diffhunk://#diff-f552db2597f5996857e5f3b44c7c33e112f5c4e92ef28494ab1c35ac578292eaL200-R233) [[3]](diffhunk://#diff-f552db2597f5996857e5f3b44c7c33e112f5c4e92ef28494ab1c35ac578292eaR246-R256) [[4]](diffhunk://#diff-023a494d6b565355da6d072cebc419e0c9141dab4ca635ce30ada46b774923e1R62-R76) [[5]](diffhunk://#diff-f593ec5911460e114cb29712d4e5b16dafa6380a0bf7c324cd73603162deb772L131-R132) [[6]](diffhunk://#diff-f593ec5911460e114cb29712d4e5b16dafa6380a0bf7c324cd73603162deb772R253-R264).
  • These changes make the leaderboard logic more robust and ensure the UI accurately reflects the user's organization based on backend data.

    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.
  • Dependencies

    <!-- List any dependent PRs, required backend changes, or manual setup steps. Remove this section if none. -->

    Testing

    Ephemeral E2E Tests

    Once PR is ready and preliminary checks pass, trigger tests by posting a comment /run-playwright on this PR.

    Tests run against a fresh AAP instance (version based on branch).

    External Server E2E Runs

    <!-- If applicable, attach run(s) from an external server using the GitHub Actions below. Mention the deployment type of the environment used.

  • [Run Playwright with Currents](../actions/workflows/run-playwright-currents.yml)

  • -->

    Manual Testing

    <!-- Steps to verify this change, if not obvious from the Jira issue. -->

    Screenshots

    <!-- If applicable. Any visual/UI changes MUST include before and after screenshots. -->
    <img width="1075" height="724" alt="image" src="https://github.com/user-attachments/assets/966fbbe0-f5f4-45a9-a055-815faceeb571" />

    <img width="1075" height="724" alt="image" src="https://github.com/user-attachments/assets/cf8c38b5-54c2-4ba6-85cf-c0f93a3331e3" />

    <img width="1075" height="724" alt="image" src="https://github.com/user-attachments/assets/403d17ee-a4c9-4b84-95b5-e2a84361c778" />

    <img width="1075" height="724" alt="image" src="https://github.com/user-attachments/assets/3d3c5f5e-50c9-46a1-be05-d1c51fdbaf1f" />

    <img width="1075" height="724" alt="image" src="https://github.com/user-attachments/assets/c0e15e6f-a55f-470f-a341-ecb1170958e5" />

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: h-kataria Review duration: 3230m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3703"
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 20.5% · Safe to merge
    20.5%