use of argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.GitLabMergeRequestFilter in project gitlab-branch-source-plugin by Argelbargel.
the class SourceHeads method retrieveMergeRequests.
private void retrieveMergeRequests(@CheckForNull SCMSourceCriteria criteria, @Nonnull SCMHeadObserver observer, @Nonnull TaskListener listener) throws IOException, InterruptedException {
branchesWithMergeRequestsCache = new HashMap<>();
if (source.getProject().isMergeRequestsEnabled() && source.getSourceSettings().shouldMonitorMergeRequests()) {
log(listener, Messages.GitLabSCMSource_retrievingMergeRequests());
GitLabMergeRequestFilter filter = source.getSourceSettings().createMergeRequestFilter(listener);
for (GitLabMergeRequest mr : filter.filter(api().getMergeRequests(source.getProjectId()))) {
checkInterrupt();
if (!source.isExcluded(mr.getTargetBranch())) {
observe(criteria, observer, mr, listener);
}
}
}
}
use of argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.GitLabMergeRequestFilter in project gitlab-branch-source-plugin by Argelbargel.
the class GitLabSCMSourceSettings method createMergeRequestFilter.
public GitLabMergeRequestFilter createMergeRequestFilter(TaskListener listener) {
GitLabMergeRequestFilter filter = GitLabMergeRequestFilter.ALLOW_NONE;
if (originMonitorStrategy.getMonitored()) {
GitLabMergeRequestFilter originFilter = new AllowMergeRequestsFromOrigin(listener);
if (originMonitorStrategy.getIgnoreWorkInProgress()) {
originFilter = originFilter.and(new FilterWorkInProgress(listener));
}
filter = filter.or(originFilter);
}
if (forksMonitorStrategy.getMonitored()) {
GitLabMergeRequestFilter forkFilter = new AllowMergeRequestsFromForks(listener);
if (forksMonitorStrategy.getIgnoreWorkInProgress()) {
forkFilter = forkFilter.and(new FilterWorkInProgress(listener));
}
filter = filter.or(forkFilter);
}
return filter;
}
Aggregations