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

API consistency in gh-repos for selecting from user / repo #34

Open
dgtized opened this issue Jul 28, 2014 · 0 comments
Open

API consistency in gh-repos for selecting from user / repo #34

dgtized opened this issue Jul 28, 2014 · 0 comments

Comments

@dgtized
Copy link

dgtized commented Jul 28, 2014

In a number of places in gh-repos the following forms are used to access the user / repo to fetch.

(format "/repos/%s/%s/forks"
                       (oref (oref repo :owner) :login)
                       (oref repo :name))

instead of

(format "/users/%s/gists" (or username (gh-api-get-username api)))
;; or
(format "/repos/%s/%s/pulls/%s" user repo id)

This approach is useful if the repo has already been fetched with gh-repos-repo-get, but is more difficulty to fetch from scratch. It also makes it much more difficult to explore the API when starting out, as the need to pass in the object instead of the string is undocumented. It appears that a number of the other apis just take the user repo pair, and allow a stub to update if needed (gh-issues, and gh-pulls in particular take this approach).

I'm happy to swap over gh-repos to use that approach, but wasn't sure if there was a historical reason, and what code depended on it. Is there a preferred, consistent approach?

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

No branches or pull requests

1 participant