Search in sources :

Example 1 with AllowMergeRequestsFromForks

use of argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.AllowMergeRequestsFromForks 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;
}
Also used : AllowMergeRequestsFromOrigin(argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.AllowMergeRequestsFromOrigin) GitLabMergeRequestFilter(argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.GitLabMergeRequestFilter) FilterWorkInProgress(argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.FilterWorkInProgress) AllowMergeRequestsFromForks(argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.AllowMergeRequestsFromForks)

Aggregations

AllowMergeRequestsFromForks (argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.AllowMergeRequestsFromForks)1 AllowMergeRequestsFromOrigin (argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.AllowMergeRequestsFromOrigin)1 FilterWorkInProgress (argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.FilterWorkInProgress)1 GitLabMergeRequestFilter (argelbargel.jenkins.plugins.gitlab_branch_source.api.filters.GitLabMergeRequestFilter)1