← Back to Pull requests

feat: Add exact CI artifact inspection by ref and workflow run #7135

Closed
unknown closed this pull request without merging on Aug 12, 2026 17:13 UTC
View on GitHub
unknown unknown commented on Aug 05, 2026 23:42 UTC
Author

Summary


Related Issue: https://github.com/ROCm/TheRock/issues/3399
Based on suggestion here: https://github.com/ROCm/TheRock/pull/6760#pullrequestreview-4858406762

Improve the artifact lookup tools so they inspect concrete artifact archives instead of checking only whether an S3 index.html page exists.

The tools can now inspect artifacts from recent commits on a branch, an exact ref, or an explicit GitHub Actions workflow run ID. Results can be displayed in a human-readable format or emitted as JSON.

Motivation

The previous implementation checked whether the workflow run's S3 index page existed. The index could exist before the requested artifact group had been uploaded, causing the lookup to report artifacts as available when only early or generic artifacts were present.

                                            Before
                                            
                                            Commit / workflow run
                                                      |
                                                      v
                                               Does index.html exist?
                                                      |
                                                 +----+----+
                                                 |         |
                                                Yes        No
                                                 |         |
                                                 v         v
                                             Assume      No artifacts
                                             artifacts
                                             exist

The new implementation lists and validates the actual archives stored for the workflow run.

                                              After
                                              
                                              Branch / ref / run ID
                                                        |
                                                        v
                                               Find workflow run(s)
                                                        |
                                                        v
                                               List concrete S3 archives
                                                        |
                                                        v
                                               Match artifact group or GPU target
                                                        |
                                                        v
                                               Check optional required patterns
                                                        |
                                                        v
                                               Human-readable or JSON result

Changes

  • Replace the index.html availability check with S3Backend.list_artifacts().

  • Parse and report concrete artifact filenames.

  • Reject generic-only inventories for GPU-specific requests.

  • Expand AMDGPU families, such as matching gfx942 archives for a gfx94X-dcgpu request.

  • Add exact lookup through --ref and --run-id.

  • Add --require-single-run to require all requested groups to come from one workflow run.

  • Add --require-successful-run to accept only completed and successful runs.

  • Add --require-artifact REGEX to verify that specific archives are present.

  • Add structured output through --json.
  • Without required filename patterns, a successful result confirms that the requested artifact group is represented. It does not prove that every artifact required by a build stage is present.

    Relationship to artifact reuse

    This PR provides artifact discovery and validation. It does not download or reuse artifacts.

                                      This PR                         Follow-on work
                                      
                                      Find workflow run
                                              |
                                      List and validate archives
                                              |
                                      Return exact inventory
                                              |
                                              +---------------------> Download artifacts
                                                                      |
                                                                      v
                                                               Reuse a narrow build slice
                                                                      |
                                                                      v
                                                               Run downstream tests
    

    This supports follow-on experiments such as reusing ROCgdb artifacts for the debug-tools stage and reusing selected rocm-libraries slices before tackling a generalized artifact-reuse solution.

    Compatibility

    The existing branch-search behavior remains the default.

  • Workflow runs are checked newest-first.

  • Artifact groups may be found across multiple runs.

  • The newest matching run wins for each group.

  • Stricter behavior remains opt-in through --require-single-run and --require-successful-run.
  • Testing

    Added tests covering:

  • Concrete artifact listing.

  • Generic-only rejection for GPU groups.

  • AMDGPU family expansion and target matching.

  • .tar.xz artifact handling, including ASAN artifact names.

  • Required artifact filename patterns.

  • S3 lookup failure propagation.

  • Cross-run and single-run behavior.

  • Successful-run filtering.

  • Exact ref and workflow run ID lookup.

  • JSON stdout and stderr separation.
  • Unit tests

    python -m pytest \
      build_tools/tests/find_artifacts_for_commit_test.py \
      build_tools/tests/find_latest_artifacts_test.py \
      -vv
    

    All focused artifact lookup tests pass.

    Successful workflow-run inspection

    Also tested against live GitHub Actions and S3 data using an explicit workflow run:

    python build_tools/find_latest_artifacts.py \
      --run-id 30964030362 \
      --artifact-group gfx94X-dcgpu \
      --require-successful-run \
      --require-artifact '^rccl_lib_gfx942\.tar\.zst$' \
      --json
    

    The lookup:

  • Inspected an explicit completed and successful workflow run.

  • Matched concrete gfx942 archives for the requested gfx94X-dcgpu family.

  • Verified that rccl_lib_gfx942.tar.zst was present.

  • Returned the result as structured JSON.
  • <details>
    <summary>Show relevant output</summary>

    {
     "results": [
        {
          "amdgpu_targets": [],
          "artifact_filenames": [
            "amd-dbgapi_dbg_generic.tar.zst",
            "amd-dbgapi_dev_generic.tar.zst",
            "amd-dbgapi_doc_generic.tar.zst",
            "amd-dbgapi_lib_generic.tar.zst",
            "amd-llvm_dbg_generic.tar.zst",
            "amd-llvm_dev_generic.tar.zst",
            "amd-llvm_doc_generic.tar.zst",
            "amd-llvm_lib_generic.tar.zst",
            "amd-llvm_run_generic.tar.zst",
            "aqlprofile_dbg_generic.tar.zst",
            "aqlprofile_dev_generic.tar.zst",
            "aqlprofile_doc_generic.tar.zst",
            "aqlprofile_lib_generic.tar.zst",
            "aqlprofile_run_generic.tar.zst",
            "aqlprofile_test_generic.tar.zst",
            "base_dbg_generic.tar.zst",
            "base_dev_generic.tar.zst",
            "base_doc_generic.tar.zst",
            "base_lib_generic.tar.zst",
            "base_run_generic.tar.zst",
            "base_test_generic.tar.zst",
            "blas_dbg_generic.tar.zst",
            "blas_dev_generic.tar.zst",
            "blas_doc_generic.tar.zst",
            "blas_lib_generic.tar.zst",
            "blas_lib_gfx942.tar.zst",
            "blas_run_generic.tar.zst",
            "blas_test_generic.tar.zst",
            "blas_test_gfx942.tar.zst",
            "composable-kernel_dbg_generic.tar.zst",
            "composable-kernel_dev_generic.tar.zst",
            "composable-kernel_doc_generic.tar.zst",
            "composable-kernel_lib_generic.tar.zst",
            "core-amdsmi_dbg_generic.tar.zst",
            "core-amdsmi_dev_generic.tar.zst",
            "core-amdsmi_doc_generic.tar.zst",
            "core-amdsmi_lib_generic.tar.zst",
            "core-amdsmi_run_generic.tar.zst",
            "core-hip_dbg_generic.tar.zst",
            "core-hip_dev_generic.tar.zst",
            "core-hip_doc_generic.tar.zst",
            "core-hip_lib_generic.tar.zst",
            "core-hip_run_generic.tar.zst",
            "core-hiptests_test_generic.tar.zst",
            "core-kpack_dbg_generic.tar.zst",
            "core-kpack_dev_generic.tar.zst",
            "core-kpack_lib_generic.tar.zst",
            "core-ocl-icd_lib_generic.tar.zst",
            "core-ocl_dbg_generic.tar.zst",
            "core-ocl_dev_generic.tar.zst",
            "core-ocl_doc_generic.tar.zst",
            "core-ocl_lib_generic.tar.zst",
            "core-ocl_run_generic.tar.zst",
            "core-ocl_test_generic.tar.zst",
            "core-runtime_dbg_generic.tar.zst",
            "core-runtime_dev_generic.tar.zst",
            "core-runtime_doc_generic.tar.zst",
            "core-runtime_lib_generic.tar.zst",
            "core-runtime_run_generic.tar.zst",
            "elfio_dev_generic.tar.zst",
            "elfio_doc_generic.tar.zst",
            "elfio_lib_generic.tar.zst",
            "fft_dbg_generic.tar.zst",
            "fft_dev_generic.tar.zst",
            "fft_doc_generic.tar.zst",
            "fft_lib_generic.tar.zst",
            "fft_lib_gfx942.tar.zst",
            "fft_run_generic.tar.zst",
            "fft_test_generic.tar.zst",
            "fft_test_gfx942.tar.zst",
            "fftw3_dbg_generic.tar.zst",
            "fftw3_dev_generic.tar.zst",
            "fftw3_doc_generic.tar.zst",
            "fftw3_lib_generic.tar.zst",
            "fftw3_run_generic.tar.zst",
            "flatbuffers_dev_generic.tar.zst",
            "hipblasltprovider_dbg_generic.tar.zst",
            "hipblasltprovider_lib_generic.tar.zst",
            "hipblasltprovider_test_generic.tar.zst",
            "hipdnn-integration-tests_dbg_generic.tar.zst",
            "hipdnn-integration-tests_run_generic.tar.zst",
            "hipdnn-integration-tests_test_generic.tar.zst",
            "hipdnn-samples_test_generic.tar.zst",
            "hipdnn_dbg_generic.tar.zst",
            "hipdnn_dev_generic.tar.zst",
            "hipdnn_doc_generic.tar.zst",
            "hipdnn_lib_generic.tar.zst",
            "hipdnn_run_generic.tar.zst",
            "hipdnn_test_generic.tar.zst",
            "hipfile_dbg_generic.tar.zst",
            "hipfile_dev_generic.tar.zst",
            "hipfile_doc_generic.tar.zst",
            "hipfile_lib_generic.tar.zst",
            "hipfile_run_generic.tar.zst",
            "hipfile_test_generic.tar.zst",
            "hipify_dbg_generic.tar.zst",
            "hipify_run_generic.tar.zst",
            "hipkernelprovider_dbg_generic.tar.zst",
            "hipkernelprovider_lib_generic.tar.zst",
            "hipkernelprovider_test_generic.tar.zst",
            "hiptensor_dbg_generic.tar.zst",
            "hiptensor_dev_generic.tar.zst",
            "hiptensor_lib_generic.tar.zst",
            "hiptensor_lib_gfx942.tar.zst",
            "hiptensor_test_generic.tar.zst",
            "hiptensor_test_gfx942.tar.zst",
            "hipthreads_dev_generic.tar.zst",
            "hipthreads_test_generic.tar.zst",
            "host-blas_dbg_generic.tar.zst",
            "host-blas_dev_generic.tar.zst",
            "host-blas_doc_generic.tar.zst",
            "host-blas_lib_generic.tar.zst",
            "host-blas_run_generic.tar.zst",
            "host-suite-sparse_dbg_generic.tar.zst",
            "host-suite-sparse_dev_generic.tar.zst",
            "host-suite-sparse_doc_generic.tar.zst",
            "host-suite-sparse_lib_generic.tar.zst",
            "host-suite-sparse_run_generic.tar.zst",
            "libhipcxx_dbg_generic.tar.zst",
            "libhipcxx_dev_generic.tar.zst",
            "libhipcxx_lib_generic.tar.zst",
            "libhipcxx_test_generic.tar.zst",
            "miopen_dbg_generic.tar.zst",
            "miopen_dev_generic.tar.zst",
            "miopen_doc_generic.tar.zst",
            "miopen_lib_generic.tar.zst",
            "miopen_lib_gfx942.tar.zst",
            "miopen_run_generic.tar.zst",
            "miopen_test_generic.tar.zst",
            "miopenprovider_dbg_generic.tar.zst",
            "miopenprovider_lib_generic.tar.zst",
            "miopenprovider_test_generic.tar.zst",
            "mirage_dbg_generic.tar.zst",
            "mirage_dev_generic.tar.zst",
            "mirage_run_generic.tar.zst",
            "nlohmann-json_dev_generic.tar.zst",
            "prim_dbg_generic.tar.zst",
            "prim_dev_generic.tar.zst",
            "prim_doc_generic.tar.zst",
            "prim_test_generic.tar.zst",
            "prim_test_gfx942.tar.zst",
            "rand_dbg_generic.tar.zst",
            "rand_dev_generic.tar.zst",
            "rand_doc_generic.tar.zst",
            "rand_lib_generic.tar.zst",
            "rand_lib_gfx942.tar.zst",
            "rand_run_generic.tar.zst",
            "rand_test_generic.tar.zst",
            "rand_test_gfx942.tar.zst",
            "rccl_dbg_generic.tar.zst",
            "rccl_dev_generic.tar.zst",
            "rccl_doc_generic.tar.zst",
            "rccl_lib_generic.tar.zst",
            "rccl_lib_gfx942.tar.zst",
            "rccl_run_generic.tar.zst",
            "rccl_test_generic.tar.zst",
            "rccl_test_gfx942.tar.zst",
            "rdc_dbg_generic.tar.zst",
            "rdc_dev_generic.tar.zst",
            "rdc_doc_generic.tar.zst",
            "rdc_lib_generic.tar.zst",
            "rdc_run_generic.tar.zst",
            "rdc_test_generic.tar.zst",
            "rocalution_dbg_generic.tar.zst",
            "rocalution_dev_generic.tar.zst",
            "rocalution_lib_generic.tar.zst",
            "rocalution_lib_gfx942.tar.zst",
            "rocalution_test_generic.tar.zst",
            "rocdecode_dbg_generic.tar.zst",
            "rocdecode_dev_generic.tar.zst",
            "rocdecode_doc_generic.tar.zst",
            "rocdecode_lib_generic.tar.zst",
            "rocdecode_test_generic.tar.zst",
            "rocgdb_dbg_generic.tar.zst",
            "rocgdb_dev_generic.tar.zst",
            "rocgdb_doc_generic.tar.zst",
            "rocgdb_lib_generic.tar.zst",
            "rocgdb_run_generic.tar.zst",
            "rocgdb_test_generic.tar.zst",
            "rocjitsu-hotswap_lib_generic.tar.zst",
            "rocjitsu_dbg_generic.tar.zst",
            "rocjitsu_dev_generic.tar.zst",
            "rocjitsu_lib_generic.tar.zst",
            "rocjitsu_run_generic.tar.zst",
            "rocjpeg_dbg_generic.tar.zst",
            "rocjpeg_dev_generic.tar.zst",
            "rocjpeg_doc_generic.tar.zst",
            "rocjpeg_lib_generic.tar.zst",
            "rocjpeg_test_generic.tar.zst",
            "rocprofiler-compute_dbg_generic.tar.zst",
            "rocprofiler-compute_dev_generic.tar.zst",
            "rocprofiler-compute_doc_generic.tar.zst",
            "rocprofiler-compute_lib_generic.tar.zst",
            "rocprofiler-compute_run_generic.tar.zst",
            "rocprofiler-compute_test_generic.tar.zst",
            "rocprofiler-sdk_dbg_generic.tar.zst",
            "rocprofiler-sdk_dev_generic.tar.zst",
            "rocprofiler-sdk_doc_generic.tar.zst",
            "rocprofiler-sdk_lib_generic.tar.zst",
            "rocprofiler-sdk_run_generic.tar.zst",
            "rocprofiler-sdk_test_generic.tar.zst",
            "rocprofiler-systems-examples_test_generic.tar.zst",
            "rocprofiler-systems_dbg_generic.tar.zst",
            "rocprofiler-systems_dev_generic.tar.zst",
            "rocprofiler-systems_doc_generic.tar.zst",
            "rocprofiler-systems_lib_generic.tar.zst",
            "rocprofiler-systems_run_generic.tar.zst",
            "rocprofiler-systems_test_generic.tar.zst",
            "rocr-debug-agent-tests_doc_generic.tar.zst",
            "rocr-debug-agent-tests_test_generic.tar.zst",
            "rocr-debug-agent_dbg_generic.tar.zst",
            "rocr-debug-agent_dev_generic.tar.zst",
            "rocr-debug-agent_doc_generic.tar.zst",
            "rocr-debug-agent_lib_generic.tar.zst",
            "rocrtst_dbg_generic.tar.zst",
            "rocrtst_dev_generic.tar.zst",
            "rocrtst_doc_generic.tar.zst",
            "rocrtst_lib_generic.tar.zst",
            "rocrtst_run_generic.tar.zst",
            "rocrtst_test_generic.tar.zst",
            "rocshmem_dbg_generic.tar.zst",
            "rocshmem_dev_generic.tar.zst",
            "rocshmem_doc_generic.tar.zst",
            "rocshmem_lib_generic.tar.zst",
            "rocshmem_run_generic.tar.zst",
            "rocshmem_test_generic.tar.zst",
            "rocwmma_dbg_generic.tar.zst",
            "rocwmma_dev_generic.tar.zst",
            "rocwmma_lib_generic.tar.zst",
            "rocwmma_test_generic.tar.zst",
            "rocwmma_test_gfx942.tar.zst",
            "rpp_dbg_generic.tar.zst",
            "rpp_dev_generic.tar.zst",
            "rpp_doc_generic.tar.zst",
            "rpp_lib_generic.tar.zst",
            "rpp_test_generic.tar.zst",
            "support_dev_generic.tar.zst",
            "support_doc_generic.tar.zst",
            "sysdeps-amd-mesa_dev_generic.tar.zst",
            "sysdeps-amd-mesa_lib_generic.tar.zst",
            "sysdeps-expat_dev_generic.tar.zst",
            "sysdeps-expat_doc_generic.tar.zst",
            "sysdeps-expat_lib_generic.tar.zst",
            "sysdeps-gmp_dev_generic.tar.zst",
            "sysdeps-gmp_doc_generic.tar.zst",
            "sysdeps-gmp_lib_generic.tar.zst",
            "sysdeps-hwloc_dev_generic.tar.zst",
            "sysdeps-hwloc_doc_generic.tar.zst",
            "sysdeps-hwloc_lib_generic.tar.zst",
            "sysdeps-libpciaccess_dev_generic.tar.zst",
            "sysdeps-libpciaccess_lib_generic.tar.zst",
            "sysdeps-mpfr_dev_generic.tar.zst",
            "sysdeps-mpfr_doc_generic.tar.zst",
            "sysdeps-mpfr_lib_generic.tar.zst",
            "sysdeps-ncurses_dev_generic.tar.zst",
            "sysdeps-ncurses_doc_generic.tar.zst",
            "sysdeps-ncurses_lib_generic.tar.zst",
            "sysdeps-util-linux_dev_generic.tar.zst",
            "sysdeps-util-linux_lib_generic.tar.zst",
            "sysdeps_dev_generic.tar.zst",
            "sysdeps_doc_generic.tar.zst",
            "sysdeps_lib_generic.tar.zst",
            "sysdeps_run_generic.tar.zst",
            "wsl-rocdxg_dev_generic.tar.zst",
            "wsl-rocdxg_doc_generic.tar.zst",
            "wsl-rocdxg_lib_generic.tar.zst"
          ],
          "artifact_group": "gfx94X-dcgpu",
          "external_repo": "",
          "git_commit_sha": "b21aac868f2550b5cbe93af7c62795737301fa6d",
          "git_commit_url": "https://github.com/ROCm/TheRock/commit/b21aac868f2550b5cbe93af7c62795737301fa6d",
          "github_repository_name": "ROCm/TheRock",
          "missing_required_artifact_patterns": [],
          "platform": "linux",
          "required_artifact_patterns": [
            "^rccl_lib_gfx942\\.tar\\.zst$"
          ],
          "s3_bucket": "therock-ci-artifacts",
          "s3_index_url": "https://therock-ci-artifacts.s3.amazonaws.com/30964030362-linux/index.html",
          "s3_path": "30964030362-linux/",
          "s3_uri": "s3://therock-ci-artifacts/30964030362-linux/",
          "workflow_file_name": "multi_arch_ci.yml",
          "workflow_run_attempt": 2,
          "workflow_run_conclusion": "success",
          "workflow_run_html_url": "https://github.com/ROCm/TheRock/actions/runs/30964030362",
          "workflow_run_id": "30964030362",
          "workflow_run_status": "completed"
        }
      ],
      "status": "found"
    }
    

    </details>
    The returned artifact inventory included:

    rccl_lib_gfx942.tar.zst
    

    Explicit workflow-run rejection

    python build_tools/find_latest_artifacts.py \
      --run-id 31020094633 \
      --artifact-group gfx94X-dcgpu \
      --require-successful-run
    

    No matching artifacts were returned because the selected workflow run did not satisfy the completed-and-successful requirement.

    <details>
    <summary>Show command output</summary>

    No matching artifacts found for workflow run 31020094633
    

    </details>

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: ammallya Review duration: 9691m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). 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%
    56%
    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 #7135"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 22.5% · Safe to merge
    22.5%
    Repository