本文整理汇总了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
}
}
}
示例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;
}
示例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 }
);
}
示例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);
}
示例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});
}
示例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;
}
示例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);
}
示例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);
}
示例9: applyNullSafe
import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
@Override
protected Integer applyNullSafe(@Nonnull GHPullRequest input) {
return input.getNumber();
}