當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。