Auto-discover connector documentation links via docs sitemap - #45
Conversation
📝 WalkthroughWalkthroughThe PR replaces the per-URL Suggested Reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 1
🤖 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 `@src/lib/connector-utils/connector-utils.ts`:
- Around line 666-669: The catch handler attempting to reset sitemapPromise to
null is unreachable because the async IIFE wrapping the sitemap fetch logic
catches all errors internally and always resolves successfully, so the promise
never rejects. To fix this, modify the inner catch block within the async IIFE
to rethrow the error after handling it (or throw a new error), which will cause
the outer promise to reject and allow the .catch() handler on sitemapPromise to
execute and properly reset the variable for retry on the next call.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 839c775f-9d45-4b7d-90cd-f9612ca7da13
📒 Files selected for processing (3)
src/lib/connector-utils/connector-utils.tssrc/lib/connector-utils/index.tssrc/pages/ConnectorDetailPage.tsx
| 'aws.s3': `${DOCS_BASE}/storage-file/aws.s3/aws-s3-connector-overview`, | ||
| azure_storage_service: `${DOCS_BASE}/storage-file/azure_storage_service/overview`, | ||
| 'microsoft.onedrive': `${DOCS_BASE}/storage-file/microsoft.onedrive/microsoft-onedrive-connector-overview`, | ||
| 'microsoft.sharepoint.pages': `${DOCS_BASE}/storage-file/microsoft.sharepoint.pages/connector-overview`, |
There was a problem hiding this comment.
Don't we need to add the microsoft.sharepoint.sites connector as well?
There was a problem hiding this comment.
No need. This will be discovered automatically. Going forward, we don't need to add it.
Description
Fixes: wso2/product-integrator#1731
Summary
Previously, every new connector required a manual change to CONNECTOR_DOCS in connector-utils.ts to add a Documentation button to its detail page. This PR removes that requirement by auto-discovering published doc pages from the docs site's sitemap.
How it works
promise.
Also fixed
Test plan