public Collection<PullRequest> getOpenPullRequests(final IRepositoryIdProvider repository) { Collection<PullRequest> pullrequests = null; try { pullrequests = service.getPullRequests(repository, IssueService.STATE_OPEN); } catch (IOException e) { log.error("IOException in getOpenPullRequests {} {}", new Object[]{repository.generateId(), e}); } return pullrequests; }
public Collection<PullRequest> getClosedPullRequests(final IRepositoryIdProvider repository) { Collection<PullRequest> pullrequests = null; try { pullrequests = service.getPullRequests(repository, IssueService.STATE_CLOSED); } catch (IOException e) { log.error("IOException in getOpenPullRequests {} {}", new Object[]{repository.generateId(), e}); } return pullrequests; }
public PullRequestConsumer(GitHubEndpoint endpoint, Processor processor) throws Exception { super(endpoint, processor); Registry registry = endpoint.getCamelContext().getRegistry(); Object service = registry.lookupByName(GitHubConstants.GITHUB_PULL_REQUEST_SERVICE); if (service != null) { LOG.debug("Using PullRequestService found in registry {}", service.getClass().getCanonicalName()); pullRequestService = (PullRequestService) service; } else { pullRequestService = new PullRequestService(); } initService(pullRequestService); LOG.info("GitHub PullRequestConsumer: Indexing current pull requests..."); List<PullRequest> pullRequests = pullRequestService.getPullRequests(getRepository(), "open"); if (pullRequests.size() > 0) { lastOpenPullRequest = pullRequests.get(0).getNumber(); } }
@Override protected int poll() throws Exception { List<PullRequest> openPullRequests = pullRequestService.getPullRequests(getRepository(), "open");
/** * @inheritDoc */ @Override public PullRequest getPullRequestIfExists(String base, String head, String repository) { RepositoryService repositoryService = new RepositoryService(); org.eclipse.egit.github.core.Repository openmrs = null; boolean exists = false; try { openmrs = repositoryService.getRepository(OPENMRS_USER, repository); PullRequestService pullRequestService = new PullRequestService(); List<PullRequest> openPRs = pullRequestService.getPullRequests(openmrs, "open"); for(PullRequest openPR : openPRs){ if(matchPullRequest(base, head, openPR)){ return openPR; } } } catch (IOException e) { throw new RuntimeException("Failed to access remote repository data",e); } return null; }
List<PullRequest> pullRequests = pullRequestService.getPullRequests(getRepository(), "open");
List<PullRequest> pullRequests = pullRequestService.getPullRequests(getRepository(), "open"); for (PullRequest pullRequest : pullRequests) { List<CommitComment> commitComments = pullRequestService.getComments(getRepository(),