Skip to content
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

Add organization repositories to project selection #42

Open
kimmobrunfeldt opened this issue Apr 23, 2015 · 4 comments
Open

Add organization repositories to project selection #42

kimmobrunfeldt opened this issue Apr 23, 2015 · 4 comments

Comments

@kimmobrunfeldt
Copy link
Contributor

GitHub API returns only personal repositories. It should return organization repositories too nowadays.

@una
Copy link

una commented Apr 24, 2015

@lauweijie may have an idea of how to fix this -- The Design Guidelines board solves this https://github.com/DesignOpen/design-guidelines-board

@lauweijie
Copy link
Member

Multiple API calls are required to list all organization repositories.

  1. Get all organizations associated with user
  2. For each organizaion, get all repositories with write privileges

This might take awhile to enumerate if the user has many organizations -- which was why I decided to load only personal repos and the list of organizations first. Organization's repos are fetched only when requested.

Caching could also help to reduce the number of API calls made to GitHub.

@kimmobrunfeldt
Copy link
Contributor Author

I was hoping to not have to do that. https://developer.github.com/v3/repos/#list-user-repositories they say in the api docs that:

With the new Organization Permissions API (described below), this will include repositories owned by organizations which the user can access. If you provide the custom media type (described below), you won’t need to use other APIs to list the authenticated user’s organization-owned repositories.

@kimmobrunfeldt
Copy link
Contributor Author

I was wondering if this behavior is also possible when fetching repos for arbitrary user. I tried the custom Access header they guide to, but no luck. I think the migration period has already ended anywsy so no need for custom header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants