OCPBUGS-109743: Derive console notification docs URL from cluster version - #1676
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@lucaconsalvi: This pull request references OCPEDGE-2916 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 bug to target the "5.0.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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughPacemaker startup now supplies a ChangesConsole documentation URL resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The version-derived documentation URL change is localized and covered by targeted tests; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant PacemakerStartup
participant ConfigInformerFactory
participant ConsoleNotificationController
participant ClusterVersionLister
participant NotificationResource
PacemakerStartup->>ConfigInformerFactory: create and start
ConfigInformerFactory-->>PacemakerStartup: synchronize ClusterVersion cache
PacemakerStartup->>ConsoleNotificationController: pass ClusterVersion lister
ConsoleNotificationController->>ClusterVersionLister: read version history
ClusterVersionLister-->>ConsoleNotificationController: return version or no data
ConsoleNotificationController->>NotificationResource: provide versioned URL and category fragment
🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 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 |
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/tnf/pkg/pacemaker/consolenotification_test.go`:
- Around line 115-125: Update fakeClusterVersionLister to handle the error
returned by indexer.Add when adding the ClusterVersion fixture. Make the test
fixture fail immediately if the add operation fails, using the test failure
mechanism available to the surrounding test context rather than discarding the
error.
🪄 Autofix
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: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 259da7ff-bca4-4321-bb96-9fc8851391e1
📒 Files selected for processing (4)
pkg/operator/starter.gopkg/tnf/operator/starter.gopkg/tnf/pkg/pacemaker/consolenotification.gopkg/tnf/pkg/pacemaker/consolenotification_test.go
|
/retest |
ca5d51d to
2c29d45
Compare
Replace the hardcoded OCP 4.22 docs URL in console notifications with a dynamic version derived from ClusterVersion.Status.History[0].Version, falling back to "latest" when unavailable. Follows the MCO pattern. The config client and ClusterVersion informer are created locally in runPacemakerControllers to keep changes within pkg/tnf/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2c29d45 to
1d7f300
Compare
Test ResultsTested on a cluster-bot TNF cluster running Dynamic version extraction: ClusterVersion Console notification verified: Triggered a degraded state via Docs URL validation (in browser):
Cleanup: After removing maintenance ( |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fonta-rh 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 |
|
/hold |
|
/lgtm |
|
Scheduling required tests: |
|
/lgtm |
|
verified by @lucaconsalvi |
|
/retest |
|
/retest |
|
/retest |
|
@lucaconsalvi: This pull request references Jira Issue OCPBUGS-109743, 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. |
|
@lucaconsalvi: 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. |
|
@dhensel-rh: The 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. |
|
/verified by @dhensel-rh |
|
@dhensel-rh: 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. |
|
/jira refresh |
|
@lucaconsalvi: This pull request references Jira Issue OCPBUGS-109743, which is valid. 3 validation(s) were run on this bug
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. |
|
/cherry-pick release-5.0 |
|
@lucaconsalvi: once the present PR merges, I will cherry-pick it on top of 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. |
|
/unhold |
|
@lucaconsalvi: Jira Issue Verification Checks: Jira Issue OCPBUGS-109743 Jira Issue OCPBUGS-109743 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 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. |
|
@lucaconsalvi: new pull request created: #1679 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. |
|
Fix included in release 5.1.0-0.nightly-2026-08-17-205440 |
Summary
docsBasePathconstant inconsolenotification.gowas hardcoded to4.22, so console notification banners (degraded recovery, troubleshooting) always linked to 4.22 docs regardless of the actual cluster versionClusterVersion.Status.History[0].Versionat runtime, with a"latest"fallback when ClusterVersion is unavailablepkg/operator/status.go)Changes
pkg/tnf/pkg/pacemaker/consolenotification.godocsBasePathwithdocsURLFormat+docsBaseURL()method that reads ClusterVersionpkg/tnf/operator/starter.goClusterVersionInformerthroughHandleDualReplicaClusters→runPacemakerControllerspkg/operator/starter.goclusterVersionsinformer toHandleDualReplicaClusterspkg/tnf/pkg/pacemaker/consolenotification_test.goTestDocsBaseURL(version extraction, nightly, fallback), update existing testsTest plan
go build ./...passesgo test ./pkg/tnf/pkg/pacemaker/— all 22 tests passTestDocsBaseURLcovers: full version (4.23.0→/4.23/), nightly (4.24.0-0.nightly-...→/4.24/), empty ClusterVersion (→ /latest/)🤖 Generated with Claude Code
Summary by CodeRabbit