Commit f3b02b9e authored by Lin Jen-Shin's avatar Lin Jen-Shin

Or we could simply ignore skipped manual jobs

parent 6053acf5
...@@ -21,7 +21,7 @@ module HasStatus ...@@ -21,7 +21,7 @@ module HasStatus
deduce_status = "(CASE deduce_status = "(CASE
WHEN (#{builds})=(#{created}) THEN 'created' WHEN (#{builds})=(#{created}) THEN 'created'
WHEN (#{builds})=(#{skipped}) THEN 'success' WHEN (#{builds})=(#{skipped}) THEN 'skipped'
WHEN (#{builds})=(#{success})+(#{ignored})+(#{skipped}) THEN 'success' WHEN (#{builds})=(#{success})+(#{ignored})+(#{skipped}) THEN 'success'
WHEN (#{builds})=(#{created})+(#{pending})+(#{skipped}) THEN 'pending' WHEN (#{builds})=(#{created})+(#{pending})+(#{skipped}) THEN 'pending'
WHEN (#{builds})=(#{canceled})+(#{success})+(#{ignored})+(#{skipped}) THEN 'canceled' WHEN (#{builds})=(#{canceled})+(#{success})+(#{ignored})+(#{skipped}) THEN 'canceled'
......
...@@ -61,7 +61,12 @@ module Ci ...@@ -61,7 +61,12 @@ module Ci
end end
def status_for_prior_stages(index) 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 end
def stage_indexes_of_created_builds def stage_indexes_of_created_builds
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment