ROSAENG-66016 | fix: derive channel group from --channel flag beforev ersion ID construction #3493
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3493"
general
weight: 0.35
andreadecorte
<!--
Please provide enough context so reviewers can understand:
1) the problem,
2) why this change is needed,
3) what changed,
4) how you validated it.
Use N/A when the option is not applicable to your case.
Commit format requirement:
[JIRA-TICKET] | [TYPE]: <MESSAGE>
Supported ticket prefixes:
OCM-XXXXX, ROSAENG-XXXX
TYPE must be one of:
feat, fix, docs, style, refactor, test, chore, build, ci, perf
For contributor workflow, see: ./CONTRIBUTING.md
For repo-local agent guidance, see: ./AGENTS.md
-->
PR Summary
Fix an issue when creating a cluster with a non-default channel that was behaving differently compared to the channel-group case.
Detailed Description of the Issue
When creating a cluster with
--channel candidate-4.22 --version 4.22.8, the version ID sent to the API wasopenshift-v4.22.8instead ofopenshift-v4.22.8-candidate. This happened because--channeland--channel-groupare mutually exclusive, andchannelGroupdefaulted tostablewhen only--channelwas provided. The channel group was never derived from the channel string before being used for version list fetching and version ID construction viaCreateVersionID().Move the
channelvariable read before version resolution incmd/create/cluster/cmd.goand, when set, derive the channel group from it using a newChannelGroupFromChannel()helper inpkg/ocm/versions.go. This ensuresGetVersionList()queries the correct channel group andCreateVersionID()appends the correct suffix.Follow-up: ROSAENG-66021 adds a
Channelfield to the E2E testProfilestruct and a profile that exercises--channelon a live cluster.Related Issues and PRs
<!-- Link all tracking items and related code changes -->
#Type of Change
<!-- Check the primary type this PR represents -->
Previous Behavior
<!-- What users or systems experienced before this change -->
When creating a cluster with a non-default channel, e.g.
--channel candidate-4.22 --version 4.22.8, the API output wasBehavior After This Change
<!-- What changes now, including user-visible and non-user-visible behavior -->
API output is now
How to Test (Step-by-Step)
<!-- Provide reproducible validation instructions -->
Preconditions
<!-- Required setup, environment, credentials, flags, cluster state, etc. -->
Test Steps
1. Create a cluster with a non default channel
2. Check that version.id is suffixed with the channel-group type
3.
Expected Results
<!-- What should happen after running the steps above -->
It should be suffixed
Proof of the Fix
<!-- Attach evidence that demonstrates the changed behavior -->
Debug output
Note: E2E tests will be followed up with ROSAENG-66021 as they require new test profiles.
Breaking Changes
Breaking Change Details / Migration Plan
<!-- Required only when breaking changes are introduced -->
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make install-hookshas been run in this clone.make testpasses.make lintpasses.make rosapasses.[ROSAENG-66016]: https://redhat.atlassian.net/browse/ROSAENG-66016?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[ROSAENG-66021]: https://redhat.atlassian.net/browse/ROSAENG-66021?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- Added by amandahla -->
Reasoning:
The CLI must derive the channel group because the Version payload must contain a version ID and channel group that are consistent before cluster creation.
See https://github.com/openshift/rosa/pull/3493/changes#r3903829065
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Cluster creation now automatically determines the appropriate channel group from the selected channel.
Version selection and validation remain aligned when channels are chosen through flags or interactive prompts.
Dry-run cluster creation resolves versions correctly for candidate channels.
Bug Fixes
Prevented conflicting use of
--channeland--channel-group.* Improved validation and end-of-life warnings when selected channels and versions require channel-group reconciliation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->