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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allows fetching pull requests by knowing repo-name and owner.
  • Loading branch information
lucamilanesio committed Sep 27, 2013
commit 096c96550bb4921d7932b3dcad5f20b3de1a626a
11 changes: 11 additions & 0 deletions src/main/java/org/kohsuke/github/GHRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,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.

GHRepository repo = new GHRepository();
repo.root = root;
repo.name = repositoryName;
repo.owner = owner;
return repo.listPullRequests(state);
}

/**
* Retrieves the currently configured hooks.
*/
Expand Down