summaryrefslogtreecommitdiff
path: root/app/controllers/projects/ci/daily_build_group_report_results_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/ci/daily_build_group_report_results_controller.rb')
-rw-r--r--app/controllers/projects/ci/daily_build_group_report_results_controller.rb49
1 files changed, 7 insertions, 42 deletions
diff --git a/app/controllers/projects/ci/daily_build_group_report_results_controller.rb b/app/controllers/projects/ci/daily_build_group_report_results_controller.rb
index aabcb74cefa..fee216da492 100644
--- a/app/controllers/projects/ci/daily_build_group_report_results_controller.rb
+++ b/app/controllers/projects/ci/daily_build_group_report_results_controller.rb
@@ -1,11 +1,6 @@
# frozen_string_literal: true
class Projects::Ci::DailyBuildGroupReportResultsController < Projects::ApplicationController
- include Gitlab::Utils::StrongMemoize
-
- MAX_ITEMS = 1000
- REPORT_WINDOW = 90.days
-
before_action :authorize_read_build_report_results!
before_action :validate_param_type!
@@ -40,53 +35,23 @@ class Projects::Ci::DailyBuildGroupReportResultsController < Projects::Applicati
end
def report_results
- if ::Gitlab::Ci::Features.use_coverage_data_new_finder?(project)
- ::Ci::Testing::DailyBuildGroupReportResultsFinder.new(
- params: new_finder_params,
- current_user: current_user
- ).execute
- else
- Ci::DailyBuildGroupReportResultsFinder.new(**finder_params).execute
- end
+ ::Ci::DailyBuildGroupReportResultsFinder.new(
+ params: finder_params,
+ current_user: current_user
+ ).execute
end
- def new_finder_params
+ def finder_params
{
project: project,
coverage: true,
- start_date: start_date,
- end_date: end_date,
+ start_date: params[:start_date],
+ end_date: params[:end_date],
ref_path: params[:ref_path],
sort: true
}
end
- def finder_params
- {
- current_user: current_user,
- project: project,
- ref_path: params.require(:ref_path),
- start_date: start_date,
- end_date: end_date,
- limit: MAX_ITEMS
- }
- end
-
- def start_date
- strong_memoize(:start_date) do
- start_date = Date.parse(params.require(:start_date))
-
- # The start_date cannot be older than `end_date - 90 days`
- [start_date, end_date - REPORT_WINDOW].max
- end
- end
-
- def end_date
- strong_memoize(:end_date) do
- Date.parse(params.require(:end_date))
- end
- end
-
def allowed_param_types
Ci::DailyBuildGroupReportResult::PARAM_TYPES
end