diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-05 00:10:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-05 00:10:19 +0300 |
commit | 9248363e3eb740b2f1dccb3a63f09aff4fcdf94f (patch) | |
tree | ee6b7e7122a3b6c9b21e4a163ad116e354cca483 /lib/gitlab/ci/charts.rb | |
parent | db3acec198e92833482b9ce5c055f562b06a14a1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/charts.rb')
-rw-r--r-- | lib/gitlab/ci/charts.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/ci/charts.rb b/lib/gitlab/ci/charts.rb index 25fb9c0ca97..797193a6be5 100644 --- a/lib/gitlab/ci/charts.rb +++ b/lib/gitlab/ci/charts.rb @@ -31,9 +31,10 @@ module Gitlab current = @from while current <= @to - @labels << current.strftime(@format) - @total << (totals_count[current] || 0) - @success << (success_count[current] || 0) + label = current.strftime(@format) + @labels << label + @total << (totals_count[label] || 0) + @success << (success_count[label] || 0) current += interval_step end @@ -45,6 +46,7 @@ module Gitlab query .group("date_trunc('#{interval}', #{::Ci::Pipeline.table_name}.created_at)") .count(:created_at) + .transform_keys { |date| date.strftime(@format) } end # rubocop: enable CodeReuse/ActiveRecord |