diff options
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index f9af342f47f..ae68a36c8d2 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -1716,8 +1716,6 @@ class MergeRequest < ApplicationRecord actual_head_pipeline&.complete_and_has_reports?(Ci::JobArtifact.of_report_type(:test)) end - # rubocop: disable Metrics/AbcSize - # Delete a rubocop annotation once FF truncate_ci_merge_request_description is cleaned up def predefined_variables Gitlab::Ci::Variables::Collection.new.tap do |variables| variables.append(key: 'CI_MERGE_REQUEST_ID', value: id.to_s) @@ -1730,14 +1728,9 @@ class MergeRequest < ApplicationRecord variables.append(key: 'CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED', value: ProtectedBranch.protected?(target_project, target_branch).to_s) variables.append(key: 'CI_MERGE_REQUEST_TITLE', value: title) - if ::Feature.enabled?(:truncate_ci_merge_request_description) - mr_description, mr_description_truncated = truncate_mr_description - variables.append(key: 'CI_MERGE_REQUEST_DESCRIPTION', value: mr_description) - variables.append(key: 'CI_MERGE_REQUEST_DESCRIPTION_IS_TRUNCATED', value: mr_description_truncated) - else - variables.append(key: 'CI_MERGE_REQUEST_DESCRIPTION', value: description) - end - + mr_description, mr_description_truncated = truncate_mr_description + variables.append(key: 'CI_MERGE_REQUEST_DESCRIPTION', value: mr_description) + variables.append(key: 'CI_MERGE_REQUEST_DESCRIPTION_IS_TRUNCATED', value: mr_description_truncated) variables.append(key: 'CI_MERGE_REQUEST_ASSIGNEES', value: assignee_username_list) if assignees.present? variables.append(key: 'CI_MERGE_REQUEST_MILESTONE', value: milestone.title) if milestone variables.append(key: 'CI_MERGE_REQUEST_LABELS', value: label_names.join(',')) if labels.present? @@ -1745,8 +1738,6 @@ class MergeRequest < ApplicationRecord variables.concat(source_project_variables) end end - # rubocop: enable Metrics/AbcSize - # Delete a rubocop annotation once FF truncate_ci_merge_request_description is cleaned up def compare_test_reports unless has_test_reports? @@ -2102,8 +2093,12 @@ class MergeRequest < ApplicationRecord true end + def allows_multiple_assignees? + project.allows_multiple_merge_request_assignees? + end + def allows_multiple_reviewers? - false + project.allows_multiple_merge_request_reviewers? end def supports_assignee? @@ -2198,6 +2193,8 @@ class MergeRequest < ApplicationRecord attr_accessor :skip_fetch_ref def merge_base_pipelines + return ::Ci::Pipeline.none unless actual_head_pipeline&.target_sha + target_branch_pipelines_for(sha: actual_head_pipeline.target_sha) end |