Skip to content

Commit 722f45e

Browse files
ckhordiasmaclaude
andcommitted
add rhoai_version input and decouple version from branch name
Add workflow_dispatch input to both bundle workflows so RHOAI version can be provided explicitly. When omitted, it's derived from the branch name (must match rhoai-X.Y or rhoai-X.Y-ea.Z). This allows running the workflows from non-release branches for testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9c6a87e commit 722f45e

2 files changed

Lines changed: 42 additions & 12 deletions

File tree

.github/workflows/process-operator-bundle.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Process Operator Bundle
22
run-name: Process Operator Bundle
33
on:
44
workflow_dispatch:
5+
inputs:
6+
rhoai_version:
7+
description: 'RHOAI version to process (e.g. rhoai-3.5, rhoai-3.5-ea.2). Branch name used if omitted.'
8+
required: false
9+
type: string
510
push:
611
paths:
712
- bundle/additional-images-patch.yaml
@@ -32,11 +37,21 @@ jobs:
3237
# defined here: https://github.com/red-hat-data-services/devops-images/tree/main/builds
3338
image: quay.io/rhoai-devops/olm-runner:latest
3439
steps:
35-
- name: Get Current branch name
40+
- name: Resolve branch and RHOAI version
3641
shell: bash
37-
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
42+
run: |
43+
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
44+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
45+
46+
VERSION_SOURCE="${{ inputs.rhoai_version || github.head_ref || github.ref_name }}"
47+
VERSION_SOURCE="${VERSION_SOURCE#rhoai-}"
48+
if ! [[ "$VERSION_SOURCE" =~ ^([0-9]+\.[0-9]+(-ea\.[0-9]+)?)$ ]]; then
49+
echo "::error::Cannot resolve RHOAI version from '$VERSION_SOURCE'. Provide rhoai_version input (e.g. rhoai-3.5)."
50+
exit 1
51+
fi
52+
echo "rhoai_version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
3853
id: get_branch
39-
- name: Git checkout RBC release
54+
- name: Git checkout
4055
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
4156
with:
4257
ref: ${{ steps.get_branch.outputs.branch }}
@@ -54,6 +69,7 @@ jobs:
5469
- name: Process Operator Bundle
5570
env:
5671
BRANCH: ${{ steps.get_branch.outputs.branch }}
72+
RHOAI_VERSION: ${{ steps.get_branch.outputs.rhoai_version }}
5773
OC_TOKEN: ${{ secrets.KONFLUX_INTERNAL_OC_TOKEN }}
5874
CLUSTER: p02
5975
RHOAI_QUAY_API_TOKEN: ${{ secrets.RHOAI_QUAY_API_TOKEN }}
@@ -66,8 +82,7 @@ jobs:
6682
run: |
6783
#Declare basic variables
6884
OPENSHIFT_VERSION=v4.13
69-
RHOAI_VERSION=v${BRANCH/rhoai-/}
70-
COMPONENT_SUFFIX=${RHOAI_VERSION//./-}
85+
COMPONENT_SUFFIX=v${RHOAI_VERSION//./-}
7186
OPERATOR_BUNDLE_COMPONENT_NAME=odh-operator-bundle-${COMPONENT_SUFFIX}
7287
XKS_HELM_CHART_COMPONENT_NAME=rhai-on-xks-chart-${COMPONENT_SUFFIX}
7388
OPENSHIFT_HELM_CHART_COMPONENT_NAME=rhai-on-openshift-chart-${COMPONENT_SUFFIX}
@@ -107,7 +122,7 @@ jobs:
107122
-c ${BUNDLE_CSV_PATH} \
108123
-p ${PATCH_YAML_PATH} \
109124
-o ${OUTPUT_FILE_PATH} \
110-
-v ${BRANCH} \
125+
-v rhoai-${RHOAI_VERSION} \
111126
-a ${ANNOTATION_YAML_PATH} \
112127
-xhp ${XKS_HELM_PATCH_YAML_PATH} \
113128
-xhv ${XKS_HELM_VALUES_YAML_PATH} \

.github/workflows/trigger-nightly-bundle-build.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Trigger Nightly Bundle Build
22
run-name: Trigger Nightly Bundle Build
33
on:
44
workflow_dispatch:
5+
inputs:
6+
rhoai_version:
7+
description: 'RHOAI version to process (e.g. rhoai-3.5, rhoai-3.5-ea.2). Branch name used if omitted.'
8+
required: false
9+
type: string
510
push:
611
paths:
712
- schedule/bundle-github-trigger.txt
@@ -25,11 +30,21 @@ jobs:
2530
# defined here: https://github.com/red-hat-data-services/devops-images/tree/main/builds
2631
image: quay.io/rhoai-devops/olm-runner:latest
2732
steps:
28-
- name: Get Current branch name
33+
- name: Resolve branch and RHOAI version
2934
shell: bash
30-
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
35+
run: |
36+
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
37+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
38+
39+
VERSION_SOURCE="${{ inputs.rhoai_version || github.head_ref || github.ref_name }}"
40+
VERSION_SOURCE="${VERSION_SOURCE#rhoai-}"
41+
if ! [[ "$VERSION_SOURCE" =~ ^([0-9]+\.[0-9]+(-ea\.[0-9]+)?)$ ]]; then
42+
echo "::error::Cannot resolve RHOAI version from '$VERSION_SOURCE'. Provide rhoai_version input (e.g. rhoai-3.5)."
43+
exit 1
44+
fi
45+
echo "rhoai_version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
3146
id: get_branch
32-
- name: Git checkout RBC release
47+
- name: Git checkout
3348
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3449
with:
3550
ref: ${{ steps.get_branch.outputs.branch }}
@@ -47,6 +62,7 @@ jobs:
4762
- name: Process Operator Bundle
4863
env:
4964
BRANCH: ${{ steps.get_branch.outputs.branch }}
65+
RHOAI_VERSION: ${{ steps.get_branch.outputs.rhoai_version }}
5066
OC_TOKEN: ${{ secrets.KONFLUX_INTERNAL_OC_TOKEN }}
5167
CLUSTER: p02
5268
RHOAI_QUAY_API_TOKEN: ${{ secrets.RHOAI_QUAY_API_TOKEN }}
@@ -59,8 +75,7 @@ jobs:
5975
run: |
6076
#Declare basic variables
6177
OPENSHIFT_VERSION=v4.13
62-
RHOAI_VERSION=v${BRANCH/rhoai-/}
63-
COMPONENT_SUFFIX=${RHOAI_VERSION//./-}
78+
COMPONENT_SUFFIX=v${RHOAI_VERSION//./-}
6479
OPERATOR_BUNDLE_COMPONENT_NAME=odh-operator-bundle-${COMPONENT_SUFFIX}
6580
XKS_HELM_CHART_COMPONENT_NAME=rhai-on-xks-chart-${COMPONENT_SUFFIX}
6681
OPENSHIFT_HELM_CHART_COMPONENT_NAME=rhai-on-openshift-chart-${COMPONENT_SUFFIX}
@@ -100,7 +115,7 @@ jobs:
100115
-c ${BUNDLE_CSV_PATH} \
101116
-p ${PATCH_YAML_PATH} \
102117
-o ${OUTPUT_FILE_PATH} \
103-
-v ${BRANCH} \
118+
-v rhoai-${RHOAI_VERSION} \
104119
-a ${ANNOTATION_YAML_PATH} \
105120
-xhp ${XKS_HELM_PATCH_YAML_PATH} \
106121
-xhv ${XKS_HELM_VALUES_YAML_PATH} \

0 commit comments

Comments
 (0)