diff options
-rw-r--r-- | app/models/concerns/has_status.rb | 2 | ||||
-rw-r--r-- | app/services/ci/process_pipeline_service.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb index 755eadf779a..0fa4df0fb56 100644 --- a/app/models/concerns/has_status.rb +++ b/app/models/concerns/has_status.rb @@ -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' diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb index 36c93dddadb..7adf093557b 100644 --- a/app/services/ci/process_pipeline_service.rb +++ b/app/services/ci/process_pipeline_service.rb @@ -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 |