feat: add public connections API and repository filtering - #1550
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds ChangesPublic connection APIs
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ConnectionsRoute
participant listConnections
participant RepositoryQuery
Client->>ConnectionsRoute: GET /api/connections
ConnectionsRoute->>listConnections: Request visible connections
listConnections->>RepositoryQuery: Query visible repositories
RepositoryQuery-->>listConnections: Return repository connections
listConnections-->>ConnectionsRoute: Return unique sorted connections
ConnectionsRoute-->>Client: Return JSON response
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
d892993 to
5d019f3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5d6da1b. Configure here.
5d6da1b to
ffeb8c3
Compare
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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 `@CHANGELOG.md`:
- Line 27: Move the PR `#1550` changelog entry from the released 5.1.6 section to
the bottom of the applicable [Unreleased] section, preserving its wording and
link.
🪄 Autofix
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 Plus
Run ID: 167f928b-27ba-467f-9cea-db589fbea7e1
📒 Files selected for processing (13)
CHANGELOG.mddocs/api-reference/sourcebot-public.openapi.jsondocs/docs.jsonpackages/web/src/app/api/(server)/connections/listConnectionsApi.test.tspackages/web/src/app/api/(server)/connections/listConnectionsApi.tspackages/web/src/app/api/(server)/connections/route.tspackages/web/src/app/api/(server)/repos/listReposApi.test.tspackages/web/src/app/api/(server)/repos/listReposApi.tspackages/web/src/app/api/(server)/repos/route.tspackages/web/src/lib/schemas.tspackages/web/src/lib/types.tspackages/web/src/openapi/publicApiDocument.tspackages/web/src/openapi/publicApiSchemas.ts

Fixes SOU-1870
Summary
Test plan
Stack created with GitHub Stacks CLI
Note
Low Risk
Additive public read APIs that reuse existing optional-auth and repo-scoping patterns; no new credential exposure beyond id/name/type metadata.
Overview
Adds GET
/api/connections, which returns deduplicated code-host connection metadata (id,name,connectionType) for connections tied to at least one repository the caller can see. Listing goes through visible repos so the scoped Prisma client applies the same visibility rules as repository APIs; credentials and connection config are not returned.GET
/api/reposgains an optionalconnectionIdquery parameter (positive integer, IDs from the connections endpoint). Repository queries andX-Total-Countuse a sharedwhereclause, and paginationLinkheaders preserveconnectionIdwhen present.Public OpenAPI, docs navigation, and changelog are updated; service tests cover connection deduplication and connection-based repo filtering.
Reviewed by Cursor Bugbot for commit 5d019f3. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
connectionIdfiltering to the repository listing API.