diff options
Diffstat (limited to 'app/serializers/merge_request_widget_entity.rb')
-rw-r--r-- | app/serializers/merge_request_widget_entity.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb index 44cbcfc5044..e46b269ea35 100644 --- a/app/serializers/merge_request_widget_entity.rb +++ b/app/serializers/merge_request_widget_entity.rb @@ -67,15 +67,15 @@ class MergeRequestWidgetEntity < Grape::Entity ) end - expose :user_callouts_path, if: -> (_, opts) { opts[:experiment_enabled] == :suggest_pipeline } do |_merge_request| + expose :user_callouts_path, if: -> (*) { Feature.enabled?(:suggest_pipeline, default_enabled: true) } do |_merge_request| user_callouts_path end - expose :suggest_pipeline_feature_id, if: -> (_, opts) { opts[:experiment_enabled] == :suggest_pipeline } do |_merge_request| + expose :suggest_pipeline_feature_id, if: -> (*) { Feature.enabled?(:suggest_pipeline, default_enabled: true) } do |_merge_request| SUGGEST_PIPELINE end - expose :is_dismissed_suggest_pipeline, if: -> (_, opts) { opts[:experiment_enabled] == :suggest_pipeline } do |_merge_request| + expose :is_dismissed_suggest_pipeline, if: -> (*) { Feature.enabled?(:suggest_pipeline, default_enabled: true) } do |_merge_request| current_user && current_user.dismissed_callout?(feature_name: SUGGEST_PIPELINE) end @@ -129,7 +129,7 @@ class MergeRequestWidgetEntity < Grape::Entity end expose :security_reports_docs_path do |merge_request| - help_page_path('user/application_security/sast/index.md', anchor: 'reports-json-format') + help_page_path('user/application_security/index.md', anchor: 'viewing-security-scan-information-in-merge-requests') end private @@ -151,6 +151,10 @@ class MergeRequestWidgetEntity < Grape::Entity can?(current_user, :create_pipeline, merge_request.source_project) end + def use_merge_base_with_merged_results? + object.actual_head_pipeline&.merge_request_event_type == :merged_result + end + def head_pipeline_downloadable_path_for_report_type(file_type) object.head_pipeline&.present(current_user: current_user) &.downloadable_path_for_report_type(file_type) @@ -161,11 +165,6 @@ class MergeRequestWidgetEntity < Grape::Entity &.downloadable_path_for_report_type(file_type) end - def use_merge_base_with_merged_results? - Feature.enabled?(:merge_base_pipelines, object.target_project) && - object.actual_head_pipeline&.merge_request_event_type == :merged_result - end - def merge_base_pipeline_downloadable_path_for_report_type(file_type) object.merge_base_pipeline&.present(current_user: current_user) &.downloadable_path_for_report_type(file_type) |