diff options
author | Robert Speicher <robert@gitlab.com> | 2016-05-23 16:55:59 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-05-25 11:42:37 +0200 |
commit | 5682320ff8fcd617bb1891628c6703444cd20ee4 (patch) | |
tree | dde7a4d3f13161d2d285bd7f3e69ad52182a3927 /lib | |
parent | 8a494ecd4288b93528b633f881a066a525c16825 (diff) | |
download | gitlab-ce-5682320ff8fcd617bb1891628c6703444cd20ee4.tar.gz |
Merge branch 'fix-ci-charts-error-500' into 'master'
Fix Error 500 in CI charts by gracefully handling commits with no durations
## What does this MR do?
In the CI charts, this MR reports the duration of a commit to 0 if it is `nil`.
## Are there points in the code the reviewer needs to double check?
Should we omit this commit from the chart or set it to some other value?
## Why was this MR needed?
We were getting an Error 500 here: https://gitlab.com/gitlab-org/gitlab-ce/graphs/master/ci
## What are the relevant issue numbers?
#17730
See merge request !4245
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ci/charts.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ci/charts.rb b/lib/ci/charts.rb index d53bdcbd0f2..e1636636934 100644 --- a/lib/ci/charts.rb +++ b/lib/ci/charts.rb @@ -64,7 +64,8 @@ module Ci commits.each do |commit| @labels << commit.short_sha - @build_times << (commit.duration / 60) + duration = commit.duration || 0 + @build_times << (duration / 60) end end end |