private List<String> toStringBranches(Collection<GitlabBranch> branches) { List<String> list = new ArrayList<>(branches.size()); for (GitlabBranch branch : branches) { list.add(branch.getName()); } return list; }
private void observe(SCMSourceCriteria criteria, @Nonnull SCMHeadObserver observer, GitlabBranch branch, TaskListener listener) throws IOException, InterruptedException { log(listener, Messages.GitLabSCMSource_monitoringBranch(branch.getName())); boolean hasMergeRequest = branchesWithMergeRequests(NULL).containsValue(branch.getName()); if (hasMergeRequest && !source.getSourceSettings().getBranchMonitorStrategy().getBuildBranchesWithMergeRequests()) { log(listener, Messages.GitLabSCMSource_willNotBuildBranchWithMergeRequest(branch.getName())); } observe(criteria, observer, createBranch(source.getProjectId(), branch.getName(), branch.getCommit().getId(), hasMergeRequest), listener); }
private String retrieveBranchRevision(String name) throws GitLabAPIException { return api().getBranch(source.getProjectId(), name).getCommit().getId(); }
private void retrieveBranches(@CheckForNull SCMSourceCriteria criteria, @Nonnull SCMHeadObserver observer, @Nonnull TaskListener listener) throws InterruptedException, IOException { if (source.getSourceSettings().getBranchMonitorStrategy().getMonitored()) { log(listener, Messages.GitLabSCMSource_retrievingBranches()); for (GitlabBranch branch : api().getBranches(source.getProjectId())) { checkInterrupt(); if (!source.isExcluded(branch.getName())) { observe(criteria, observer, branch, listener); } } } }