Skip to content

feat: implement WSO2 API Manager plugin with entity provider and UI c…#4

Merged
rithakith merged 1 commit into
feature/discoverabilityfrom
feature/discoverability-2
Apr 24, 2026
Merged

feat: implement WSO2 API Manager plugin with entity provider and UI c…#4
rithakith merged 1 commit into
feature/discoverabilityfrom
feature/discoverability-2

Conversation

@rithakith
Copy link
Copy Markdown
Owner

@rithakith rithakith commented Apr 24, 2026

Summary by CodeRabbit

  • New Features

    • Added "Discovered API" badge to identify APIs discovered from gateways
    • Introduced "Discovered" column in catalog table views (Yes/No indicator)
    • Enhanced gateway URL parsing and display for API endpoints
    • Disabled Swagger editor "Try it out" feature for discovered APIs
  • Style

    • Improved form input styling with enhanced color and border handling

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Type and Provider Updates
plugins/wso2-api-manager/src/api/types.ts, plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.ts
Added optional isDiscovered field to three API summary types. Provider now derives wso2.com/is-discovered and wso2.com/initiated-from-gateway annotations, and appends wso2-discovered tag when initiatedFromGateway is true.
API Definition Card Component
plugins/wso2-api-manager/src/components/EntityWso2ApiDefinitionCard/EntityWso2ApiDefinitionCard.tsx, plugins/wso2-api-manager/src/components/EntityWso2ApiDefinitionCard/styles.ts
Major refactor of gateway URL parsing from wso2.com/api-endpoints annotation with environment flattening. Disables Swagger "Try it out" and suppresses related UI for discovered APIs. Updated Swagger/OpenAPI rewriting to handle new gateway URL structure with multi-server entries and per-environment metadata. Added "Discovered API" badge to card title. Added CSS rules for form inputs with theme palette values.
API Manager Page
plugins/wso2-api-manager/src/components/Wso2ApiManagerPage/Wso2ApiManagerPage.tsx
Replaced "Provider" column with "Discovered" column across three tabular views (APIs, API Products, MCP Servers), displaying Yes/No based on isDiscovered property from wso2.com/is-discovered annotation.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~35 minutes

Possibly related PRs

  • rithakith/backstage#3: Modifies the same EntityWso2ApiDefinitionCard.tsx and Wso2ApiManagerPage.tsx components to add loading and placeholder UI patterns.

Poem

🐰 Discovered APIs now wear their badges bright,
Tags flutter in the wind, announcing their flight,
Gateways unified, no "Try it" for the found,
The discovered realm grows with each new bound!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main changes: implementing WSO2 API Manager plugin functionality with entity provider and UI components for handling discovered APIs.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/discoverability-2

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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 (1)
plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.ts (1)

706-742: MCP entities missing isDiscovered annotation.

The Wso2McpSummary type includes isDiscovered?: boolean, and the UI (Wso2ApiManagerPage.tsx line 137) reads wso2.com/is-discovered for MCP servers. However, MCP entities don't set this annotation, so isDiscovered will always be false for 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

📥 Commits

Reviewing files that changed from the base of the PR and between f9706d7 and b6db4e0.

📒 Files selected for processing (5)
  • plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.ts
  • plugins/wso2-api-manager/src/api/types.ts
  • plugins/wso2-api-manager/src/components/EntityWso2ApiDefinitionCard/EntityWso2ApiDefinitionCard.tsx
  • plugins/wso2-api-manager/src/components/EntityWso2ApiDefinitionCard/styles.ts
  • plugins/wso2-api-manager/src/components/Wso2ApiManagerPage/Wso2ApiManagerPage.tsx

@rithakith rithakith merged commit 51332a5 into feature/discoverability Apr 24, 2026
1 check 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.

1 participant