retryable.rb 604 Bytes
Newer Older
1 2 3
module Gitlab
  module Ci
    module Status
4
      module Build
5
        class Retryable < Status::Extended
6 7
          def has_action?
            can?(user, :update_build, subject)
8 9 10
          end

          def action_icon
Tim Zallmann's avatar
Tim Zallmann committed
11
            'retry'
12 13 14 15
          end

          def action_title
            'Retry'
16 17 18
          end

          def action_path
19
            retry_project_job_path(subject.project, subject)
20 21 22 23 24 25
          end

          def action_method
            :post
          end

26
          def self.matches?(build, user)
27 28 29 30 31 32 33
            build.retryable?
          end
        end
      end
    end
  end
end