diff options
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/status/build/action.rb | 23 | ||||
-rw-r--r-- | lib/gitlab/ci/status/build/factory.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/ci/status/build/play.rb | 6 |
3 files changed, 26 insertions, 6 deletions
diff --git a/lib/gitlab/ci/status/build/action.rb b/lib/gitlab/ci/status/build/action.rb new file mode 100644 index 00000000000..1397c35145a --- /dev/null +++ b/lib/gitlab/ci/status/build/action.rb @@ -0,0 +1,23 @@ +module Gitlab + module Ci + module Status + module Build + class Action < SimpleDelegator + include Status::Extended + + def label + if has_action? + __getobj__.label + else + "#{__getobj__.label} (not allowed)" + end + end + + def self.matches?(build, user) + build.action? + end + end + end + end + end +end diff --git a/lib/gitlab/ci/status/build/factory.rb b/lib/gitlab/ci/status/build/factory.rb index 38ac6edc9f1..c852d607373 100644 --- a/lib/gitlab/ci/status/build/factory.rb +++ b/lib/gitlab/ci/status/build/factory.rb @@ -8,7 +8,8 @@ module Gitlab Status::Build::Retryable], [Status::Build::FailedAllowed, Status::Build::Play, - Status::Build::Stop]] + Status::Build::Stop], + [Status::Build::Action]] end def self.common_helpers diff --git a/lib/gitlab/ci/status/build/play.rb b/lib/gitlab/ci/status/build/play.rb index fae34a2f927..3495b8d0448 100644 --- a/lib/gitlab/ci/status/build/play.rb +++ b/lib/gitlab/ci/status/build/play.rb @@ -6,11 +6,7 @@ module Gitlab include Status::Extended def label - if has_action? - 'manual play action' - else - 'manual play action (not allowed)' - end + 'manual play action' end def has_action? |