From 35a7659418ed967b53f2aa7cf81490528fc46e3d Mon Sep 17 00:00:00 2001 From: andrew clark Date: Wed, 4 Mar 2026 22:01:25 -0700 Subject: [PATCH] CI Skip Testing Fix (#5063) ## Motivation While testing the Skip CI functionality, it revealed a minor issue where the CI skip check fails when a branch is built at the exact commit where it diverged from develop. CI is still run by default if a failure is detected. When git log ..HEAD returns no files (because HEAD equals merge-base), the command grep -v '^$' exits with error code 1, causing the skip check to fail. ## Technical Details Added || true to the grep commands so empty output is handled gracefully instead of causing a script failure. ## Test Plan - Simulate the failures and ensure the grep failure is handled gracefully. ## Test Result - Simulated grep failures using an empty string. The script handles the error correctly. - Verified the CI skip functionality skips CI when non-relevant file changes are made. - Verified the CI skip functionality does not skip CI when relevant file changes are made. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5980d180d8..c435c078af 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -287,12 +287,12 @@ def shouldRunCICheck() { if [ "$CHANGE_ID" != "" ]; then # For PR builds, get all files touched in any commit echo "PR build detected, checking all touched files against origin/$CHANGE_TARGET" >&2 - git log --name-only --pretty=format: origin/$CHANGE_TARGET..HEAD -- projects/composablekernel/ | sort -u | grep -v '^$' + git log --name-only --pretty=format: origin/$CHANGE_TARGET..HEAD -- projects/composablekernel/ | sort -u | grep -v '^$' || true else # For feature branch builds, compare against merge-base with base branch MERGE_BASE=$(git merge-base HEAD origin/$BASE_BRANCH 2>/dev/null || echo "HEAD~1") echo "Branch build detected, checking all touched files since merge-base: $MERGE_BASE" >&2 - git log --name-only --pretty=format: $MERGE_BASE..HEAD -- projects/composablekernel/ | sort -u | grep -v '^$' + git log --name-only --pretty=format: $MERGE_BASE..HEAD -- projects/composablekernel/ | sort -u | grep -v '^$' || true fi ''' ).trim().split('\n')