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


Java GitlabMergeRequest类代码示例

本文整理汇总了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;
}
 
开发者ID:KainosSoftwareLtd,项目名称:gov-inspectacle,代码行数:17,代码来源:MergeRequestSummariserImpl.java

示例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);
}
 
开发者ID:jkschoen,项目名称:jenkins-gitlab-merge-request-sonar-plugin,代码行数:20,代码来源:GitlabSonarReporter.java

示例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;
}
 
开发者ID:KainosSoftwareLtd,项目名称:gov-inspectacle,代码行数:14,代码来源:MergeRequestSummary.java

示例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;
}
 
开发者ID:KainosSoftwareLtd,项目名称:gov-inspectacle,代码行数:8,代码来源:MergeRequestSummary.java

示例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;
}
 
开发者ID:KainosSoftwareLtd,项目名称:gov-inspectacle,代码行数:8,代码来源:MergeRequestSummary.java

示例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;
}
 
开发者ID:KainosSoftwareLtd,项目名称:gov-inspectacle,代码行数:10,代码来源:MergeRequestSummary.java

示例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;
}
 
开发者ID:KainosSoftwareLtd,项目名称:gov-inspectacle,代码行数:15,代码来源:MergeRequestSummariserImpl.java

示例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;
    }
}
 
开发者ID:jkschoen,项目名称:jenkins-gitlab-merge-request-sonar-plugin,代码行数:9,代码来源:Gitlab.java

示例9: MergeRequestSummary

import org.gitlab.api.models.GitlabMergeRequest; //导入依赖的package包/类
public MergeRequestSummary(GitlabProject project, GitlabMergeRequest gitlabMergeRequest, List<GitlabNote> notes) {
    this.setFromProjectMergeRequestAndNotes(project, gitlabMergeRequest, notes);
}
 
开发者ID:KainosSoftwareLtd,项目名称:gov-inspectacle,代码行数:4,代码来源:MergeRequestSummary.java

示例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);
}
 
开发者ID:jkschoen,项目名称:jenkins-gitlab-merge-request-sonar-plugin,代码行数:5,代码来源:Gitlab.java


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