summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-09-21 11:17:37 +0900
committerAlessio Caiazza <acaiazza@gitlab.com>2018-10-02 17:02:11 +0200
commita7c767f16446f71f6e35a5aa3d2fdc73037fcdf5 (patch)
tree6f0f2a85f44d796a31ae0813e1ce6d5434bc8fda /app/models/commit_status.rb
parentaf51b95442aa867bd570b99d32f8b580f554675d (diff)
downloadgitlab-ce-a7c767f16446f71f6e35a5aa3d2fdc73037fcdf5.tar.gz
Add a new status to ci_builds.status
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index fe2f144ef03..6bf2888505e 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -26,7 +26,7 @@ class CommitStatus < ActiveRecord::Base
scope :failed_but_allowed, -> do
where(allow_failure: true, status: [:failed, :canceled])
end
-
+
scope :exclude_ignored, -> do
# We want to ignore failed but allowed to fail jobs.
#
@@ -71,7 +71,7 @@ class CommitStatus < ActiveRecord::Base
end
event :enqueue do
- transition [:created, :skipped, :manual] => :pending
+ transition [:created, :skipped, :manual, :scheduled] => :pending
end
event :run do
@@ -91,10 +91,10 @@ class CommitStatus < ActiveRecord::Base
end
event :cancel do
- transition [:created, :pending, :running, :manual] => :canceled
+ transition [:created, :pending, :running, :manual, :scheduled] => :canceled
end
- before_transition [:created, :skipped, :manual] => :pending do |commit_status|
+ before_transition [:created, :skipped, :manual, :scheduled] => :pending do |commit_status|
commit_status.queued_at = Time.now
end