diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 17:26:22 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-13 17:26:22 +0200 |
commit | 3d38e461918e75e719938801ae2d63aae680a85c (patch) | |
tree | f2b7d44824aafe954724176abc50a1cdb364d9be /app/models/concerns | |
parent | 9e68109f2d454dd05cf42a03a41a2e858e1e11bc (diff) | |
download | gitlab-ce-3d38e461918e75e719938801ae2d63aae680a85c.tar.gz |
Support skipped status
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/ci_status.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/concerns/ci_status.rb b/app/models/concerns/ci_status.rb index 67e15b2d55b..fd86d2f7553 100644 --- a/app/models/concerns/ci_status.rb +++ b/app/models/concerns/ci_status.rb @@ -12,12 +12,14 @@ module CiStatus pending = all.pending.select('count(*)').to_sql running = all.running.select('count(*)').to_sql canceled = all.canceled.select('count(*)').to_sql + skipped = all.skipped.select('count(*)').to_sql deduce_status = "(CASE WHEN (#{builds})=0 THEN 'skipped' WHEN (#{builds})=(#{success})+(#{ignored}) THEN 'success' WHEN (#{builds})=(#{pending}) THEN 'pending' WHEN (#{builds})=(#{canceled}) THEN 'canceled' + WHEN (#{builds})=(#{skipped}) THEN 'skipped' WHEN (#{running})+(#{pending})>0 THEN 'running' ELSE 'failed' END)" @@ -52,6 +54,7 @@ module CiStatus scope :success, -> { where(status: 'success') } scope :failed, -> { where(status: 'failed') } scope :canceled, -> { where(status: 'canceled') } + scope :skipped, -> { where(status: 'skipped') } scope :running_or_pending, -> { where(status: [:running, :pending]) } scope :finished, -> { where(status: [:success, :failed, :canceled]) } end |