当前位置: 首页>>代码示例>>Java>>正文


Java GHIssue类代码示例

本文整理汇总了Java中org.kohsuke.github.GHIssue的典型用法代码示例。如果您正苦于以下问题:Java GHIssue类的具体用法?Java GHIssue怎么用?Java GHIssue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GHIssue类属于org.kohsuke.github包,在下文中一共展示了GHIssue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: perform

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
@Override
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher,
                    @Nonnull TaskListener listener) throws InterruptedException, IOException {
    if (getStatusVerifier() != null && !getStatusVerifier().isRunAllowed(run)) {
        return;
    }
    try {
        HashSet<String> remoteLabels = new HashSet<>();
        final GHIssue ghIssue = getGhIssue(run);
        //remote labels List -> Set
        ghIssue.getLabels().stream()
                .map(GHLabel::getName)
                .collect(Collectors.toList())
                .forEach(remoteLabels::add);

        remoteLabels.addAll(getLabelProperty().getLabelsSet());
        ghIssue.setLabels(remoteLabels.toArray(new String[remoteLabels.size()]));
    } catch (IOException ex) {
        final int number = getPRNumberFromPRCause(run);
        listener.getLogger().println("Couldn't add label for PR #" + number + ex.getMessage());
        LOGGER.error("Couldn't add label for PR #{}", number, ex);
        handlePublisherError(run);
    }
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:25,代码来源:GitHubPRLabelAddPublisher.java

示例2: getMockReleasenotesMessages

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
private static List<ReleaseNotesMessage> getMockReleasenotesMessages()
        throws NoSuchFieldException, IllegalAccessException {
    final List<ReleaseNotesMessage> messages = new ArrayList<>();

    final ReleaseNotesMessage msgWithoutIssueNo =
        new ReleaseNotesMessage("Mock issue title 1", "Author 1");
    messages.add(msgWithoutIssueNo);

    final ReleaseNotesMessage msgWithoutIssueNoWithMultipleAuthors =
        new ReleaseNotesMessage("Mock issue title 2", "Author 3, Author 4");
    messages.add(msgWithoutIssueNoWithMultipleAuthors);

    final GHIssue issue1 = getMockGithubIssue(123, "Mock issue title 3");
    final ReleaseNotesMessage msgWithIssueNo = new ReleaseNotesMessage(issue1, "Author 5");
    messages.add(msgWithIssueNo);

    final GHIssue issue2 = getMockGithubIssue(123, "Mock issue title 4");
    final ReleaseNotesMessage msgWithIssueNoWithMultipleAuthors =
        new ReleaseNotesMessage(issue2, "Author 6, Author 7");
    messages.add(msgWithIssueNoWithMultipleAuthors);

    return messages;
}
 
开发者ID:checkstyle,项目名称:contribution,代码行数:24,代码来源:TemplateProcessorTest.java

示例3: syncIssue

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
private static boolean syncIssue(final GHRepository rep, final int issueId, final String body) {
    try {
        GHIssue issue = rep.getIssue(issueId);
        issue.setBody(body);
        return true;
    }
    catch (Exception e) {
        e.printStackTrace();
    }

    return false;
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:13,代码来源:SyncDocsToGithubSubCommand.java

示例4: getOrFindIssue

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
protected GHIssue getOrFindIssue(CommandContext context, GHRepository ghRepository) throws IOException {
    GHIssue issue = context.getIssue();
    if (issue == null) {
        List<GHIssue> issues = Issues.getOpenIssues(ghRepository, context.getConfiguration());
        issue = Issues.findIssue(context, issues);
        context.setIssue(issue);
    }
    return issue;
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:10,代码来源:CommandSupport.java

示例5: updatePendingChanges

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
public void updatePendingChanges(CommandContext context, DependenciesCheck check, List<DependencyVersionChange> pendingChanges) throws IOException {
    Configuration configuration = context.getConfiguration();
    List<DependencyVersionChange> currentPendingChanges = check.getInvalidChanges();
    GHRepository ghRepository = context.gitHubRepository();
    if (ghRepository != null) {
        GHIssue issue = getOrFindIssue(context, ghRepository);
        if (currentPendingChanges.equals(pendingChanges)) {
            if (issue != null) {
                LOG.debug("Pending changes unchanged so not modifying the issue");
            }
            return;
        }
        String operationDescrption = getOperationDescription(context);
        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();
            }
            return;
        }
        if (issue == null) {
            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()));
        }
        Issues.addConflictsComment(issue, currentPendingChanges, operationDescrption, check);
    } else {
        // TODO what to do with vanilla git repos?
    }
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:34,代码来源:ModifyFilesCommandSupport.java

示例6: loadPendingChanges

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
protected List<DependencyVersionChange> loadPendingChanges(CommandContext context) throws IOException {
    GHRepository ghRepository = context.gitHubRepository();
    if (ghRepository != null) {
        List<GHIssue> issues = Issues.getOpenIssues(ghRepository, context.getConfiguration());
        GHIssue issue = Issues.findIssue(context, issues);
        if (issue != null) {
            context.setIssue(issue);
            return Issues.loadPendingChangesFromIssue(context, issue);
        }
    } else {
        // TODO what to do with vanilla git repos?
    }
    return new ArrayList<>();
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:15,代码来源:ModifyFilesCommandSupport.java

示例7: getIssues

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
public List<GHIssue> getIssues() {
    List<GHIssue> answer = new ArrayList<>();
    for (CommandContext child : children) {
        GHIssue issue = child.getIssue();
        if (issue != null) {
            answer.add(issue);
        }
    }
    return answer;
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:11,代码来源:ParentContext.java

示例8: StatusInfo

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
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;
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:15,代码来源:StatusInfo.java

示例9: getOpenIssues

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
public static List<GHIssue> getOpenIssues(GHRepository ghRepository, String label) throws IOException {
    List<GHIssue> issues = retryGithub(() -> ghRepository.getIssues(GHIssueState.OPEN));
    List<GHIssue> answer = new ArrayList<>();
    for (GHIssue issue : issues) {
        if (GitHubHelpers.hasLabel(getLabels(issue), label) && !issue.isPullRequest()) {
            answer.add(issue);
        }
    }
    return answer;
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:11,代码来源:Issues.java

示例10: loadPendingChangesFromIssue

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
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);
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:16,代码来源:Issues.java

示例11: findIssue

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
/**
 * Lets try find the issue
 */
public static GHIssue findIssue(CommandContext context, List<GHIssue> issues) {
    String prefix = context.createIssueTitlePrefix();
    if (issues != null) {
        for (GHIssue issue : issues) {
            String title = issue.getTitle();
            if (title != null && title.startsWith(prefix)) {
                return issue;
            }
        }
    }
    return null;
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:16,代码来源:Issues.java

示例12: isOpen

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
public static boolean isOpen(GHIssue issue) {
    GHIssueState state = issue.getState();
    if (state == null) {
        return true;
    }
    return state == GHIssueState.OPEN;
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:8,代码来源:Issues.java

示例13: assertOpenIssueAndPullRequestCount

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
public void assertOpenIssueAndPullRequestCount(String repoName, int expectedIssueCount, int exepectedPullRequestCount, boolean verbose) throws IOException {
    LocalRepository repository = assertLocalRepository(repoName);

    GHRepository gitHubRepository = GitHubHelpers.getGitHubRepository(repository);
    assertThat(gitHubRepository).describedAs("Not a GitHub repository " + repository).isNotNull();

    String label = configuration.getGithubPullRequestLabel();

    List<GHIssue> issues;
    List<GHPullRequest> prs;

    boolean doAssert = true;
    if (doAssert) {
        issues = GithubAssertions.assertOpenIssueCount(gitHubRepository, label, expectedIssueCount);
        prs = GithubAssertions.assertOpenPullRequestCount(gitHubRepository, label, exepectedPullRequestCount);
    } else {
        issues = Issues.getOpenIssues(gitHubRepository, configuration);
        prs = PullRequests.getOpenPullRequests(gitHubRepository, configuration);
    }

    if (verbose) {
        LOG.warn("===> " + gitHubRepository.getName() + " Issue count: " + issues.size() + " PR count: " + prs.size());

        Issues.logOpen(issues);
        PullRequests.logOpen(prs);
    }
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:28,代码来源:ForkJoinReleaseTest.java

示例14: removeGHIssue

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
public static void removeGHIssue(GHRepository repo, String user, int issueID)
		throws IOException {
	GHIssue issue = repo.getIssue(issueID);
	if (isSlackIssue(issue)) {
		issue.comment("Closed by " + user);
		issue.close();
	}
}
 
开发者ID:eraether,项目名称:WatchWordBot,代码行数:9,代码来源:GitHubHelper.java

示例15: isSlackIssue

import org.kohsuke.github.GHIssue; //导入依赖的package包/类
public static boolean isSlackIssue(GHIssue issue) throws IOException {
	for (GHLabel label : issue.getLabels()) {
		for (String slackLabel : getSlackLabels()) {
			if (label.getName().equalsIgnoreCase(slackLabel)) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:eraether,项目名称:WatchWordBot,代码行数:11,代码来源:GitHubHelper.java


注:本文中的org.kohsuke.github.GHIssue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。