BigW Consortium Gitlab

success_warning.rb 659 Bytes
Newer Older
1 2 3 4
module Gitlab
  module Ci
    module Status
      ##
5
      # Extended status used when pipeline or stage passed conditionally.
6 7
      # This means that failed jobs that are allowed to fail were present.
      #
8
      class SuccessWarning < Status::Extended
9
        def text
10
          s_('CiStatusText|passed')
11 12 13
        end

        def label
14
          s_('CiStatusLabel|passed with warnings')
15 16 17
        end

        def icon
18
          'status_warning'
19 20 21 22 23 24 25
        end

        def group
          'success_with_warnings'
        end

        def self.matches?(subject, user)
26
          subject.success? && subject.has_warnings?
27 28 29 30 31
        end
      end
    end
  end
end