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


Java GHPullRequest.getNumber方法代码示例

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


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

示例1: waitForPullRequestToHaveMergable

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
public static Boolean waitForPullRequestToHaveMergable(GHPullRequest pullRequest, long sleepMS, long maximumTimeMS) throws IOException {
    long end = System.currentTimeMillis() + maximumTimeMS;
    while (true) {
        Boolean mergeable = pullRequest.getMergeable();
        if (mergeable == null) {
            GHRepository repository = pullRequest.getRepository();
            int number = pullRequest.getNumber();
            pullRequest = repository.getPullRequest(number);
            mergeable = pullRequest.getMergeable();
        }
        if (mergeable != null) {
            return mergeable;
        }
        if (System.currentTimeMillis() > end) {
            return null;
        }
        try {
            Thread.sleep(sleepMS);
        } catch (InterruptedException e) {
            // ignore
        }
    }
}
 
开发者ID:fabric8-updatebot,项目名称:updatebot,代码行数:24,代码来源:GitHubHelpers.java

示例2: check

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
@Override
public GitHubPRCause check(GitHubPRTrigger gitHubPRTrigger, @Nonnull GHPullRequest remotePR,
                           @CheckForNull GitHubPRPullRequest localPR, TaskListener listener) throws IOException {
    if (isNull(number)) {
        // skip the whole PR because we can't trust in other checks to not get unexpected triggers.
        listener.error(DISPLAY_NAME + ": number is null -> Bad configured event, skipping other checks.");
        return new GitHubPRCause(remotePR, "Bad configured " + DISPLAY_NAME + " event.", true);
    }
    // don't know whether it can happen, but let's be safe.
    if (isNull(remotePR)) {
        // skip the whole PR because we can't trust in other checks to not get unexpected triggers.
        listener.error(DISPLAY_NAME + ": number is null -> Bad configured event, skipping other checks.");
        return new GitHubPRCause(remotePR, "Bad configured " + DISPLAY_NAME + " event.", true);
    }

    if (remotePR.getNumber() == getNumber()) {
        if (match) {
            return new GitHubPRCause(remotePR, "PR Number is matching #" + remotePR.getNumber(), isSkip());
        }
    } else if (!match) {
        return new GitHubPRCause(remotePR, "PR Number is not matching #" + remotePR.getNumber(), isSkip());
    }

    return null;
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:26,代码来源:GitHubPRNumber.java

示例3: GhprcPullRequest

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
GhprcPullRequest(GHPullRequest pr, Ghprc helper, GhprcRepository repo) {
    id = pr.getNumber();
    try {
        updated = pr.getUpdatedAt();
    } catch (IOException e) {
        e.printStackTrace();
        updated = new Date();
    }
    head = pr.getHead().getSha();
    title = pr.getTitle();
    author = pr.getUser();
    reponame = repo.getName();
    target = pr.getBase().getRef();
    source = pr.getHead().getRef();
    url = pr.getHtmlUrl();
    this.pr = pr;
    obtainAuthorEmail(pr);

    this.helper = helper;
    this.repo = repo;

    logger.log(Level.INFO, "Created Pull Request #{0} on {1} by {2} ({3}) updated at: {4} SHA: {5}",
            new Object[] { id, reponame, author.getLogin(), authorEmail, updated, head }
    );
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:26,代码来源:GhprcPullRequest.java

示例4: toPullRequest

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
public static PullRequest toPullRequest(GHPullRequest object) {

        RepositoryInfo source = new RepositoryInfo(
                object.getHead().getUser().getLogin(),
                object.getHead().getRepository().getName(),
                object.getHead().getRef()
        );
        RepositoryInfo target = new RepositoryInfo(
                object.getBase().getUser().getLogin(),
                object.getBase().getRepository().getName(),
                object.getBase().getRef()
        );
        return new PullRequest(
                object.getNumber(),
                source,
                target);
    }
 
开发者ID:aslakknutsen,项目名称:github-merge,代码行数:18,代码来源:GithubUtil.java

示例5: GhprbPullRequest

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
GhprbPullRequest(GHPullRequest pr, Ghprb helper, GhprbRepository repo) {
	id = pr.getNumber();
	updated = pr.getUpdatedAt();
	head = pr.getHead().getSha();
	title = pr.getTitle();
	author = pr.getUser();
	reponame = repo.getName();
	target = pr.getBase().getRef();
	obtainAuthorEmail(pr);

	this.ml = helper;
	this.repo = repo;

	if(helper.isWhitelisted(author)){
		accepted = true;
		shouldRun = true;
	}else{
		logger.log(Level.INFO, "Author of #{0} {1} on {2} not in whitelist!", new Object[]{id, author.getLogin(), reponame});
		repo.addComment(id, GhprbTrigger.getDscp().getRequestForTestingPhrase());
	}

	logger.log(Level.INFO, "Created pull request #{0} on {1} by {2} ({3}) updated at: {4} SHA: {5}", new Object[]{id, reponame, author.getLogin(), authorEmail, updated, head});
}
 
开发者ID:ds2wang,项目名称:ghprb-copy,代码行数:24,代码来源:GhprbPullRequest.java

示例6: call

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
@Override
public Boolean call() throws Exception {
    for (GHPullRequest pr : repository.listPullRequests(GHIssueState.OPEN)) {
        if (pr.getNumber() == pullRequest.getNumber()) {
            LOG.debug("[WAIT] appeared PR {}, delay {} ms", pullRequest.getNumber(), currentTimeMillis() - startTime);
            return true;
        }
    }
    LOG.debug("[WAIT] no PR {}", pullRequest.getNumber());
    return false;
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:12,代码来源:GHPRAppeared.java

示例7: check

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
private void check(GHPullRequest pr) {
    final Integer id = pr.getNumber();
    GhprcPullRequest pull;
    if (pulls.containsKey(id)) {
        pull = pulls.get(id);
    } else {
        pulls.putIfAbsent(id, new GhprcPullRequest(pr, helper, this));
        pull = pulls.get(id);
    }
    pull.check(pr);
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:12,代码来源:GhprcRepository.java

示例8: check

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
private void check(GHPullRequest pr){
		Integer id = pr.getNumber();
		GhprbPullRequest pull;
		if(pulls.containsKey(id)){
			pull = pulls.get(id);
		}else{
			pull = new GhprbPullRequest(pr, ml, this);
			pulls.put(id, pull);
		}
		pull.check(pr);
}
 
开发者ID:ds2wang,项目名称:ghprb-copy,代码行数:12,代码来源:GhprbRepository.java

示例9: applyNullSafe

import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
@Override
protected Integer applyNullSafe(@Nonnull GHPullRequest input) {
    return input.getNumber();
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:5,代码来源:PRHelperFunctions.java


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