diff --git a/ee/app/controllers/concerns/ee/cycle_analytics_params.rb b/ee/app/controllers/concerns/ee/cycle_analytics_params.rb index 0219db54843f65e4210097851cb0a176055b9bcc..ce7343eb229abcc68782f682bfddee7c5cdf7346 100644 --- a/ee/app/controllers/concerns/ee/cycle_analytics_params.rb +++ b/ee/app/controllers/concerns/ee/cycle_analytics_params.rb @@ -12,6 +12,8 @@ def options(params) options[:branch] = params[:branch_name] options[:projects] = params[:project_ids] if params[:project_ids] options[:group] = params[:group_id] if params[:group_id] + options[:from] = params[:from] if params[:from] + options[:to] = params[:to] if params[:to] options.merge!(params.slice(*::Gitlab::Analytics::CycleAnalytics::RequestParams::FINDER_PARAM_NAMES)) end end diff --git a/ee/changelogs/unreleased/fix-passing-vsa-param-in-summary.yml b/ee/changelogs/unreleased/fix-passing-vsa-param-in-summary.yml new file mode 100644 index 0000000000000000000000000000000000000000..41c2f694ec6da54bd06262d7d600d71a8dcbd848 --- /dev/null +++ b/ee/changelogs/unreleased/fix-passing-vsa-param-in-summary.yml @@ -0,0 +1,5 @@ +--- +title: Fix passing date params in VSA Summary request +merge_request: 35152 +author: +type: fixed diff --git a/ee/spec/controllers/analytics/cycle_analytics/summary_controller_spec.rb b/ee/spec/controllers/analytics/cycle_analytics/summary_controller_spec.rb index 5bc3599fe0a96a4fbca8e73beb55c320b11ba4fc..9542618076609e260c29cc58089f3c14e9290cfe 100644 --- a/ee/spec/controllers/analytics/cycle_analytics/summary_controller_spec.rb +++ b/ee/spec/controllers/analytics/cycle_analytics/summary_controller_spec.rb @@ -31,6 +31,17 @@ subject { get :show, params: params } it_behaves_like 'summary endpoint' + + it 'passes the date filter to the query class' do + expected_date_range = { + created_after: Date.parse(params[:created_after]).at_beginning_of_day, + created_before: Date.parse(params[:created_before]).at_end_of_day + } + + expect(IssuesFinder).to receive(:new).with(user, hash_including(expected_date_range)).and_call_original + + subject + end end describe 'GET "time_summary"' do