Skip to content

OCPBUGS-59142: fix ValidReleaseImage condition message to show minor version#8519

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
vsolanki12:OCPBUGS-59142-ValidReleaseImage-Condition-message
May 19, 2026
Merged

OCPBUGS-59142: fix ValidReleaseImage condition message to show minor version#8519
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
vsolanki12:OCPBUGS-59142-ValidReleaseImage-Condition-message

Conversation

@vsolanki12
Copy link
Copy Markdown
Contributor

@vsolanki12 vsolanki12 commented May 14, 2026

What this PR does / why we need it:

The ValidReleaseImage condition error messages displayed the full semver version (e.g. "4.18.0") for the max and min supported versions, misleading users into thinking only that specific patch version was supported. This change uses trimVersion() to strip the ".0" patch suffix so the message shows "4.18" instead, making it clear that any patch version within the minor release is valid.

Before: the latest version supported is: "4.18.0". Attempting to use: "4.19.0"
After: the latest version supported is: "4.18". Attempting to use: "4.19.0"

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-59142

Special notes for your reviewer:

The fix applies trimVersion() (which already exists in the same file) to two error messages in IsValidReleaseVersion():

  • Line 185: max supported version message
  • Line 189: min supported version message

Tested on a ROSA cluster by lowering LatestSupportedVersion to 4.18.0, creating a HostedCluster with a 4.19 release image, and confirming the updated message.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

🤖 Generated with Claude Code via /jira:solve OCPBUGS-59142

Summary by CodeRabbit

  • Bug Fixes
    • Version validation error messages now display supported version bounds more concisely by trimming redundant trailing zeros for clearer user-facing text.
  • Tests
    • Updated tests to assert the improved error message content for relevant failing scenarios.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 14, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 14, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@vsolanki12: This pull request references Jira Issue OCPBUGS-59142, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

What this PR does / why we need it:

The ValidReleaseImage condition error messages displayed the full semver version (e.g. "4.18.0") for the max and min supported versions, misleading users into thinking only that specific patch version was supported. This change uses trimVersion() to strip the ".0" patch suffix so the message shows "4.18" instead, making it clear that any patch version within the minor release is valid.

Before: the latest version supported is: "4.18.0". Attempting to use: "4.19.0"
After: the latest version supported is: "4.18". Attempting to use: "4.19.0"

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-59142

Special notes for your reviewer:

The fix applies trimVersion() (which already exists in the same file) to two error messages in IsValidReleaseVersion():

  • Line 185: max supported version message
  • Line 189: min supported version message

Tested on a ROSA cluster by lowering LatestSupportedVersion to 4.18.0, creating a HostedCluster with a 4.19 release image, and confirming the updated message.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

🤖 Generated with Claude Code via /jira:solve OCPBUGS-59142

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: cb338ed7-bcc6-48bb-a573-426f7a60515c

📥 Commits

Reviewing files that changed from the base of the PR and between 7f1af37 and cb015c0.

📒 Files selected for processing (2)
  • support/supportedversion/version.go
  • support/supportedversion/version_test.go

📝 Walkthrough

Walkthrough

The IsValidReleaseVersion function in support/supportedversion/version.go was changed to alter only its error message formatting: when constructing messages for the "latest supported version" and "minimum version supported for platform" bounds checks, it now calls trimVersion(... .String()) to remove trailing .0 components instead of using raw semver values. No validation logic or control flow was modified.

Suggested reviewers

  • bryan-cox
  • clebs
🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title correctly identifies the main change: trimming version strings in error messages to show minor version instead of full semver patch.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The custom check is specifically for Ginkgo test names. This PR uses standard Go testing (testing.T with t.Run and table-driven tests), not Ginkgo. The check is not applicable to this PR.
Test Structure And Quality ✅ Passed Custom check specifies Ginkgo requirements (It blocks, BeforeEach/AfterEach), but this codebase uses Go standard testing framework with table-driven patterns. Check not applicable to codebase style.
Microshift Test Compatibility ✅ Passed PR modifies only unit tests with standard Go testing framework, not Ginkgo e2e tests. Custom check applies only to Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests added. Changes are unit tests in support/supportedversion/ using standard Go testing and Gomega. Check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only utility function error message formatting changes. No deployment manifests, controllers, or scheduling constraints are added or modified.
Ote Binary Stdout Contract ✅ Passed Changes only modify error message formatting in a library function. No process-level code or stdout writes introduced. Complies with OTE Binary Stdout Contract requirements.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests added. Changes are standard Go unit tests testing version validation logic. Check not applicable to this PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.00%. Comparing base (294fa41) to head (cb015c0).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8519   +/-   ##
=======================================
  Coverage   40.00%   40.00%           
=======================================
  Files         751      751           
  Lines       92863    92863           
=======================================
  Hits        37147    37147           
  Misses      53024    53024           
  Partials     2692     2692           
Files with missing lines Coverage Δ
support/supportedversion/version.go 62.09% <100.00%> (ø)
Flag Coverage Δ
cmd-support 34.09% <100.00%> (ø)
cpo-hostedcontrolplane 40.56% <ø> (ø)
cpo-other 40.14% <ø> (ø)
hypershift-operator 50.52% <ø> (ø)
other 31.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@support/supportedversion/version.go`:
- Around line 184-186: Update the test "versions > LatestSupportedVersion are
not supported" to assert the error message formatting when the condition
normalizedVersion.Minor > normalizedMax.Minor triggers: after verifying err is
non-nil, also assert that err.Error() contains "the latest version supported
is:" (ensuring the message includes the supported version) and that the
supported version string uses the trimVersion(displayMax.String()) formatting
(i.e., without a trailing .0) so the test verifies the code path that constructs
the message in the normalizedVersion.Minor > normalizedMax.Minor branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: faff9f76-2e23-440f-a412-54708709707f

📥 Commits

Reviewing files that changed from the base of the PR and between 294fa41 and 66f096e.

📒 Files selected for processing (7)
  • control-plane-operator/controllers/hostedcontrolplane/infra/infra.go
  • control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go
  • control-plane-operator/controllers/hostedcontrolplane/ingress/router.go
  • control-plane-operator/controllers/hostedcontrolplane/ingress/router_test.go
  • control-plane-operator/controllers/hostedcontrolplane/kas/service.go
  • control-plane-operator/controllers/hostedcontrolplane/kas/service_test.go
  • support/supportedversion/version.go

Comment thread support/supportedversion/version.go
@vsolanki12 vsolanki12 force-pushed the OCPBUGS-59142-ValidReleaseImage-Condition-message branch from 66f096e to b245bb9 Compare May 14, 2026 11:14
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 14, 2026
@vsolanki12 vsolanki12 force-pushed the OCPBUGS-59142-ValidReleaseImage-Condition-message branch from b245bb9 to 64b2c39 Compare May 14, 2026 11:37
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 14, 2026
@vsolanki12 vsolanki12 force-pushed the OCPBUGS-59142-ValidReleaseImage-Condition-message branch from 64b2c39 to 94dccaa Compare May 14, 2026 11:39
…essages

Use trimVersion() to strip the .0 patch suffix so error
messages show e.g. 4.18 instead of 4.18.0, making it clear
that any patch version within the minor release is valid.
@vsolanki12 vsolanki12 force-pushed the OCPBUGS-59142-ValidReleaseImage-Condition-message branch from 94dccaa to cb015c0 Compare May 14, 2026 12:46
@vsolanki12
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

✅ Actions performed

Full review triggered.

@vsolanki12 vsolanki12 marked this pull request as ready for review May 14, 2026 13:08
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 14, 2026
@openshift-ci openshift-ci Bot requested review from cblecker and devguyio May 14, 2026 13:08
@vsolanki12
Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@vsolanki12: This pull request references Jira Issue OCPBUGS-59142, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (yli2@redhat.com), skipping review request.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@cblecker
Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 16, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-gke

@cwbotbot
Copy link
Copy Markdown

cwbotbot commented May 16, 2026

Test Results

e2e-aws

e2e-aks

@muraee
Copy link
Copy Markdown
Contributor

muraee commented May 19, 2026

/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: muraee, vsolanki12

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2026
@vsolanki12
Copy link
Copy Markdown
Contributor Author

/verified by me on local env

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 19, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@vsolanki12: This PR has been marked as verified by me on local env.

Details

In response to this:

/verified by me on local env

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@vsolanki12
Copy link
Copy Markdown
Contributor Author

Before fix:
$ oc get hostedcluster test-invalid-version -n clusters \ -o jsonpath='{.status.conditions[?(@.type=="ValidReleaseImage")].message}' the latest version supported is: "4.18.0". Attempting to use: "4.19.0"

After fix:
oc get hostedcluster test-invalid-version -n clusters \ -o jsonpath='{.status.conditions[?(@.type=="ValidReleaseImage")].message}' the latest version supported is: "4.18". Attempting to use: "4.19.0"

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

@vsolanki12: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 801e5ec into openshift:main May 19, 2026
42 checks passed
@openshift-ci-robot
Copy link
Copy Markdown

@vsolanki12: Jira Issue Verification Checks: Jira Issue OCPBUGS-59142
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-59142 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

What this PR does / why we need it:

The ValidReleaseImage condition error messages displayed the full semver version (e.g. "4.18.0") for the max and min supported versions, misleading users into thinking only that specific patch version was supported. This change uses trimVersion() to strip the ".0" patch suffix so the message shows "4.18" instead, making it clear that any patch version within the minor release is valid.

Before: the latest version supported is: "4.18.0". Attempting to use: "4.19.0"
After: the latest version supported is: "4.18". Attempting to use: "4.19.0"

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-59142

Special notes for your reviewer:

The fix applies trimVersion() (which already exists in the same file) to two error messages in IsValidReleaseVersion():

  • Line 185: max supported version message
  • Line 189: min supported version message

Tested on a ROSA cluster by lowering LatestSupportedVersion to 4.18.0, creating a HostedCluster with a 4.19 release image, and confirming the updated message.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

🤖 Generated with Claude Code via /jira:solve OCPBUGS-59142

Summary by CodeRabbit

  • Bug Fixes
  • Version validation error messages now display supported version bounds more concisely by trimming redundant trailing zeros for clearer user-facing text.
  • Tests
  • Updated tests to assert the improved error message content for relevant failing scenarios.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants