summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-05-29 15:20:10 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-05-29 15:20:10 +0200
commitfc3d214130f2038b3c8bdf142506c9116f373244 (patch)
treea9b2c7f49deac67852c863fcb5a612a312be55c3 /app/models/ci/pipeline.rb
parent8a3aa3a6365f511a2620b56946721f1584bade99 (diff)
downloadgitlab-ce-fc3d214130f2038b3c8bdf142506c9116f373244.tar.gz
Add a feature flag for switching pipeline stages
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r--app/models/ci/pipeline.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 9dac56fcd57..4b8c23a393d 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -250,13 +250,17 @@ module Ci
end
##
- # TODO consider switching to persisted stages only in pipelines table
- # (not necessairly in the show pipeline page because of #23257.
- # Hide this behind two feature flags - enabled / disabled and only
- # gitlab-ce / everywhere.
+ # TODO We do not completely switch to persisted stages because of
+ # race conditions with setting statuses gitlab-ce#23257.
#
- def stages
- super
+ def ordered_stages
+ return legacy_stages unless complete?
+
+ if Feature.enabled?('ci_pipeline_persisted_stages')
+ stages
+ else
+ legacy_stages
+ end
end
def legacy_stages