Skip to content

Display Cluster Description with Markdown Rendering#6525

Merged
KevinFCormier merged 2 commits into
stolostron:mainfrom
oksanabaza:ACM-37998
Jul 22, 2026
Merged

Display Cluster Description with Markdown Rendering#6525
KevinFCormier merged 2 commits into
stolostron:mainfrom
oksanabaza:ACM-37998

Conversation

@oksanabaza

@oksanabaza oksanabaza commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

📝 Summary

Ticket Summary (Title):

ACM-37998 Display Cluster Description with Markdown Rendering

Ticket Link:

https://redhat.atlassian.net/browse/ACM-37998

Type of Change:

  • 🐞 Bug Fix
  • ✨ Feature
  • 🔧 Refactor
  • 💸 Tech Debt
  • 🧪 Test-related
  • 📄 Docs

✅ Checklist

General

  • PR title follows the convention (e.g. ACM-12340 Fix bug with...)
  • Code builds and runs locally without errors
  • No console logs, commented-out code, or unnecessary files
  • All commits are meaningful and well-labeled
  • All new display strings are externalized for localization (English only)
  • (Nice to have) JSDoc comments added for new functions and interfaces

If Feature

  • UI/UX reviewed (if applicable)
  • All acceptance criteria met
  • Unit test coverage added or updated
  • Relevant documentation or comments included

If Bugfix

  • Root cause and fix summary are documented in the ticket (for future reference / errata)
  • Fix tested thoroughly and resolves the issue
  • Test(s) added to prevent regression

🗒️ Notes for Reviewers

Testing Instructions

Add annotation:

oc annotate managedcluster <cluster-name> \
  'console.open-cluster-management.io/description=**Production** cluster with [docs](https://example.com)'

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:
Снимок экрана — 2026-07-20 в 2 26 09 PM

Non Empty State:
Снимок экрана — 2026-07-20 в 2 24 49 PM

Summary by CodeRabbit

  • New Features
    • Cluster overview pages now display a Description field.
    • Descriptions support Markdown formatting and use a default template when no custom description is available.
    • Cluster details now include available annotations for displaying additional metadata.

Signed-off-by: Oksana Bazylieva <obazylie@redhat.com>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Cluster mappings now include cluster annotations, and the cluster overview renders the description annotation as Markdown with a default template when absent.

Changes

Cluster Description Display

Layer / File(s) Summary
Propagate cluster annotations
frontend/src/resources/utils/get-cluster.ts
The Cluster type exposes optional annotations, populated from managed cluster metadata with an info metadata fallback.
Render cluster description
frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx
The overview reads the description annotation, renders it with Markdown, falls back to a default template, and includes it in the details list.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly names the main change: showing cluster descriptions with Markdown rendering.
Description check ✅ Passed The description follows the template and includes the ticket info, change type, checklist, and reviewer testing notes.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 value

Use 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1631d0f and bd07c46.

📒 Files selected for processing (2)
  • frontend/src/resources/utils/get-cluster.ts
  • frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx

Signed-off-by: Oksana Bazylieva <obazylie@redhat.com>
@oksanabaza

Copy link
Copy Markdown
Contributor Author

/retest

@sonarqubecloud

Copy link
Copy Markdown

@oksanabaza oksanabaza changed the title WIP Display Cluster Description with Markdown Rendering Display Cluster Description with Markdown Rendering Jul 20, 2026
@oksanabaza

Copy link
Copy Markdown
Contributor Author

cc @KevinFCormier

@KevinFCormier

Copy link
Copy Markdown
Contributor

/cc @KevinFCormier

@openshift-ci
openshift-ci Bot requested a review from KevinFCormier July 21, 2026 13:01
@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [KevinFCormier,oksanabaza]

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

@KevinFCormier
KevinFCormier merged commit b93710b into stolostron:main Jul 22, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants