-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fix GET /users/:username/repos endpoint #2125
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
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.
Is it not possible to combine these like they were before with an explicit check for ctx.User being equal to the user passed in? And only when they are equal displaying accessibleRepos as well as ownRepos? It feels like theres a lot of recycled code...
@awwalker No, because |
@ethantkoenig Hm ok I am confused as to why not then. Can you explain please? |
@awwalker The canned answer: because that's how Github's API is, and we try to match the Github API as closely as possible My longer answer: which seems like a cleaner and more concise specification?
There is already an endpoint for listing the repos that you have access to ( |
@ethantkoenig Awesome. Thanks for going above the canned response! And I see how this is still usable for orgs. |
With a quick overview and addition of tests I trust you for LGTM. |
LGTM |
|
||
type searchResponseBody struct { | ||
ok bool | ||
data []api.Repository |
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.
You can't use un-exported values in decode function.
Fixes the following bugs in the
GET /users/:username/repos
endpoint::username
, regardless of whether this was actually trueAlso improve existing integration tests to check that responses are expected.