summaryrefslogtreecommitdiff
path: root/app/controllers/projects/graphs_controller.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /app/controllers/projects/graphs_controller.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/controllers/projects/graphs_controller.rb')
-rw-r--r--app/controllers/projects/graphs_controller.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb
index 889dcefb65a..34246f27241 100644
--- a/app/controllers/projects/graphs_controller.rb
+++ b/app/controllers/projects/graphs_controller.rb
@@ -28,6 +28,7 @@ class Projects::GraphsController < Projects::ApplicationController
def charts
get_commits
get_languages
+ get_daily_coverage_options
end
def ci
@@ -52,6 +53,27 @@ class Projects::GraphsController < Projects::ApplicationController
end
end
+ def get_daily_coverage_options
+ return unless Feature.enabled?(:ci_download_daily_code_coverage, default_enabled: true)
+
+ date_today = Date.current
+ report_window = Projects::Ci::DailyBuildGroupReportResultsController::REPORT_WINDOW
+
+ @daily_coverage_options = {
+ base_params: {
+ start_date: date_today - report_window,
+ end_date: date_today,
+ ref_path: @project.repository.expand_ref(@ref),
+ param_type: 'coverage'
+ },
+ download_path: namespace_project_ci_daily_build_group_report_results_path(
+ namespace_id: @project.namespace,
+ project_id: @project,
+ format: :csv
+ )
+ }
+ end
+
def fetch_graph
@commits = @project.repository.commits(@ref, limit: 6000, skip_merges: true)
@log = []