Commit 5ae4d1a8 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'refactor-pipeline-process-limit-check' into 'master'

Move pipeline process limit check to a dedicated method

See merge request gitlab-org/gitlab!67080
parents c3fba0a6 6a3ef40d
......@@ -51,7 +51,7 @@ module Git
change: change,
push_options: params[:push_options],
merge_request_branches: merge_request_branches,
create_pipelines: change[:index] < PIPELINE_PROCESS_LIMIT || Feature.enabled?(:git_push_create_all_pipelines, project),
create_pipelines: under_process_limit?(change),
execute_project_hooks: execute_project_hooks,
create_push_event: !create_bulk_push_event
).execute
......@@ -60,6 +60,10 @@ module Git
create_bulk_push_event(ref_type, action, changes) if create_bulk_push_event
end
def under_process_limit?(change)
change[:index] < PIPELINE_PROCESS_LIMIT || Feature.enabled?(:git_push_create_all_pipelines, project)
end
def create_bulk_push_event(ref_type, action, changes)
EventCreateService.new.bulk_push(
project,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment