chore: implement module categorization in module catalog#368
chore: implement module categorization in module catalog#368akila-i merged 1 commit intoopenchoreo:mainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds an optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 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.jsonis 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-moduleURL can break under non-rootbaseUrldeployments. Other components in the codebase already use the standard pattern—importLinkfrom@docusaurus/LinkanduseBaseUrlfrom@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
📒 Files selected for processing (6)
src/components/PluginCard/PluginCard.module.csssrc/components/PluginCard/PluginCard.tsxsrc/data/marketplace-plugins.jsonsrc/data/marketplace-plugins.source.jsonsrc/pages/marketplace.module.csssrc/pages/modules.tsx
There was a problem hiding this comment.
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 | 🟠 MajorPreserve 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
📒 Files selected for processing (6)
src/components/PluginCard/PluginCard.module.csssrc/components/PluginCard/PluginCard.tsxsrc/data/marketplace-plugins.jsonsrc/data/marketplace-plugins.source.jsonsrc/pages/marketplace.module.csssrc/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>
Purpose
Implement module categorization in module catalog and add reference to module docs
Related Issues
openchoreo/openchoreo#2201
Summary by CodeRabbit
New Features
Updates