Display Cluster Description with Markdown Rendering#6525
Conversation
Signed-off-by: Oksana Bazylieva <obazylie@redhat.com>
📝 WalkthroughWalkthroughCluster mappings now include cluster annotations, and the cluster overview renders the description annotation as Markdown with a default template when absent. ChangesCluster Description Display
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ManagedCluster
participant getCluster
participant ClusterOverviewPageContent
participant Markdown
ManagedCluster->>getCluster: provide metadata.annotations
getCluster->>ClusterOverviewPageContent: return Cluster.annotations
ClusterOverviewPageContent->>Markdown: render annotation or default description
🚥 Pre-merge checks | ✅ 5✅ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx (1)
86-86: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse UPPER_SNAKE_CASE for constants.
As per coding guidelines, constants that are truly constant values must use
UPPER_SNAKE_CASE.♻️ Proposed refactor
- const clusterDescriptionAnnotation = 'console.open-cluster-management.io/description' + const CLUSTER_DESCRIPTION_ANNOTATION = 'console.open-cluster-management.io/description'🤖 Prompt for 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. In `@frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx` at line 86, Rename the constant clusterDescriptionAnnotation to UPPER_SNAKE_CASE, such as CLUSTER_DESCRIPTION_ANNOTATION, and update all references to use the renamed symbol.Source: Coding guidelines
🤖 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
`@frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx`:
- Around line 342-354: Update the description value in ClusterOverview to remove
the hardcoded Markdown mock-data fallback. Use the cluster description
annotation when present, and render '-' when it is absent or empty, preserving
the existing Content and Markdown structure only if needed for the intended
empty-state display.
---
Nitpick comments:
In
`@frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx`:
- Line 86: Rename the constant clusterDescriptionAnnotation to UPPER_SNAKE_CASE,
such as CLUSTER_DESCRIPTION_ANNOTATION, and update all references to use the
renamed symbol.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f634a11e-bde7-49e3-bd49-e73049708643
📒 Files selected for processing (2)
frontend/src/resources/utils/get-cluster.tsfrontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx
Signed-off-by: Oksana Bazylieva <obazylie@redhat.com>
|
/retest |
|
|
/cc @KevinFCormier |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: KevinFCormier, oksanabaza 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 |



📝 Summary
Ticket Summary (Title):
ACM-37998 Display Cluster Description with Markdown Rendering
Ticket Link:
https://redhat.atlassian.net/browse/ACM-37998
Type of Change:
✅ Checklist
General
ACM-12340 Fix bug with...)If Feature
If Bugfix
🗒️ Notes for Reviewers
Testing Instructions
Add annotation:
Verify: Check Description field in right column shows markdown rendered text.
Remove annotation:
oc annotate managedcluster <cluster-name> 'console.open-cluster-management.io/description-'Verify: Description field shows "-"
Empty State:

Non Empty State:

Summary by CodeRabbit