public static void logOpen(List<GHIssue> issues) { for (GHIssue issue : issues) { LOG.info("Open issue " + issue.getHtmlUrl()); } }
public static void logOpen(List<GHIssue> issues) { for (GHIssue issue : issues) { LOG.info("Open issue " + issue.getHtmlUrl()); } }
public FormValidation doTestComment( @QueryParameter("serverAPIUrl") final String serverAPIUrl, @QueryParameter("credentialsId") final String credentialsId, @QueryParameter("repo") final String repoName, @QueryParameter("issueId") final int issueId, @QueryParameter("message1") final String comment) { try { GitHubBuilder builder = getBuilder(null, serverAPIUrl, credentialsId); if (builder == null) { return FormValidation.error("Unable to look up GitHub credentials using ID: " + credentialsId + "!!"); } GitHub gh = builder.build(); GHRepository repo = gh.getRepository(repoName); GHIssue issue = repo.getIssue(issueId); issue.comment(comment); return FormValidation.ok("Issued comment to issue: " + issue.getHtmlUrl()); } catch (Exception ex) { return FormValidation.error("Unable to issue comment: " + ex); } }
public static List<DependencyVersionChange> loadPendingChangesFromIssue(CommandContext context, GHIssue issue) throws IOException { List<GHIssueComment> comments = issue.getComments(); String lastCommand = null; for (GHIssueComment comment : comments) { String command = updateBotIssuePendingChangesComment(context, comment); if (command != null) { lastCommand = command; } } if (lastCommand == null) { LOG.warn("No UpdateBot comment found on issue " + issue.getHtmlUrl()); return new ArrayList<>(); } return parseUpdateBotIssuePendingChangesComment(lastCommand); }
public static List<DependencyVersionChange> loadPendingChangesFromIssue(CommandContext context, GHIssue issue) throws IOException { List<GHIssueComment> comments = issue.getComments(); String lastCommand = null; for (GHIssueComment comment : comments) { String command = updateBotIssuePendingChangesComment(context, comment); if (command != null) { lastCommand = command; } } if (lastCommand == null) { LOG.warn("No UpdateBot comment found on issue " + issue.getHtmlUrl()); return new ArrayList<>(); } return parseUpdateBotIssuePendingChangesComment(lastCommand); }
private void addIssueClosedCommentIfRequired(CommandContext context, GHPullRequest pullRequest, boolean create) { GHIssue issue = context.getIssue(); if (issue == null) { return; } if (!create) { // avoid duplicate comment try { List<GHIssueComment> comments = pullRequest.getComments(); for (GHIssueComment comment : comments) { String body = comment.getBody(); if (body != null && body.startsWith(PullRequests.ISSUE_LINK_COMMENT)) { return; } } } catch (IOException e) { // ignore } } try { pullRequest.comment(PullRequests.ISSUE_LINK_COMMENT + " " + issue.getHtmlUrl() + PullRequests.ISSUE_LINK_COMMENT_SUFFIX); } catch (IOException e) { // ignore } }
private void addIssueClosedCommentIfRequired(CommandContext context, GHPullRequest pullRequest, boolean create) { GHIssue issue = context.getIssue(); if (issue == null) { return; } if (!create) { // avoid duplicate comment try { List<GHIssueComment> comments = pullRequest.getComments(); for (GHIssueComment comment : comments) { String body = comment.getBody(); if (body != null && body.startsWith(PullRequests.ISSUE_LINK_COMMENT)) { return; } } } catch (IOException e) { // ignore } } try { pullRequest.comment(PullRequests.ISSUE_LINK_COMMENT + " " + issue.getHtmlUrl() + PullRequests.ISSUE_LINK_COMMENT_SUFFIX); } catch (IOException e) { // ignore } }
if (currentPendingChanges.isEmpty()) { if (issue != null) { context.info(LOG, "Closing issue as we have no further pending issues " + issue.getHtmlUrl()); issue.comment(Issues.CLOSE_MESSAGE + operationDescrption); issue.close(); issue = Issues.createIssue(context, ghRepository); context.setIssue(issue); context.info(LOG, configuration.colored(Configuration.COLOR_PENDING, "Created issue " + issue.getHtmlUrl())); } else { context.info(LOG, configuration.colored(Configuration.COLOR_PENDING, "Modifying issue " + issue.getHtmlUrl()));
if (currentPendingChanges.isEmpty()) { if (issue != null) { context.info(LOG, "Closing issue as we have no further pending issues " + issue.getHtmlUrl()); issue.comment(Issues.CLOSE_MESSAGE + operationDescrption); issue.close(); issue = Issues.createIssue(context, ghRepository); context.setIssue(issue); context.info(LOG, configuration.colored(Configuration.COLOR_PENDING, "Created issue " + issue.getHtmlUrl())); } else { context.info(LOG, configuration.colored(Configuration.COLOR_PENDING, "Modifying issue " + issue.getHtmlUrl()));
public StatusInfo(LocalRepository repository, Status status, GHIssue issue, GHPullRequest pullRequest) { this.repository = repository; this.issue = issue; this.pullRequest = pullRequest; this.issueUrl = (issue != null) ? Strings.toString(issue.getHtmlUrl()) : null; this.pullRequestUrl = (pullRequest != null) ? Strings.toString(pullRequest.getHtmlUrl()) : null; this.cloneUrl = repository.getCloneUrl(); this.issueState = state(issue); this.pullRequestState = state(pullRequest); if (nullOrClosed(issueState) && nullOrClosed(pullRequestState) && status.equals(Status.PENDING)) { status = Status.COMPLETE; } this.status = status; }
public StatusInfo(LocalRepository repository, Status status, GHIssue issue, GHPullRequest pullRequest) { this.repository = repository; this.issue = issue; this.pullRequest = pullRequest; this.issueUrl = (issue != null) ? Strings.toString(issue.getHtmlUrl()) : null; this.pullRequestUrl = (pullRequest != null) ? Strings.toString(pullRequest.getHtmlUrl()) : null; this.cloneUrl = repository.getCloneUrl(); this.issueState = state(issue); this.pullRequestState = state(pullRequest); if (nullOrClosed(issueState) && nullOrClosed(pullRequestState) && status.equals(Status.PENDING)) { status = Status.COMPLETE; } this.status = status; }