diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-08 10:58:41 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-08 10:58:41 +0100 |
commit | 14ad75a176639ca83067ba1b45aab38ba115e5bf (patch) | |
tree | 8394c1e54c102b4f55cf7913888e991cab444768 /app/models/ci | |
parent | cb19fd140fda6fd8adc05a00889e7567cabcaa62 (diff) | |
download | gitlab-ce-14ad75a176639ca83067ba1b45aab38ba115e5bf.tar.gz |
Fix `passed with warnings` stage status on MySQL
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/pipeline.rb | 2 | ||||
-rw-r--r-- | app/models/ci/stage.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 67206415f7b..8a5a9aa4adb 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -144,7 +144,7 @@ module Ci status_sql = statuses.latest.where('stage=sg.stage').status_sql - warnings_sql = statuses.latest.select('COUNT(*) > 0') + warnings_sql = statuses.latest.select('COUNT(*)') .where('stage=sg.stage').failed_but_allowed.to_sql stages_with_statuses = CommitStatus.from(stages_query, :sg) diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb index ca74c91b062..b60bb9c6de0 100644 --- a/app/models/ci/stage.rb +++ b/app/models/ci/stage.rb @@ -46,10 +46,10 @@ module Ci end def has_warnings? - if @warnings.nil? - statuses.latest.failed_but_allowed.any? + if @warnings.is_a?(Fixnum) + @warnings > 0 else - @warnings + statuses.latest.failed_but_allowed.any? end end end |