Commit 1e96ce27 authored by drew cimino's avatar drew cimino

Remove date window restriction from CoverageReportsController

parent 0dca5bc9
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
class Groups::Analytics::CoverageReportsController < Groups::Analytics::ApplicationController class Groups::Analytics::CoverageReportsController < Groups::Analytics::ApplicationController
check_feature_flag Gitlab::Analytics::CYCLE_ANALYTICS_FEATURE_FLAG check_feature_flag Gitlab::Analytics::CYCLE_ANALYTICS_FEATURE_FLAG
REPORT_WINDOW = 90.days.freeze
COVERAGE_PARAM = 'coverage'.freeze COVERAGE_PARAM = 'coverage'.freeze
before_action :load_group before_action :load_group
...@@ -17,10 +16,6 @@ class Groups::Analytics::CoverageReportsController < Groups::Analytics::Applicat ...@@ -17,10 +16,6 @@ class Groups::Analytics::CoverageReportsController < Groups::Analytics::Applicat
private private
def validate_param_type!
respond_422 unless allowed_param_types.include?(param_type)
end
def render_csv(collection) def render_csv(collection)
CsvBuilders::SingleBatch.new( CsvBuilders::SingleBatch.new(
collection, collection,
...@@ -42,27 +37,8 @@ class Groups::Analytics::CoverageReportsController < Groups::Analytics::Applicat ...@@ -42,27 +37,8 @@ class Groups::Analytics::CoverageReportsController < Groups::Analytics::Applicat
current_user: current_user, current_user: current_user,
group: @group, group: @group,
ref_path: params.require(:ref_path), ref_path: params.require(:ref_path),
start_date: start_date, start_date: Date.parse(params.require(:start_date)),
end_date: end_date end_date: Date.parse(params.require(:end_date))
} }
end 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
end end
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