XLAB Showing the "Your organization" badge #3703
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
h-kataria
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_organizationboolean 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
LeaderboardIteminterface and all related code to useisUserOrginstead ofisCurrentOrg, and to rely on theuser_organizationboolean 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
isUserOrgfor 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:
user_organizationproperty, 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
Risk Analysis - REQUIRED
<!-- SELECT ONE. This is required — the PR check will fail if none is selected. -->
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-playwrighton this PR.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.
-->
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" />