Skip to content

feat: add public connections API and repository filtering - #1550

Open
brendan-kellam wants to merge 3 commits into
sou-1870-scoped-access-tokensfrom
sou-1870-list-connections
Open

feat: add public connections API and repository filtering#1550
brendan-kellam wants to merge 3 commits into
sou-1870-scoped-access-tokensfrom
sou-1870-list-connections

Conversation

@brendan-kellam

@brendan-kellam brendan-kellam commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Fixes SOU-1870

Summary

  • add GET /api/connections with connection metadata scoped through repositories visible to the caller
  • add an optional connectionId filter to GET /api/repos, including pagination and count handling
  • publish both behaviors in the public OpenAPI specification
  • add focused service tests for connection listing and repository filtering

Test plan

  • yarn workspace @sourcebot/web test src/app/api/(server)/connections/listConnectionsApi.test.ts src/app/api/(server)/repos/listReposApi.test.ts --run
  • yarn workspace @sourcebot/web exec eslint on the changed TypeScript files
  • yarn workspace @sourcebot/web openapi:generate

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/repos gains an optional connectionId query parameter (positive integer, IDs from the connections endpoint). Repository queries and X-Total-Count use a shared where clause, and pagination Link headers preserve connectionId when 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.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b1279bda-6c75-4af2-b561-8bc10c92b0f5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

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

@brendan-kellam brendan-kellam changed the title sou 1870 list connections feat: add public connections API and repository filtering Aug 6, 2026
@brendan-kellam
brendan-kellam force-pushed the sou-1870-list-connections branch from 00a6f7a to d892993 Compare August 6, 2026 18:59
@brendan-kellam
brendan-kellam force-pushed the sou-1870-list-connections branch from d892993 to 5d019f3 Compare August 6, 2026 19:17
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