← Back to Pull requests

feat(ci): add dynamic stage determination for external repos #7130

Closed
unknown closed this pull request without merging on Aug 07, 2026 15:07 UTC
View on GitHub
unknown unknown commented on Aug 05, 2026 18:05 UTC
Author

Enable external repos (rocm-libraries, rocm-systems) to dynamically determine which TheRock stages need rebuilding based on their changes.

Changes:

  • setup_multi_arch.yml: Add EXTERNAL_REPO env var and GITHUB_TOKEN for baseline run API calls. Use THEROCK_REPOSITORY for baseline selection.

  • configure_multi_arch_ci.py: Add GitContext.from_external_repo() to create context with repo name as changed file. Skip path filtering for external repos and apply stage reuse from TheRock baselines.

  • stage_reuse_decision.py: Use THEROCK_REPOSITORY for baseline run selection so external repos can query TheRock baselines.

  • configure_external_repo_ci.py: Update docstring and exclude workflow files from full test triggers.
  • How it works:
    1. External repo passes EXTERNAL_REPO JSON with repository name
    2. configure_multi_arch_ci.py extracts repo name (e.g., "rocm-libraries")
    3. Stage impact analysis maps repo name to affected stages (e.g., math-libs)
    4. Unaffected stages are candidates for reuse from TheRock baselines
    5. Commit-compatible baseline runs provide prebuilt artifacts

    Working here: https://github.com/ROCm/rocm-libraries/actions/runs/31032656859/job/92397575440?pr=10339#step:4:198 (however, no baseline as this is on a feature branch)

    Writing job summary:
    ### Stage reuse analysis
    
    - mode: `reuse-stage`
    - full rebuild required: `False`
    - baseline run checked: _none_
    - unaffected candidates: `comm-libs`, `compiler-runtime`, `dctools-core`, `debug-tools`, `media-libs`, `profiler-apps`, `runtime-tests`, `storage-libs`, `wsl-rocdxg`
    - available in baseline: _none_
    - applied: _none_
    - available per platform:
      - linux: _none_
      - windows: _none_
    

    ISSUE ID: https://github.com/ROCm/TheRock/issues/3343

    Diff: 219 lines (+164 / -55) across 2 files Reviewer: ammallya Review duration: 2701m
    All Vouch review confidence checks passed
    Residual risk 0.14 = 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 · 219 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.323
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7130"
    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.7% (MEDIUM) · Higher = larger blast radius
    36.7%
    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.5% · Safe to merge
    14.5%
    Repository