-
Notifications
You must be signed in to change notification settings - Fork 215
OTA-1786: pkg/payload/precondition/clusterversion/gianthop: Allow updates to 5.0 #1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTA-1786: pkg/payload/precondition/clusterversion/gianthop: Allow updates to 5.0 #1275
Conversation
|
@wking: This pull request references OTA-1786 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
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. |
WalkthroughAdds a temporary special-case in GiantHop.Run to allow direct updates from current major 4 to target 5.0 only; rejects updates to 5.1+ with a MajorVersionUpdate error. Adds two tests validating success for 5.0 and rejection for 5.1. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this 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
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (2)
pkg/payload/precondition/clusterversion/gianthop.go(1 hunks)pkg/payload/precondition/clusterversion/gianthop_test.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
pkg/payload/precondition/clusterversion/gianthop_test.gopkg/payload/precondition/clusterversion/gianthop.go
🧬 Code graph analysis (2)
pkg/payload/precondition/clusterversion/gianthop_test.go (2)
pkg/payload/payload.go (1)
Update(104-117)pkg/version/version.go (1)
Version(16-16)
pkg/payload/precondition/clusterversion/gianthop.go (1)
pkg/payload/precondition/precondition.go (1)
Error(14-20)
🔇 Additional comments (1)
pkg/payload/precondition/clusterversion/gianthop_test.go (1)
67-98: LGTM!The new test cases appropriately cover both the allowed transition (4.x → 5.0) and the blocked transition (4.x → 5.1+). The expected error message aligns with the implementation intent.
5e37485 to
3297a67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/payload/precondition/clusterversion/gianthop.go (1)
68-78: Implementation correctly handles the 4→5.0 special case.The logic properly allows updates from any 4.x to 5.0 while rejecting 5.1+. The nested conditionals are clear, and the error messages provide appropriate context. The comment acknowledging this as temporary technical debt is good practice.
Optional: Consider adding a test with realistic version numbers
While the current tests use simplified versions like 4.0.0, you could add a test case with a more realistic scenario like 4.22.0 → 5.0.0 to better reflect production usage. This would help verify the logic works with actual deployment versions.
Example test case to add in
gianthop_test.go:{ name: "realistic 4.22 to 5.0", clusterVersion: configv1.ClusterVersion{ Spec: configv1.ClusterVersionSpec{ DesiredUpdate: &configv1.Update{ Version: "5.0.0", }, }, Status: configv1.ClusterVersionStatus{ Desired: configv1.Release{ Version: "4.22.0", }, }, }, expected: "", },
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (2)
pkg/payload/precondition/clusterversion/gianthop.go(1 hunks)pkg/payload/precondition/clusterversion/gianthop_test.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
pkg/payload/precondition/clusterversion/gianthop.gopkg/payload/precondition/clusterversion/gianthop_test.go
🧬 Code graph analysis (2)
pkg/payload/precondition/clusterversion/gianthop.go (1)
pkg/payload/precondition/precondition.go (1)
Error(14-20)
pkg/payload/precondition/clusterversion/gianthop_test.go (2)
pkg/payload/payload.go (1)
Update(104-117)pkg/version/version.go (1)
Version(16-16)
🔇 Additional comments (1)
pkg/payload/precondition/clusterversion/gianthop_test.go (1)
67-98: Test coverage appropriately validates the new behavior.The two test cases correctly verify that 4.0.0 → 5.0.0 succeeds while 4.0.0 → 5.1.0 fails with the expected error message. The test expectations align with the implementation logic.
|
/cc |
DavidHurta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
One comment. Feel free to address it or unhold the PR.
Not sure yet if OCP 5.0 will be a thing, but to help folks feeling out that space just in case [1], relax the current giant-hop guard in 4.22 to allow updates to 5.0. I'm special-casing 5.0 (e.g. no allowing 4 -> 6 or 4 -> 5.1) to make the smallest possible change at this early-testing stage. [1]: https://access.redhat.com/articles/7134648
3297a67 to
d544606
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/payload/precondition/clusterversion/gianthop_test.go (1)
83-98: Test case correctly validates the 4.x -> 5.1+ rejection path.The test appropriately verifies that updates from version 4.0.0 to 5.1.0 are blocked with the expected error message mentioning "or to 5.0".
Optional: Consider more descriptive test names.
For improved clarity, consider renaming:
- "major version is 5.0" → "allow major version hop from 4.x to 5.0"
- "major version is 5.1" → "block major version hop from 4.x to 5.1 and above"
🔎 Suggested test name improvements
- name: "major version is 5.0", + name: "allow major version hop from 4.x to 5.0",- name: "major version is 5.1", + name: "block major version hop from 4.x to 5.1 and above",
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (2)
pkg/payload/precondition/clusterversion/gianthop.gopkg/payload/precondition/clusterversion/gianthop_test.go
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
pkg/payload/precondition/clusterversion/gianthop.gopkg/payload/precondition/clusterversion/gianthop_test.go
🧬 Code graph analysis (1)
pkg/payload/precondition/clusterversion/gianthop_test.go (2)
pkg/payload/payload.go (1)
Update(104-117)pkg/version/version.go (1)
Version(16-16)
🔇 Additional comments (2)
pkg/payload/precondition/clusterversion/gianthop.go (1)
69-78: LGTM! The special-case logic is correct and well-documented.The implementation correctly allows updates from any 4.x version to 5.0.0 only, while blocking 5.1+ with an appropriate error message. The TODO comment clearly marks this as temporary code for early testing purposes, aligning with the PR objectives.
pkg/payload/precondition/clusterversion/gianthop_test.go (1)
67-82: Test case correctly validates the 4.x -> 5.0 success path.The test appropriately verifies that updates from version 4.0.0 to 5.0.0 are allowed (no error expected).
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DavidHurta, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by unit which will have included: go test -v ./pkg/payload/precondition/clusterversion
...
--- PASS: TestGiantHopRun (0.00s)
...
--- PASS: TestGiantHopRun/major_version (0.00s)
--- PASS: TestGiantHopRun/major_version_is_5.0 (0.00s)
--- PASS: TestGiantHopRun/major_version_is_5.1 (0.00s)
... |
|
@wking: This PR has been marked as verified by DetailsIn response to this:
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. |
|
/override ci/prow/e2e-agnostic-ovn |
|
@wking: Overrode contexts on behalf of wking: ci/prow/e2e-agnostic-ovn DetailsIn response to this:
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. |
|
The deprovision timeout is unrelated to my change: /override ci/prow/e2e-aws-ovn-techpreview |
|
@wking: Overrode contexts on behalf of wking: ci/prow/e2e-aws-ovn-techpreview DetailsIn response to this:
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. |
|
/override ci/prow/okd-scos-images |
|
@wking: Overrode contexts on behalf of wking: ci/prow/okd-scos-images DetailsIn response to this:
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. |
|
@wking: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Not sure yet if OCP 5.0 will be a thing, but to help folks feeling out that space just in case, relax the current giant-hop guard in 4.22 to allow updates to 5.0. I'm special-casing 5.0 (e.g. no allowing 4 -> 6 or 4 -> 5.1) to make the smallest possible change at this early-testing stage.