diff options
Diffstat (limited to 'app/controllers/projects/pipelines/tests_controller.rb')
-rw-r--r-- | app/controllers/projects/pipelines/tests_controller.rb | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/app/controllers/projects/pipelines/tests_controller.rb b/app/controllers/projects/pipelines/tests_controller.rb index f03274bf32e..1c212964df5 100644 --- a/app/controllers/projects/pipelines/tests_controller.rb +++ b/app/controllers/projects/pipelines/tests_controller.rb @@ -3,7 +3,6 @@ module Projects module Pipelines class TestsController < Projects::Pipelines::ApplicationController - before_action :validate_feature_flag! before_action :authorize_read_build! before_action :builds, only: [:show] @@ -29,29 +28,21 @@ module Projects private - def validate_feature_flag! - render_404 unless Feature.enabled?(:build_report_summary, project) - end - # rubocop: disable CodeReuse/ActiveRecord def builds - pipeline.latest_builds.where(id: build_params) + @builds ||= pipeline.latest_builds.for_ids(build_ids).presence || render_404 end - def build_params + def build_ids return [] unless params[:build_ids] params[:build_ids].split(",") end def test_suite - if builds.present? - builds.map do |build| - build.collect_test_reports!(Gitlab::Ci::Reports::TestReports.new) - end.sum - else - render_404 - end + builds.map do |build| + build.collect_test_reports!(Gitlab::Ci::Reports::TestReports.new) + end.sum end # rubocop: enable CodeReuse/ActiveRecord end |