Skip to content

Conversation

@brendan-kellam
Copy link
Contributor

Cache external account IDs in the Repo table to enable immediate multi-provider repo access upon account linking and reduce permission sync overhead.

This PR introduces a cachedPermittedExternalAccounts JSONB field to the Repo table. The repoPermissionSyncer now populates this field with external account IDs for each provider (e.g., {"github": ["123", "456"], "gitlab": ["789"]}). A new utility function, rebuildPermissionsFromCache, is integrated into the authentication flow to grant repo permissions instantly when an external account is linked or updated, leveraging this cached data. This ensures users gain access without waiting for a full permission sync and supports a multi-provider architecture.


Slack Thread

Open in Cursor Open in Web

…r support

- Add cachedPermittedExternalAccounts JSON field to Repo table
- Update repoPermissionSyncer to cache external account IDs during sync
- Add TypeScript schema for cached external accounts structure
- Create utility functions to rebuild join table from cached data
- Integrate permission rebuild into auth flow for new account linking
- Support multiple provider types (GitHub, GitLab, etc.)

Co-authored-by: brendan <brendan@sourcebot.dev>
@cursor
Copy link

cursor bot commented Feb 2, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Important

Review skipped

Draft detected.

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.

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

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/multi-provider-repo-access-e130

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 and usage tips.

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.

3 participants