Skip to content

Conversation

@wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Nov 23, 2025

ref_llvm should be 19 for ocl-open-190 branch.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the LLVM and translator reference branches in the on-push-verification-in-tree workflow by dynamically parsing the LLVM version from the branch name instead of hardcoding them to "main". The workflow now extracts the LLVM version from branch names following the 'ocl-open-XXX' scheme and constructs the appropriate reference branches for both LLVM and the translator.

Key changes:

  • Added dynamic LLVM version parsing from branch names
  • Updated ref_llvm to use release/<version>.x format instead of hardcoded "main"
  • Updated ref_translator to use llvm_release_<version>0 format instead of hardcoded "main"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

run: |
BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null
BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push
LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP '\d+') # Eg. 190 for LLVM 19
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no error handling if the branch name doesn't match the expected 'ocl-open-XXX' pattern. The grep command will silently fail and LLVM_VERSION_LONG will be empty, causing subsequent commands to produce incorrect results. Add validation to check if the pattern was found and fail with a clear error message if not, e.g., if [ -z \"$LLVM_VERSION_LONG\" ]; then echo \"Error: Could not parse LLVM version from branch name $BRANCH\"; exit 1; fi.

Suggested change
LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP '\d+') # Eg. 190 for LLVM 19
LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP '\d+') # Eg. 190 for LLVM 19
if [ -z "$LLVM_VERSION_LONG" ]; then
echo "Error: Could not parse LLVM version from branch name '$BRANCH'"
exit 1
fi

Copilot uses AI. Check for mistakes.
@wenju-he wenju-he requested a review from Copilot November 23, 2025 08:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +51 to +54
if [[ "$LLVM_VERSION_PADDED" =~ ^([0-9]+)0$ ]]; then
LLVM_VERSION_SHORT="${BASH_REMATCH[1]}"
else
echo "[OPENCL-CLANG] Error: Unexpected LLVM version format '$LLVM_VERSION_PADDED' from branch name '$BRANCH'"
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern ^([0-9]+)0$ assumes all LLVM versions end with a zero (e.g., 190 for LLVM 19), but this won't work correctly for versions like 100 (LLVM 10) which would be incorrectly parsed as LLVM 10 instead of LLVM 1. Consider validating that the version is at least two digits or adjusting the logic to handle single-digit major versions differently.

Suggested change
if [[ "$LLVM_VERSION_PADDED" =~ ^([0-9]+)0$ ]]; then
LLVM_VERSION_SHORT="${BASH_REMATCH[1]}"
else
echo "[OPENCL-CLANG] Error: Unexpected LLVM version format '$LLVM_VERSION_PADDED' from branch name '$BRANCH'"
# Accept only two- or three-digit numbers ending in zero (e.g., 190 for LLVM 19, 100 for LLVM 10)
if [[ "$LLVM_VERSION_PADDED" =~ ^([1-9][0-9]{1,2})0$ ]]; then
LLVM_VERSION_SHORT="${BASH_REMATCH[1]}"
else
echo "[OPENCL-CLANG] Error: Unexpected LLVM version format '$LLVM_VERSION_PADDED' from branch name '$BRANCH'. Expected a two- or three-digit number ending in zero (e.g., 190 for LLVM 19, 100 for LLVM 10)."

Copilot uses AI. Check for mistakes.
@wenju-he wenju-he merged commit 6537d42 into intel:ocl-open-190 Nov 24, 2025
4 checks passed
@wenju-he wenju-he deleted the github-workflows-on-push-verification-in-tree-llvm-version branch November 24, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants