summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-02 13:45:01 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-06 10:04:04 +0100
commit79ea01bfaffa743e98716cf9f9f811c6843dea4b (patch)
tree48bf9a5ca5221e5fc61fa36aa76ebdb502d6011a /app/models/commit_status.rb
parentf9a1814377474bab898cf7511bb02c53c6dc23b7 (diff)
downloadgitlab-ce-79ea01bfaffa743e98716cf9f9f811c6843dea4b.tar.gz
Refactor code related to pipeline blocking actions
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index bca61151eff..3ef07ffd0da 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -25,13 +25,13 @@ class CommitStatus < ActiveRecord::Base
end
scope :failed_but_allowed, -> do
- where(allow_failure: true, status: [:failed, :canceled, :manual])
+ where(allow_failure: true, status: [:failed, :canceled, :blocked])
end
scope :exclude_ignored, -> do
# We want to ignore failed_but_allowed jobs
where("allow_failure = ? OR status IN (?)",
- false, all_state_names - [:failed, :canceled, :manual])
+ false, all_state_names - [:failed, :canceled, :blocked])
end
scope :retried, -> { where.not(id: latest) }
@@ -42,11 +42,11 @@ class CommitStatus < ActiveRecord::Base
state_machine :status do
event :enqueue do
- transition [:created, :skipped, :manual] => :pending
+ transition [:created, :skipped, :blocked] => :pending
end
event :process do
- transition [:skipped, :manual] => :created
+ transition [:skipped, :blocked] => :created
end
event :run do
@@ -66,7 +66,7 @@ class CommitStatus < ActiveRecord::Base
end
event :cancel do
- transition [:created, :pending, :running, :manual] => :canceled
+ transition [:created, :pending, :running, :blocked] => :canceled
end
before_transition created: [:pending, :running] do |commit_status|