summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-10-04 17:52:36 +0900
committerShinya Maeda <shinya@gitlab.com>2018-10-04 17:52:36 +0900
commit2dd7339c0149034aa5faa4029cff1a82aef35d21 (patch)
treebb0aac16f5a0a4ddf96c64079095fee48df48dfb
parentd3b9e4ef38f09a9be84b687f847984d5605cc95a (diff)
downloadgitlab-ce-2dd7339c0149034aa5faa4029cff1a82aef35d21.tar.gz
Add scheduled actions in deployment entity
-rw-r--r--app/models/ci/build.rb6
-rw-r--r--app/models/deployment.rb6
-rw-r--r--app/serializers/deployment_entity.rb1
3 files changed, 11 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 8f1547463ba..9b0bb2e05fc 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -245,10 +245,14 @@ module Ci
.fabricate!
end
- def other_actions
+ def other_manual_actions
pipeline.manual_actions.where.not(name: name)
end
+ def other_scheduled_actions
+ pipeline.scheduled_actions.where.not(name: name)
+ end
+
def pages_generator?
Gitlab.config.pages.enabled &&
self.name == 'pages'
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 6962b54441b..ed61135cb47 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -44,7 +44,11 @@ class Deployment < ActiveRecord::Base
end
def manual_actions
- @manual_actions ||= deployable.try(:other_actions)
+ @manual_actions ||= deployable.try(:other_manual_actions)
+ end
+
+ def scheduled_actions
+ @scheduled_actions ||= deployable.try(:other_scheduled_actions)
end
def includes_commit?(commit)
diff --git a/app/serializers/deployment_entity.rb b/app/serializers/deployment_entity.rb
index 344148a1fb7..aa1d9e6292c 100644
--- a/app/serializers/deployment_entity.rb
+++ b/app/serializers/deployment_entity.rb
@@ -25,4 +25,5 @@ class DeploymentEntity < Grape::Entity
expose :commit, using: CommitEntity
expose :deployable, using: JobEntity
expose :manual_actions, using: JobEntity
+ expose :scheduled_actions, using: JobEntity
end