← Back to Pull requests

Xlab Add Automation Analytics settings #3674

Closed
unknown closed this pull request without merging on Oct 01, 2026 17:04 UTC
View on GitHub
unknown unknown commented on Sep 30, 2026 11:20 UTC
Author

Summary


AAP-94298 Add Automation Analytics settings
AAP-94153 Updating front end for SHOW_GAMIFICATION → SHOW_LEADERBOARD

This pull request updates the Automation Analytics settings and dashboard code to replace the legacy show_gamification and min_collection_timestamp fields with the new show_leaderboard and last_sync fields, and adds comprehensive test coverage for the new Automation Analytics settings details and edit pages. It also ensures that only users with appropriate permissions can edit settings and that background polling errors do not disrupt the user interface.

Field Renaming and Data Model Updates:

Replaces all usage of the show_gamification field with show_leaderboard in both code and documentation, ensuring consistent terminology for the leaderboard feature. [[1]](diffhunk://#diff-6f4f55dd8574088afadae79d9faed42ebaebb4949ede2d43a07e8a453f566eb9L115-R115) [[2]](diffhunk://#diff-6f4f55dd8574088afadae79d9faed42ebaebb4949ede2d43a07e8a453f566eb9L290-R290) [[3]](diffhunk://#diff-c65a1d5f6f2fefcdb13db356b4040d44b5dedf58c30fec156435d274fe5d885aL56-R64) [[4]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL28-R30) [[5]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL132-R134) [[6]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL157-R159) [[7]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL175-R177)
Replaces min_collection_timestamp with last_sync for tracking the last sync time, updating interfaces, tests, and documentation accordingly. [[1]](diffhunk://#diff-c65a1d5f6f2fefcdb13db356b4040d44b5dedf58c30fec156435d274fe5d885aL56-R64) [[2]](diffhunk://#diff-6f4f55dd8574088afadae79d9faed42ebaebb4949ede2d43a07e8a453f566eb9L290-R290) [[3]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL28-R30) [[4]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL132-R134) [[5]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL157-R159) [[6]](diffhunk://#diff-e9942e0794401f2ef01e352fda86b38cce3153b6bb0d55bcb81f2c27d56a296dL175-R177)

New Settings Page Implementation:

Implements a new AutomationAnalyticsSettingsDetails page that displays the current leaderboard setting, only shows the Edit button to superusers or platform auditors, and handles loading and error states gracefully.
Implements a new AutomationAnalyticsSettingsEdit page with a form to enable/disable the leaderboard, validates permissions, and ensures that changes are reflected across all consumers immediately after saving.

Comprehensive Test Coverage:

Adds tests for the settings details page, covering display logic, edit permissions, navigation, popover help text, and error handling.
Adds tests for the settings edit page, covering form initialization, save/cancel behavior, background polling, error handling, and cache refresh for mounted consumers.
<!-- What changed and why? -->

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="1147" height="1787" alt="image" src="https://github.com/user-attachments/assets/5f65de87-e0cb-4783-9721-fefe44bea1c0" />

    <img width="1147" height="1787" alt="image" src="https://github.com/user-attachments/assets/e39165fe-682f-435f-81e4-92f7479602da" />

    <img width="1357" height="431" alt="image" src="https://github.com/user-attachments/assets/9b076517-1bfe-41da-8462-802bac77d47f" />

    Diff: 649 lines (+486 / -163) across 8 files Reviewer: lgalis Review duration: 1784m
    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 · 649 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 #3674"
    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%