/** * @inheritDoc */ @Override public PullRequest openPullRequest(GithubPrRequest request) { RepositoryService repositoryService = new RepositoryService(); repositoryService.getClient().setCredentials(request.getUsername(), request.getPassword()); org.eclipse.egit.github.core.Repository openmrs = null; try { openmrs = repositoryService.getRepository(OPENMRS_USER, request.getRepository()); } catch (IOException e) { throw new RuntimeException("Failed to get repository data", e); } PullRequestService pullRequestService = new PullRequestService(); pullRequestService.getClient().setCredentials(request.getUsername(), request.getPassword()); PullRequest pr = new org.eclipse.egit.github.core.PullRequest(); pr.setTitle(request.getTitle()); pr.setHead(new PullRequestMarker().setLabel(request.getHead())); pr.setBase(new PullRequestMarker().setLabel(request.getBase())); pr.setBody(request.getDescription()); try { return pullRequestService.createPullRequest(openmrs, pr); } catch (IOException e) { throw new RuntimeException("Failed to create pull request:"+pr, e); } }