Package org.gitlab.api.models

Examples of org.gitlab.api.models.GitlabCommit


            return;
        }
        try {
            GitlabAPI api = _builder.getGitlab().get();
            GitlabNote lastJenkinsNote = getJenkinsNote(gitlabMergeRequest, api);
            GitlabCommit latestCommit = getLatestCommit(gitlabMergeRequest, api);

            if (lastJenkinsNote == null) {
                _logger.info("Latest note from Jenkins is null");
                _shouldRun = true;
            } else if (latestCommit == null) {
                _logger.log(Level.SEVERE, "Failed to determine the lastest commit for merge request {" + gitlabMergeRequest.getId() + "}. This might be caused by a stalled MR in gitlab.");
                return;
            } else {
                _logger.info("Latest note from Jenkins: " + lastJenkinsNote.getId().toString());
                _shouldRun = latestCommitIsNotReached(latestCommit);
                _logger.info("Latest commit: " + latestCommit.getId());
            }
            if (_shouldRun) {
                _logger.info("Build is supposed to run");
                _mergeRequestStatus.setLatestCommitOfMergeRequest(_id.toString(), latestCommit.getId());
            }
        } catch (IOException e) {
            _logger.log(Level.SEVERE, "Failed to fetch commits for Merge Request " + gitlabMergeRequest.getId());
        }
View Full Code Here


    // Get a specific commit identified by the commit hash or name of a branch or tag
    // GET /projects/:id/repository/commits/:sha
    public GitlabCommit getCommit(String projectId, String commitHash) throws IOException {
        String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + "/repository/commits/" + commitHash;
        GitlabCommit commit = retrieve().to(tailUrl, GitlabCommit.class);
        return commit;
    }
View Full Code Here

TOP

Related Classes of org.gitlab.api.models.GitlabCommit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.