Fix COMPONENTS variable crash when COMPONENT_NAMES is not provided - #3011
Fix COMPONENTS variable crash when COMPONENT_NAMES is not provided#3011BabbarPB08 wants to merge 4 commits into
Conversation
… not provided When Jenkins triggers ods-ci without COMPONENT_NAMES parameter, the COMPONENTS variable is never set in the test config YAML. This causes Robot Framework to crash with 'Variable $COMPONENTS not found' when creating the DataScienceCluster CR. Add a guard that checks if COMPONENTS exists and defaults all components to Managed if it doesn't, matching the expected behavior for a standard RHOAI installation. Cherry-picked fix onto release-2.25 branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
This is intentional, the VAR keyword is not compatible with Robot Framework 5, which is what our CI uses.
The original crash was caused by VAR. This fix deliberately uses Create Dictionary + Set Suite Variable for RF5 compatibility.
|
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BabbarPB08, rkubis The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |



Problem
When
COMPONENT_NAMESis not passed to the Jenkins job, thegenerateTestConfigFile.pyscript does not set theCOMPONENTSvariable intest-variables.yml. The fallback code inoc_install.robotthat should handle this case is missing, there's no guard to create a defaultCOMPONENTSdictionary when the variable doesn't exist.This causes
Apply DataScienceCluster CustomResourceandCreate DataScienceCluster CustomResource Using Test Variableskeywords to crash with:Fix
Added a
Variable Should Existcheck before accessing$COMPONENTS. If the variable is not defined, it defaults all components inCOMPONENT_LISTtoManagedusingCreate Dictionary+Set Suite Variable.Tested
COMPONENT_NAMES: Previously crashed, now defaults all components to Managed and proceeds successfullyCOMPONENT_NAMES: No change in behavior, existingCOMPONENTSvariable is used as before