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

Allows to define page size for repository lists and other API enhancements #45

Merged
merged 4 commits into from
Nov 3, 2013

Conversation

lucamilanesio
Copy link
Contributor

Extension of the listRepositories() with the desired
pageSize. This allows to reduce the number of calls
to GitHub API for fetching the entire set of repositories
browsing all the pages.

Additionally allows to match the UX paging with the
underlying GitHub API paging, increasing performance
and reducing hourly API allowance.

Last addition was on the GitHub PullRequest object:
allows to get the associated commits with their
details (which is unfortunately NOT a GHCommit object)

Extension of the listRepositories() with the desired
pageSize. This allows to reduce the number of calls
to GitHub API for fetching the entire set of repositories
browsing all the pages.

Additionally allows to match the UX paging with the
underlying GitHub API paging, increasing performance
and reducing hourly API allowance.
@buildhive
Copy link

Kohsuke Kawaguchi » github-api #95 SUCCESS
This pull request looks good
(what's this?)

When GitHub repositories are associated to organisations,
the owner is NOT the user but the org itself.
@buildhive
Copy link

Kohsuke Kawaguchi » github-api #96 SUCCESS
This pull request looks good
(what's this?)

@buildhive
Copy link

Kohsuke Kawaguchi » github-api #97 FAILURE
Looks like there's a problem with this pull request
(what's this?)

Retrieves the list of commits included in the pull request.
Commit object returned is not a full GHCommit and includes
just a small subset of information.
@buildhive
Copy link

Kohsuke Kawaguchi » github-api #101 SUCCESS
This pull request looks good
(what's this?)

@buildhive
Copy link

Kohsuke Kawaguchi » github-api #102 SUCCESS
This pull request looks good
(what's this?)

@@ -379,6 +379,17 @@ protected void wrapUp(GHPullRequest[] page) {
}

/**
* Retrieves all the pull requests of a particular state by knowing organisation and repository
*/
public static PagedIterable<GHPullRequest> listPullRequests(final GitHub root, final GHPerson owner, final String repositoryName, final GHIssueState state) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I know why you wanted methods like this (to avoid unnecessary REST API calls to getRepository()), but I don't want the library to become full of these short-cuts.

To address this without cluttering the API, I think we need to defer the REST call to retrieve the state of the repository. So I tweaked your commits and removed this method. I hope you are OK with this for the time being.

kohsuke added a commit that referenced this pull request Nov 3, 2013
@kohsuke kohsuke merged commit 19ec332 into hub4j:master Nov 3, 2013
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

Successfully merging this pull request may close these issues.

3 participants