← Back to Pull requests

ROSAENG-66016 | fix: derive channel group from --channel flag beforev ersion ID construction #3493

Closed
unknown closed this pull request without merging on Sep 02, 2026 13:45 UTC
View on GitHub
unknown unknown commented on Aug 31, 2026 11:53 UTC
Author

<!--
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 was openshift-v4.22.8 instead of openshift-v4.22.8-candidate. This happened because --channel and --channel-group are mutually exclusive, and channelGroup defaulted to stable when only --channel was provided. The channel group was never derived from the channel string before being used for version list fetching and version ID construction via CreateVersionID().

Move the channel variable read before version resolution in cmd/create/cluster/cmd.go and, when set, derive the channel group from it using a new ChannelGroupFromChannel() helper in pkg/ocm/versions.go. This ensures GetVersionList() queries the correct channel group and CreateVersionID() appends the correct suffix.

Follow-up: ROSAENG-66021 adds a Channel field to the E2E test Profile struct and a profile that exercises --channel on a live cluster.

Related Issues and PRs


<!-- Link all tracking items and related code changes -->
  • Jira: ROSAENG-66016

  • Fixes: #

  • Related PR(s):

  • Related design/docs:
  • Type of Change


    <!-- Check the primary type this PR represents -->
  • feat - adds a new user-facing capability.

  • [X] fix - resolves an incorrect behavior or bug.

  • docs - updates documentation only.

  • style - formatting or naming changes with no logic impact.

  • refactor - code restructuring with no behavior change.

  • test - adds or updates tests only.

  • chore - maintenance work (tooling, housekeeping, non-product code).

  • build - changes build system, packaging, or dependencies for build output.

  • ci - changes CI pipelines, jobs, or automation workflows.

  • perf - improves performance without changing intended behavior.
  • 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 was
      "version": {
        "kind": "Version",
        "id": "openshift-v4.22.8",
        "channel_group": "candidate"
      }
    

    Behavior After This Change


    <!-- What changes now, including user-visible and non-user-visible behavior -->
    API output is now
      "version": {
        "kind": "Version",
        "id": "openshift-v4.22.8-candidate",
        "channel_group": "candidate"
      }
    

    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 -->
  • Screenshots:

  • Videos:

  • Logs/CLI output:

  • Other artifacts:

  • Debug output
    time=2026-08-31T12:12:39+02:00 level=debug msg={
      "kind": "Cluster",
      "api": {
        "listening": "external"
      },
      "aws": {
        "sts": {
          "auto_mode": true,
          "instance_iam_roles": {
            "worker_role_arn": "arn:aws:iam::765374464689:role/adecorte-loc-HCP-ROSA-Worker-Role"
          },
          "oidc_config": {
            "id": "2mhlpkvc2etb4hqhns6kddh827eh2div"
          },
          "operator_iam_roles": [
            {
              "name": "control-plane-operator",
              "namespace": "kube-system",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-kube-system-control-plane-operator"
            },
            {
              "name": "kms-provider",
              "namespace": "kube-system",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-kube-system-kms-provider"
            },
            {
              "name": "kube-controller-manager",
              "namespace": "kube-system",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-kube-system-k
    
            },
            {
              "name": "installer-cloud-credentials",
              "namespace": "openshift-image-registry",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-openshift-image-registry-installer-cloud-credential"
            },
            {
              "name": "cloud-credentials",
              "namespace": "openshift-ingress-operator",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-openshift-ingress-operator-cloud-credentials"
            },
            {
              "name": "ebs-cloud-credentials",
              "namespace": "openshift-cluster-csi-drivers",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-openshift-cluster-csi-drivers-ebs-cloud-credentials"
            },
            {
              "name": "cloud-credentials",
              "namespace": "openshift-cloud-network-config-controller",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-openshift-cloud-network-config-controller-cloud-cre"
            },
            {
              "name": "capa-controller-manager",
              "namespace": "kube-system",
              "role_arn": "arn:aws:iam::765374464689:role/ad-loc1-l0n8-kube-system-capa-controller-manager"
            }
          ],
          "role_arn": "arn:aws:iam::765374464689:role/adecorte-loc-HCP-ROSA-Installer-Role",
          "support_role_arn": "arn:aws:iam::765374464689:role/adecorte-loc-HCP-ROSA-Support-Role"
        },
        "account_id": "765374464689",
        "audit_log": {
          "role_arn": ""
        },
        "billing_account_id": "765374464689",
        "ec2_metadata_http_tokens": "optional",
        "private_link": false,
        "subnet_ids": [
          "subnet-06997ced6874ac324",
          "subnet-0e3a4046c1c2f1078"
        ]
      },
      "fips": false,
      "channel": "candidate-4.22",
      "etcd_encryption": false,
      "flavour": {
        "kind": "Flavour",
        "id": "osd-4"
      },
      "hypershift": {
        "enabled": true
      },
      "ingresses": {
        "items": [
          {
            "kind": "Ingress",
            "default": true,
            "listening": "external"
          }
        ]
      },
      "multi_az": true,
      "name": "ad-loc1",
      "network": {
        "host_prefix": 23,
        "machine_cidr": "10.0.0.0/16",
        "pod_cidr": "10.128.0.0/13",
        "service_cidr": "172.30.0.0/16"
      },
      "nodes": {
        "availability_zones": [
          "us-west-2a"
        ],
        "compute": 2,
        "compute_machine_type": {
          "kind": "MachineType",
          "id": "m5.xlarge"
        }
      },
      "product": {
        "kind": "Product",
        "id": "rosa"
      },
      "properties": {
        "rosa_cli_version": "1.2.64",
        "rosa_creator_arn": "arn:aws:iam::765374464689:user/adecorte"
      },
      "region": {
        "kind": "CloudRegion",
        "id": "us-west-2"
      },
      "version": {
        "kind": "Version",
        "id": "openshift-v4.22.8-candidate"
      }
    }
    

    Note: E2E tests will be followed up with ROSAENG-66021 as they require new test profiles.

    Breaking Changes


  • [X] No breaking changes

  • Yes, this PR introduces a breaking change (describe impact and migration plan below)
  • Breaking Change Details / Migration Plan


    <!-- Required only when breaking changes are introduced -->

    Developer Verification Checklist


  • [X] Commit subject/title follows [JIRA-TICKET] | [TYPE]: <MESSAGE>.

  • [X] PR description clearly explains both what changed and why.

  • [X] Relevant Jira/GitHub issues and related PRs are linked.

  • [X] make install-hooks has been run in this clone.

  • [X] Tests were added/updated where appropriate.

  • [X] I manually tested the change.

  • [X] make test passes.

  • [X] make lint passes.

  • [X] make rosa passes.

  • [X] Documentation or repo-local agent guidance was added/updated where appropriate.

  • [X] Any risk, limitation, or follow-up work is documented.
  • [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 --channel and --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 -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: andreadecorte Review duration: 2992m
    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
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository