Or we could simply ignore skipped manual jobs
This commit is contained in:
parent
6053acf5e6
commit
f3b02b9e6e
2 changed files with 7 additions and 2 deletions
|
@ -21,7 +21,7 @@ module HasStatus
|
|||
|
||||
deduce_status = "(CASE
|
||||
WHEN (#{builds})=(#{created}) THEN 'created'
|
||||
WHEN (#{builds})=(#{skipped}) THEN 'success'
|
||||
WHEN (#{builds})=(#{skipped}) THEN 'skipped'
|
||||
WHEN (#{builds})=(#{success})+(#{ignored})+(#{skipped}) THEN 'success'
|
||||
WHEN (#{builds})=(#{created})+(#{pending})+(#{skipped}) THEN 'pending'
|
||||
WHEN (#{builds})=(#{canceled})+(#{success})+(#{ignored})+(#{skipped}) THEN 'canceled'
|
||||
|
|
|
@ -61,7 +61,12 @@ module Ci
|
|||
end
|
||||
|
||||
def status_for_prior_stages(index)
|
||||
pipeline.builds.where('stage_idx < ?', index).latest.status || 'success'
|
||||
quoted_when = pipeline.builds.connection.quote_column_name('when')
|
||||
pipeline.builds.
|
||||
where('stage_idx < ?', index).
|
||||
# We want to ignore skipped manual jobs
|
||||
where("#{quoted_when} <> ? OR status <> ?", 'manual', 'skipped').
|
||||
latest.status || 'success'
|
||||
end
|
||||
|
||||
def stage_indexes_of_created_builds
|
||||
|
|
Loading…
Reference in a new issue