Skip to content

Conversation

@wenju-he
Copy link
Contributor

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

ref_llvm should be 20 for ocl-open-200 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 references 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 branches following the 'ocl-open-XXX' naming scheme and uses it to construct appropriate release branch references.

Key Changes:

  • Added dynamic LLVM version parsing from branch names
  • Updated ref_llvm and ref_translator to use version-specific release branches
  • Added validation to fail early if branch naming scheme is not followed

💡 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 'ocl-open-\K\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.

The comment states 'Eg. 190 for LLVM 19' but the grep pattern \K\d+ would match '190' from 'ocl-open-190', not just '19'. The example should clarify this matches the full numeric suffix (e.g., '190' from 'ocl-open-190').

Suggested change
LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19
LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. matches '190' from 'ocl-open-190' (full numeric suffix)

Copilot uses AI. Check for mistakes.
Comment on lines 44 to 51
LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19
if [ -z "$LLVM_VERSION_LONG" ]; then
echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'"
exit 1
fi
LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19
echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT
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 variable name 'LLVM_VERSION_LONG' is misleading since it contains '190' (a 3-digit number), while 'LLVM_VERSION_SHORT' contains '19' (a 2-digit number). This logic will fail for LLVM versions 9 and below (e.g., 'ocl-open-90' would produce '9' after removing the last character, but version 100+ would work). Consider renaming to reflect that one contains the padded version and add validation for single-digit versions.

Suggested change
LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19
if [ -z "$LLVM_VERSION_LONG" ]; then
echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'"
exit 1
fi
LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19
echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT
# Extract the padded LLVM version (e.g., 190 for LLVM 19, 90 for LLVM 9, 200 for LLVM 20)
LLVM_VERSION_PADDED=$(echo "$BRANCH" | grep -oP 'ocl-open-\K\d+')
if [ -z "$LLVM_VERSION_PADDED" ]; then
echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'"
exit 1
fi
# Extract the actual LLVM version (e.g., 19 from 190, 9 from 90, 20 from 200)
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'"
exit 1
fi
echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT

Copilot uses AI. Check for mistakes.
@cdai2
Copy link
Contributor

cdai2 commented Nov 24, 2025

…task

update it to provide more detailed info?

@wenju-he wenju-he changed the title [CI] Fix ref_llvm and ref_translator in on-push-verification-in-tree … [CI] Fix ref_llvm and ref_translator in on-push-verification-in-tree task Nov 24, 2025
@wenju-he
Copy link
Contributor Author

…task

update it to provide more detailed info?

done

@wenju-he wenju-he merged commit c694388 into intel:ocl-open-200 Nov 24, 2025
4 checks passed
@wenju-he wenju-he deleted the github-workflows-on-push-verification-in-tree-llvm-version-200 branch November 24, 2025 01:50
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