← Back to Pull requests

fix: project status link missing and inventory source last job status link malformed #3686

Open
unknown opened this pull request with 415 lines diff across 5 files
View on GitHub
unknown unknown commented on Oct 01, 2026 12:19 UTC
Author

Summary

Fixes — Two related bugs in the AAP UI where status links in list views are broken:

1. Inventory Source "Last Job Status" link is malformed with literal :id: The <Link> wrapper in useInventorySourceColumns.tsx was unconditionally rendered regardless of whether last_job existed in summary_fields. When last_job is undefined (e.g., inventory source has never been synced), summary_fields?.last_job?.id evaluates to undefined, leaving the :id route parameter unsubstituted. This produced URLs like /execution/jobs/inventory/:id/output.

Fix: Use StatusCell's built-in to and disableLinks props (matching useProjectStatusColumn pattern) with a lastJob?.id guard. When no last job id exists, to is undefined so the status renders as plain text without a link.

2. Project status link is missing: The useProjectStatusColumn.tsx could render a link with an invalid URL when summary_fields.current_job or last_job existed as objects but contained no valid id. This caused the getPageUrl call to produce a URL with literal :id, which rendered as a non-functional or missing link.

Fix: Extracted jobId variable and simplified the guard to return jobId ? (linked) : (unlinked).

Changes from previous PR #3537

Addresses all reviewer feedback from PR #3537:

  • Uses StatusCell.to / disableLinks instead of <Link> wrapper (matches useProjectStatusColumn pattern)

  • Threads options?.disableLinks through so confirmation/select dialogs suppress links

  • Adds options?.disableLinks to useMemo deps

  • Simplifies redundant (current_job || last_job) && jobId to just jobId

  • Collapses tooltip ternary to one line (Prettier compliance)

  • Adds colocated Vitest coverage for both hooks (8 test cases total)
  • Type of Change

  • Bug fix

  • Enhancement

  • Tests

  • Documentation

  • Other (please specify)
  • Risk Analysis - REQUIRED

  • High — Broad platform impact

  • Medium — Scoped but cross-cutting

  • Low — Narrowly scoped (single page fix, test-only additions)
  • Testing

    Automated Testing

  • useInventorySourceColumns.test.tsx — 4 test cases:

  • - last_job.id present → link href contains that id with job_type: inventory
    - no last_job → not a link
    - last_job object without id → not a link (the actual bug)
    - disableLinks: true → no link even when id exists

  • useProjectStatusColumn.test.tsx — 4 test cases:

  • - current_job.id present → link uses that id
    - only last_job.id → uses last job id
    - job object(s) without id → no link
    - neither job → unlinked status

    Manual Testing

    1. Navigate to Infrastructure → Inventories → [Inventory] → Sources
    2. Verify that synced inventory sources show a clickable status link pointing to /execution/jobs/inventory/<id>/output
    3. Verify that inventory sources that have never been synced show a status badge without a link
    4. Navigate to Resources → Projects
    5. Verify that synced projects show a clickable status link pointing to the correct job output page
    6. Verify that projects with no sync history show a status badge without a link

    ---

    Made with Cursor

    Diff: 415 lines (+311 / -104) across 5 files Reviewer: h-kataria Review duration: 20093m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 415 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.361
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #3686"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 44.9% (MEDIUM) · Higher = larger blast radius
    44.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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 23.9% · Safe to merge
    23.9%