feat: implement WSO2 API Manager plugin with entity provider and UI c…#4
Conversation
📝 WalkthroughWalkthroughThe changes introduce discoverability tracking for WSO2 API entities across the catalog backend and UI components. New type fields and metadata annotations mark discovered APIs, and UI components are updated to display this status with badges, column replacements, and conditional feature disabling. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~35 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.ts (1)
706-742: MCP entities missingisDiscoveredannotation.The
Wso2McpSummarytype includesisDiscovered?: boolean, and the UI (Wso2ApiManagerPage.tsxline 137) readswso2.com/is-discoveredfor MCP servers. However, MCP entities don't set this annotation, soisDiscoveredwill always befalsefor MCPs.If MCP servers can also be discovered, consider adding the annotation:
Proposed fix
metadata: { name: normalizedName, namespace, title: mcp.name, description: mcp.description || `WSO2 MCP Server: ${mcp.name}`, annotations: { 'backstage.io/managed-by-location': `wso2-apim:${this.id}`, 'backstage.io/managed-by-origin-location': `wso2-apim:${this.id}`, 'wso2.com/api-id': mcp.id || '', 'wso2.com/api-name': mcp.name || '', 'wso2.com/api-version': mcp.version || '', 'wso2.com/api-context': mcp.context || '', 'wso2.com/api-provider': mcp.provider || '', 'wso2.com/api-type': 'MCP', 'wso2.com/api-lifecycle-status': mcp.lifeCycleStatus || '', + 'wso2.com/is-discovered': mcp.initiatedFromGateway === true ? 'true' : 'false', 'wso2.com/is-mcp-server': 'true', 'wso2.com/api-raw-json': rawMcpJsonString, 'wso2.com/mcp-tools': mcp.tools ? JSON.stringify(mcp.tools) : '[]', 'wso2.com/api-documents': mcp.documents ? JSON.stringify(mcp.documents) : '[]', }, - tags: mcp.tags || [], + tags: [...(mcp.tags || []), ...(mcp.initiatedFromGateway === true ? ['wso2-discovered'] : [])], },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.ts` around lines 706 - 742, The MCP API entities built in the mcpList.map (producing mcpEntities) currently omit the 'wso2.com/is-discovered' annotation so UI reads always false; update the metadata.annotations in the Wso2ApiEntityProvider (the mcpList map / mcpEntities creation) to include 'wso2.com/is-discovered' and set its value from the source MCP object (e.g., use mcp.isDiscovered converted to 'true'/'false' or default to 'false' when absent) so the Wso2McpSummary.isDiscovered value is reflected in the resulting ApiEntity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.ts`:
- Around line 706-742: The MCP API entities built in the mcpList.map (producing
mcpEntities) currently omit the 'wso2.com/is-discovered' annotation so UI reads
always false; update the metadata.annotations in the Wso2ApiEntityProvider (the
mcpList map / mcpEntities creation) to include 'wso2.com/is-discovered' and set
its value from the source MCP object (e.g., use mcp.isDiscovered converted to
'true'/'false' or default to 'false' when absent) so the
Wso2McpSummary.isDiscovered value is reflected in the resulting ApiEntity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a09eee84-c0e3-4e70-9a58-463d4a390f96
📒 Files selected for processing (5)
plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.tsplugins/wso2-api-manager/src/api/types.tsplugins/wso2-api-manager/src/components/EntityWso2ApiDefinitionCard/EntityWso2ApiDefinitionCard.tsxplugins/wso2-api-manager/src/components/EntityWso2ApiDefinitionCard/styles.tsplugins/wso2-api-manager/src/components/Wso2ApiManagerPage/Wso2ApiManagerPage.tsx
Summary by CodeRabbit
New Features
Style