本文整理汇总了Java中org.gitlab.api.models.GitlabMergeRequest类的典型用法代码示例。如果您正苦于以下问题:Java GitlabMergeRequest类的具体用法?Java GitlabMergeRequest怎么用?Java GitlabMergeRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GitlabMergeRequest类属于org.gitlab.api.models包,在下文中一共展示了GitlabMergeRequest类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMergeRequestSummaries
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
@Override
public List<MergeRequestSummary> getMergeRequestSummaries() throws GitLabApiException {
List<MergeRequestSummary> mergeRequestSummaries = new ArrayList<>();
try {
for (GitlabProject project : client.getProjects()) {
for (GitlabMergeRequest mergeRequest : client.getOpenMergeRequests(project)) {
List<GitlabNote> notes = client.getAllNotes(mergeRequest);
mergeRequestSummaries.add(new MergeRequestSummary(project, mergeRequest, notes));
}
}
} catch (IOException e) {
throw new GitLabApiException(e);
}
return mergeRequestSummaries;
}
示例2: postComments
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
private void postComments(GitlabMergeRequest mergeRequest, SonarReport report){
//we just care about the new issues
List<SonarIssue> newIssues = report.getNewIssues();
LOGGER.log(Level.INFO, "Number of new issues: {0}", newIssues.size());
String comment = "";
for (SonarIssue issue : newIssues){
if(comment.length() > 0){
//we need to a few lines
comment = comment + " \n";
}
comment = comment + issueMarkup(issue);
}
comment = headerFooterMarkup(report, getMessageHeader())
+ comment
+ headerFooterMarkup(report, getMessageFooter());
LOGGER.log(Level.INFO, "Creating note on Gitlab.");
Gitlab.createNote(mergeRequest, comment);
}
示例3: setFromProjectMergeRequestAndNotes
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
private void setFromProjectMergeRequestAndNotes(GitlabProject gitlabProject, GitlabMergeRequest gitlabMergeRequest, List<GitlabNote> notes) {
this.projectId = gitlabProject.getId();
this.mergeRequestId = gitlabMergeRequest.getId();
this.projectName = gitlabProject.getName();
this.description = gitlabMergeRequest.getDescription();
this.upVotes = gitlabMergeRequest.getUpvotes();
this.updatedAt = gitlabMergeRequest.getUpdatedAt();
this.createdBy = getMergeRequestAuthor(gitlabMergeRequest);
this.assignedTo = getMergeRequestAssignee(gitlabMergeRequest);
this.commenters = getCommenterList(notes);
this.upVotes = getUpVoteCount(notes, gitlabMergeRequest);
this.passed = this.upVotes >= 2;
}
示例4: getMergeRequestAuthor
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
private String getMergeRequestAuthor(GitlabMergeRequest gitlabMergeRequest) {
String createdBy = null;
if (gitlabMergeRequest.getAuthor() != null) {
createdBy = gitlabMergeRequest.getAuthor().getName();
}
return createdBy;
}
示例5: getMergeRequestAssignee
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
private String getMergeRequestAssignee(GitlabMergeRequest gitlabMergeRequest) {
String assignedTo = null;
if (gitlabMergeRequest.getAssignee() != null) {
assignedTo = gitlabMergeRequest.getAssignee().getName();
}
return assignedTo;
}
示例6: getUpVoteCount
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
private Integer getUpVoteCount(List<GitlabNote> notes, GitlabMergeRequest mergeRequest) {
Integer upVoteCount = 0;
for (GitlabNote note : notes) {
if (checkIfUpvote(note, mergeRequest.getAuthor())) {
upVoteCount += 1;
}
}
return upVoteCount;
}
示例7: getMergeRequestSummary
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
@Override
public MergeRequestSummary getMergeRequestSummary(Integer projectId, Integer mergeRequestId) throws GitLabApiException {
MergeRequestSummary mergeRequestSummary;
try {
GitlabProject gitlabProject = client.getProject(projectId);
GitlabMergeRequest mergeRequest = client.getMergeRequest(gitlabProject,mergeRequestId);
List<GitlabNote> notes = client.getAllNotes(mergeRequest);
mergeRequestSummary = new MergeRequestSummary(gitlabProject,mergeRequest,notes);
} catch (IOException e) {
throw new GitLabApiException(e);
}
return mergeRequestSummary;
}
示例8: createNote
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
public static GitlabNote createNote(GitlabMergeRequest mergeRequest, String message) {
try {
return get().createNote(mergeRequest, message);
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Failed to create note for merge request " + mergeRequest.getId(), e);
return null;
}
}
示例9: MergeRequestSummary
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
public MergeRequestSummary(GitlabProject project, GitlabMergeRequest gitlabMergeRequest, List<GitlabNote> notes) {
this.setFromProjectMergeRequestAndNotes(project, gitlabMergeRequest, notes);
}
示例10: getMergeRequest
import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
public static GitlabMergeRequest getMergeRequest(String projectPath, int mergeRequestId) throws IOException {
GitlabProject project = Gitlab.getProject(projectPath);
return Gitlab.getMergeRequest(project, mergeRequestId);
}