public static void closePullRequests(List<GHPullRequest> pullRequests) throws IOException { for (GHPullRequest pullRequest : pullRequests) { pullRequest.close(); } }
public static void closePullRequests(List<GHPullRequest> pullRequests) throws IOException { for (GHPullRequest pullRequest : pullRequests) { pullRequest.close(); } }
public void closePullRequest(int id) { try { GHRepository repo = getGitHubRepo(); GHPullRequest pr = repo.getPullRequest(id); pr.close(); } catch (IOException ex) { LOGGER.log(Level.SEVERE, "Could not close the pull request #" + id + ": '", ex); } }
@Test(dependsOnMethods = "testStoreUpdate") public void testAsUser() throws Exception { GHRepository repo = github.getOrganization(ORG).getRepository(NAME); List<GHPullRequest> prs = repo.getPullRequests(GHIssueState.OPEN); Assert.assertTrue(prs.size() == 1); for (GHPullRequest pr : prs) { pr.merge("Automatic merge through itests."); pr.close(); } try (InputStream stream = repo.getFileContent("Dockerfile").read(); InputStreamReader streamR = new InputStreamReader(stream); BufferedReader reader = new BufferedReader(streamR)) { String line; while ((line = reader.readLine()) != null) { if (line.contains("FROM")) { Assert.assertTrue(line.contains(IMAGE)); Assert.assertTrue(line.endsWith(TAG)); } } } }
public GHRepository closeOutdatedPullRequestAndFork(GHRepository parent) throws IOException { for (GHRepository fork : parent.listForks()) { String forkOwner = fork.getOwnerName(); GHMyself myself = gitHubUtil.getMyself(); String myselfLogin = myself.getLogin(); if (forkOwner.equals(myselfLogin)) { GHPullRequest pr = getPullRequestWithPullReqIdentifier(parent); // Only reason we close the existing PR, delete fork and re-fork, is because there is no way to // determine if the existing fork is compatible with it's parent. if (pr != null) { // close the pull-request since the fork is out of date log.info("closing existing pr: {}", pr.getUrl()); try { pr.close(); } catch (IOException e) { log.info("Issues closing the pull request '{}'. Moving ahead...", pr.getUrl()); } } // delete fork if one already exists before re-forking gitHubUtil.safeDeleteRepo(fork); } } log.info("Forking repo: {}", parent); return gitHubUtil.createFork(parent); }
public GHRepository closeOutdatedPullRequestAndFork(GHRepository parent) throws IOException { for (GHRepository fork : parent.listForks()) { String forkOwner = fork.getOwnerName(); GHMyself myself = gitHubUtil.getMyself(); String myselfLogin = myself.getLogin(); if (forkOwner.equals(myselfLogin)) { GHPullRequest pr = getPullRequestWithPullReqIdentifier(parent); // Only reason we close the existing PR, delete fork and re-fork, is because there is no way to // determine if the existing fork is compatible with it's parent. if (pr != null) { // close the pull-request since the fork is out of date log.info("closing existing pr: {}", pr.getUrl()); try { pr.close(); } catch (IOException e) { log.info("Issues closing the pull request '{}'. Moving ahead...", pr.getUrl()); } } // delete fork if one already exists before re-forking gitHubUtil.safeDeleteRepo(fork); } } log.info("Forking repo: {}", parent); return gitHubUtil.createFork(parent); }