fix(github): Fix issue with users not getting picked up in GitHub config#428
fix(github): Fix issue with users not getting picked up in GitHub config#428brendan-kellam merged 3 commits intomainfrom
users not getting picked up in GitHub config#428Conversation
WalkthroughA changelog entry was added to document a fix for recognizing Changes
Sequence Diagram(s)sequenceDiagram
participant ConfigLoader
participant BackendGithub
participant GitHubAPI
ConfigLoader->>BackendGithub: getGitHubReposFromConfig(users, token)
BackendGithub->>GitHubAPI: search.repos (query by user, paginated)
GitHubAPI-->>BackendGithub: List of repositories
BackendGithub-->>ConfigLoader: Aggregated repository results
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Problem
Consider the following config:
{ "$schema": "./schemas/v3/index.json", "connections": { "sourcebot": { "type": "github", "users": [ "brendan-kellam", "torvalds" ], "token": { "env": "GITHUB_SB_TOKEN" } } } }Assume
GITHUB_SB_TOKENwas scoped to my (brendan-kellam) user. We would expect to get all public & private repos frombrendan-kellam, and all public repos fromtorvalds. In actuality, we were just getting the repos forbrendan-kellam.Why? We were using
listForAuthenticatedUserwhen a token is specified, which only lists the repositories for the currently authenticated user (brendan-kellam), even when ausernameis specified. So, when we called this fortorvalds, we were actually getting repos forbrendan-kellam.Solution
This discussion recommended using the
search/repositoriesendpoint, so I switched to that.Summary by CodeRabbit