fetch repos using direct organization query instead of search API
Hello, I'm facing an issue when querying public repos for HudHud-Maps org, it's a weird issue it only happens with this org, I tried a PFA/Github App from the same org and I can only see the private repos, and when I use a PFA from a user out side of this org I can't see any public repo.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
But this actually doesn't work for querying normal users repos(not orgs)
But this actually doesn't work for querying normal users repos(not orgs)
Any suggestion on which approach should we use since both approaches are not covering all use cases?
Hello @malhomaid Sorry for such a late reply. I'm don't quite understand the issue. So let me tell what I understand and please correct me if something is wrong
After spending time with graphql, rest api and access tokens etc I see the problem.
I don't quite undertand how we should build the graphql query to get what we want. In graphql query we asked org: <owner>. That was a problem since HudHud-Maps organization has forked repositories. Somehow those weren't in the result. Your change is fixing the problem but then only organization repositories can be fetched. A user's repositories cannot be fetched. I played a little bit and saw that rest api is much more welcoming. I'd say we can drop graphql querying and lean on rest api. Would you mind making these changes?
See:
- https://github.com/google/go-github/blob/master/github/repos.go#L402-L418
- https://github.com/google/go-github/blob/master/github/repos.go#L292-L311