OCPBUGS-61061: add blank line before error in upgrade recommend --version output - #2338
OCPBUGS-61061: add blank line before error in upgrade recommend --version output#2338savio87 wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@savio87: This pull request references Jira Issue OCPBUGS-61061, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: savio87 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 |
|
Hi @savio87. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
WalkthroughThe upgrade recommendation command now prints a blank line before unaccepted issue errors in non-quiet mode. Five output fixtures reflect this formatting. ChangesUpgrade recommendation output
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5 | ❌ 10❌ Failed checks (10 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Hi, this is a small formatting fix that adds a blank line between the conditional-update risk message and the error line in oc adm upgrade recommend --version output. The Jira issue (OCPBUGS-61061) currently targets 4.20.z, could a maintainer please update the target version to 5.0.0 and run /jira refresh? Also requesting /ok-to-test when ready. Thanks! |
There was a problem hiding this comment.
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 `@pkg/cli/admin/upgrade/recommend/recommend.go`:
- Around line 369-371: Update the non-quiet output path in the recommendation
flow to check the error returned by fmt.Fprintln(o.Out), wrap it with context,
and return it before returning the unaccepted-issues failure; preserve the
existing blank-line output behavior when the write succeeds.
🪄 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: Pro Plus
Run ID: 7f427d4b-1e4b-41b2-bd10-e60e97aa6560
📒 Files selected for processing (6)
pkg/cli/admin/upgrade/recommend/examples/4.12.16-longest-not-recommended.version-4.12.51-outputpkg/cli/admin/upgrade/recommend/examples/4.12.16-longest-recommended.version-4.12.51-outputpkg/cli/admin/upgrade/recommend/examples/4.16.27-degraded-monitoring.version-4.16.32-outputpkg/cli/admin/upgrade/recommend/examples/5.0.0-cvo-handling-risks.version-5.0.0-ec.3-outputpkg/cli/admin/upgrade/recommend/examples/5.0.0-cvo-not-handling-risks.version-5.0.0-ec.3-outputpkg/cli/admin/upgrade/recommend/recommend.go
|
According to the examples changes this is adding an extra newline where there already is one. Or were the examples wrong? |
|
Good question! The blank line before |
|
Could we align the test harness to be consistent with the actual CLI output? |
Summary
When running
oc adm upgrade recommend --version, the conditional-update risk message runs directly into the error line with no visual separation. This adds a blank line between the output and the error to improve readability.Bug: https://redhat.atlassian.net/browse/OCPBUGS-61061
Changes
fmt.Fprintln(o.Out)before the error return in the--versionpath ofrecommend.go(only when not in quiet mode)Summary by CodeRabbit