2018-10-30 15:05:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-11 07:26:56 -05:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Status
|
|
|
|
module Build
|
2017-05-05 09:21:06 -04:00
|
|
|
class FailedAllowed < Status::Extended
|
2017-01-11 07:26:56 -05:00
|
|
|
def label
|
2018-04-05 17:04:42 -04:00
|
|
|
"failed #{allowed_to_fail_title}"
|
2017-01-11 07:26:56 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def icon
|
2017-11-06 09:59:07 -05:00
|
|
|
'status_warning'
|
2017-01-11 07:26:56 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def group
|
|
|
|
'failed_with_warnings'
|
|
|
|
end
|
|
|
|
|
2018-04-05 17:04:42 -04:00
|
|
|
def status_tooltip
|
|
|
|
"#{@status.status_tooltip} #{allowed_to_fail_title}"
|
|
|
|
end
|
|
|
|
|
2017-01-11 07:26:56 -05:00
|
|
|
def self.matches?(build, user)
|
|
|
|
build.failed? && build.allow_failure?
|
|
|
|
end
|
2018-04-05 17:04:42 -04:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def allowed_to_fail_title
|
|
|
|
"(allowed to fail)"
|
|
|
|
end
|
2017-01-11 07:26:56 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|