[rocm-libraries] ROCm/rocm-libraries#7289 (commit e3fb4ee)

[CK] Fix smart build false positives from merged commits (#7289)

## Motivation
Current smart-build infrastructure triggers full build for almost every
PR which is draining our CI infrastructure. Need to update the test
selection logic based on diffs from the current workspace instead of
entire repo.

## Technical Details
Use three-dot syntax and scope BUILD_INFRA_PATTERN to composablekernel.

Changes:
- Switch from two-dot (..) to three-dot (...) in git diff
  - Three-dot shows only PR-specific changes
  - Excludes commits merged from develop (prevents false positives)
- Scope BUILD_INFRA_PATTERN to projects/composablekernel/ paths only
  - Avoids triggering on other projects (hipblas, hipdnn, etc.)
  - Only composablekernel build infra changes trigger full build
- Update both ci_safety_check.sh and validate_pr.sh

## Test Plan
Test with PR 7112 and 7223

## Test Result
Impact:
- PR 7112: Was 620 files (false positive) → Now 6 files (correct)
- PR 7223: Was full build (false positive) → Now selective build
(correct)

## Submission Checklist

- [ x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
This commit is contained in:
Yaswanth Raparti
2026-05-14 12:31:02 -07:00
committed by GitHub
parent 142ee00585
commit caeeaf9cbd
2 changed files with 20 additions and 21 deletions

View File

@@ -1,6 +1,9 @@
#!/bin/bash
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT
#
# Validate Smart Build vs Legacy Method for a PR
#
#
# This script compares smart build and legacy dependency analysis
# to ensure both methods produce the same test selection results.
@@ -189,7 +192,7 @@ git log --oneline -5
log_section "Step 3: Analyze Changed Files"
log_info "Files changed vs $BASE_BRANCH:"
CHANGED_FILES=$(git diff --name-only ${BASE_BRANCH}..HEAD -- projects/composablekernel)
CHANGED_FILES=$(git diff --name-only ${BASE_BRANCH}...HEAD -- projects/composablekernel)
NUM_FILES=$(echo "$CHANGED_FILES" | wc -l)
echo "$CHANGED_FILES" | head -20
if [ "$NUM_FILES" -gt 20 ]; then