-
Notifications
You must be signed in to change notification settings - Fork 26
Add ListAppRepositories method to VCS
#154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ListRepositories(ctx context.Context) (map[string][]string, error) | ||
|
|
||
| // ListAppRepositories ListRepositories Returns a map between all accessible App to their list of repositories | ||
| ListAppRepositories(ctx context.Context) ([]AppRepositoryInfo, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What identifies a repository as an "App repository"? what is passed in the context that prevents getting all existing repositories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically it has more fields and context then our basic repository object.
this is again to not interfere with the current objects and logic and trying to separate them as much as possible for now.
I agree that they could be merged, but as this is changing by the demands, i wanted to keep them separated for now at least.
vcsclient/github.go
Outdated
| SSHURL: repo.GetSSHURL(), | ||
| DefaultBranch: repo.GetDefaultBranch(), | ||
| } | ||
| results = append(results, repoInfo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please ensure we cannot get nil pointer dereference (since you declare the results but doesn't init is using 'make')
eranturgeman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! please see my notes
|
@eranturgeman if you can merge this once you are ready. |

go fmt ./...for formatting the code before submitting the pull request.✨ Add ListAppRepositories Function to VCS Client Interface
This PR introduces a new function ListAppRepositories to the VcsClient interface, currently implemented only for GitHub.
✅ What It Does
• Adds support for fetching GitHub App-accessible repositories using the installation/repositories endpoint.
⚙️ Why Only GitHub?
Currently, GitHub is the only provider where:
• App-based repo access is a common pattern (via installations).
• There’s a clear, supported API endpoint for listing them.
The interface was designed to support future implementations for GitLab, Bitbucket, etc., once similar functionality is available or required.
📘 Usage Example