Skip to content

chore: implement module categorization in module catalog#368

Merged
akila-i merged 1 commit intoopenchoreo:mainfrom
NomadXD:main
Mar 5, 2026
Merged

chore: implement module categorization in module catalog#368
akila-i merged 1 commit intoopenchoreo:mainfrom
NomadXD:main

Conversation

@NomadXD
Copy link
Contributor

@NomadXD NomadXD commented Mar 4, 2026

Purpose

Implement module categorization in module catalog and add reference to module docs

Related Issues

openchoreo/openchoreo#2201

Summary by CodeRabbit

  • New Features

    • Added module type badges to plugin cards ("OpenChoreo Module" / "Backstage Curated Module").
    • Reactivated Browse Modules button to navigate to the modules catalog.
  • Updates

    • Reorganized author display on plugin cards (now shown above descriptions).
    • Standardized many plugin authors to "OpenChoreo" and added module-type tags to marketplace entries.
    • Renamed categories (CI/CD → CI; Core → Default) and changed search placeholder to "Search modules...".

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Warning

Rate limit exceeded

@akila-i has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ddc32a39-f7bb-4ba7-9025-fa4833664c44

📥 Commits

Reviewing files that changed from the base of the PR and between 9bb9657 and 82ae546.

📒 Files selected for processing (6)
  • src/components/PluginCard/PluginCard.module.css
  • src/components/PluginCard/PluginCard.tsx
  • src/data/marketplace-plugins.json
  • src/data/marketplace-plugins.source.json
  • src/pages/marketplace.module.css
  • src/pages/modules.tsx
📝 Walkthrough

Walkthrough

Adds an optional moduleType to Plugin data and UI, introduces themed module-type badges and an author line in PluginCard, updates marketplace plugin records (author → "OpenChoreo", many moduleType values), renames categories (Core → Default, CI/CD → CI), and enables catalog navigation and module links on the Modules page.

Changes

Cohort / File(s) Summary
PluginCard Component
src/components/PluginCard/PluginCard.module.css, src/components/PluginCard/PluginCard.tsx
Added .author, .labelCore, .labelBackstage styles (light/dark variants) and align-items: flex-start. Plugin interface gained `moduleType?: 'openchoreo'
Marketplace Plugin Data
src/data/marketplace-plugins.json, src/data/marketplace-plugins.source.json
Standardized many entries' author to "OpenChoreo" and added moduleType (mostly "openchoreo", some "backstage"). Updated several categories (e.g., "CI/CD" → "CI").
Modules Page & Styling
src/pages/modules.tsx, src/pages/marketplace.module.css
Added moduleType to page Plugin interface, adjusted category mapping (Core→Default), changed search placeholder to "Search modules...", added id="modules-catalog" and enabled Browse/Build links/scrolling. Added line-height: 1 and box-sizing: border-box to button styles.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • nilushancosta
  • JanakaSandaruwan
  • kaviththiranga

Poem

🐰 I hop with joy through modules new and bright,
Badges gleam in day and soft by night.
OpenChoreo stamps the trail I tread,
Authors unified, new catalogs ahead.
Hop, click, explore — the marketplace takes flight!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers the Purpose and Related Issues sections from the template, but the Checklist section is entirely missing. Complete the Checklist section by confirming whether sidebars.ts was updated, local preview was tested, build passes, and all links work correctly.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: implementing module categorization in the module catalog through new moduleType field additions and category updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/data/marketplace-plugins.source.json (1)

1-242: Consider enforcing source/generated JSON sync in CI.

Since src/data/marketplace-plugins.json is generated from this file, a CI check that regenerates and fails on diff would prevent drift.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/data/marketplace-plugins.source.json` around lines 1 - 242, The generated
marketplace plugins JSON can drift from its source; add a CI check that
regenerates the derived file and fails the build if there is any diff between
the regenerated output and the checked-in generated file (i.e., regenerate from
marketplace-plugins.source.json and compare to marketplace-plugins.json).
Implement this as a pipeline step (script/Makefile target) that runs the same
generator used locally, exits non-zero on differences, and wire it into CI so
PRs must pass the sync check before merging.
src/pages/modules.tsx (1)

84-87: Use Docusaurus base-aware navigation for the docs link.

The hardcoded /docs/operations/modules/building-a-module URL can break under non-root baseUrl deployments. Other components in the codebase already use the standard pattern—import Link from @docusaurus/Link and useBaseUrl from @docusaurus/useBaseUrl, then use <Link to={useBaseUrl('/docs/...')} instead of hardcoded <a href>.

♻️ Proposed fix
+import Link from '@docusaurus/Link';
+import useBaseUrl from '@docusaurus/useBaseUrl';
...
 export default function Marketplace(): ReactNode {
+  const buildModuleUrl = useBaseUrl('/docs/operations/modules/building-a-module');
   const [searchQuery, setSearchQuery] = useState('');
   const [selectedCategory, setSelectedCategory] = useState('All');
...
-              <a
-                href="/docs/operations/modules/building-a-module"
-                className={styles.cOutlineButton}
-              >
+              <Link
+                to={buildModuleUrl}
+                className={styles.cOutlineButton}
+              >
                 Build a module
-              </a>
+              </Link>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/modules.tsx` around lines 84 - 87, Replace the hardcoded anchor
with Docusaurus base-aware navigation: import Link from '@docusaurus/Link' and
useBaseUrl from '@docusaurus/useBaseUrl', then change the <a
href="/docs/operations/modules/building-a-module"
className={styles.cOutlineButton}> element to <Link
to={useBaseUrl('/docs/operations/modules/building-a-module')}
className={styles.cOutlineButton}> (and close the Link instead of </a>); ensure
the new imports are added to the module's import list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/data/marketplace-plugins.source.json`:
- Around line 1-242: The generated marketplace plugins JSON can drift from its
source; add a CI check that regenerates the derived file and fails the build if
there is any diff between the regenerated output and the checked-in generated
file (i.e., regenerate from marketplace-plugins.source.json and compare to
marketplace-plugins.json). Implement this as a pipeline step (script/Makefile
target) that runs the same generator used locally, exits non-zero on
differences, and wire it into CI so PRs must pass the sync check before merging.

In `@src/pages/modules.tsx`:
- Around line 84-87: Replace the hardcoded anchor with Docusaurus base-aware
navigation: import Link from '@docusaurus/Link' and useBaseUrl from
'@docusaurus/useBaseUrl', then change the <a
href="/docs/operations/modules/building-a-module"
className={styles.cOutlineButton}> element to <Link
to={useBaseUrl('/docs/operations/modules/building-a-module')}
className={styles.cOutlineButton}> (and close the Link instead of </a>); ensure
the new imports are added to the module's import list.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 545bbc9e-4cad-42e7-87ed-e156a4a1d6d0

📥 Commits

Reviewing files that changed from the base of the PR and between 6141141 and a756e8f.

📒 Files selected for processing (6)
  • src/components/PluginCard/PluginCard.module.css
  • src/components/PluginCard/PluginCard.tsx
  • src/data/marketplace-plugins.json
  • src/data/marketplace-plugins.source.json
  • src/pages/marketplace.module.css
  • src/pages/modules.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/pages/modules.tsx (1)

30-53: ⚠️ Potential issue | 🟠 Major

Preserve compatibility for legacy "CI/CD" category values.

The filter now expects "CI" exactly, but the module authoring guide still shows "CI/CD" (docs/operations/modules/building-a-module.md:155-169). Entries following that guide will not match the CI filter.

Proposed fix (normalize category before filtering)
 const filteredPlugins = plugins.filter((plugin) => {
   const s = searchQuery.toLowerCase();
+  const normalizedCategory = plugin.category === 'CI/CD' ? 'CI' : plugin.category;
   const matchesSearch =
     plugin.name.toLowerCase().includes(s) ||
     plugin.description.toLowerCase().includes(s) ||
     plugin.tags.some((t) => t.toLowerCase().includes(s));

   const matchesCategory =
     selectedCategory === 'All' ||
-    plugin.category === selectedCategory ||
+    normalizedCategory === selectedCategory ||
     (selectedCategory === 'Default' && plugin.core);

   return matchesSearch && matchesCategory;
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/modules.tsx` around lines 30 - 53, The category filter in
Marketplace (state selectedCategory and the matchesCategory logic) rejects
legacy "CI/CD" values causing CI modules to be omitted; update the
matchesCategory check inside the filteredPlugins computation to normalize or
accept legacy forms when selectedCategory === 'CI' (e.g., treat plugin.category
=== 'CI' OR plugin.category === 'CI/CD' or normalize plugin.category by removing
slashes/case before comparing) so modules authored with "CI/CD" match the CI
filter; change the condition that currently checks plugin.category ===
selectedCategory to use the normalized comparison instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/pages/modules.tsx`:
- Around line 30-53: The category filter in Marketplace (state selectedCategory
and the matchesCategory logic) rejects legacy "CI/CD" values causing CI modules
to be omitted; update the matchesCategory check inside the filteredPlugins
computation to normalize or accept legacy forms when selectedCategory === 'CI'
(e.g., treat plugin.category === 'CI' OR plugin.category === 'CI/CD' or
normalize plugin.category by removing slashes/case before comparing) so modules
authored with "CI/CD" match the CI filter; change the condition that currently
checks plugin.category === selectedCategory to use the normalized comparison
instead.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a80e25fc-ce00-4fc6-944d-f9ab71ff0f64

📥 Commits

Reviewing files that changed from the base of the PR and between a756e8f and 9bb9657.

📒 Files selected for processing (6)
  • src/components/PluginCard/PluginCard.module.css
  • src/components/PluginCard/PluginCard.tsx
  • src/data/marketplace-plugins.json
  • src/data/marketplace-plugins.source.json
  • src/pages/marketplace.module.css
  • src/pages/modules.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/PluginCard/PluginCard.tsx
  • src/pages/marketplace.module.css

Signed-off-by: Lahiru De Silva <lahirude@wso2.com>
@akila-i akila-i merged commit 449f0a6 into openchoreo:main Mar 5, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants