2017-08-17 22:00:37 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Status
|
|
|
|
module Build
|
|
|
|
class FailedAllowed < Status::Extended
|
|
|
|
def label
|
2018-05-09 12:01:36 +05:30
|
|
|
"failed #{allowed_to_fail_title}"
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def icon
|
2018-03-17 18:26:18 +05:30
|
|
|
'status_warning'
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def group
|
|
|
|
'failed_with_warnings'
|
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
def status_tooltip
|
|
|
|
"#{@status.status_tooltip} #{allowed_to_fail_title}"
|
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def self.matches?(build, user)
|
|
|
|
build.failed? && build.allow_failure?
|
|
|
|
end
|
2018-05-09 12:01:36 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def allowed_to_fail_title
|
|
|
|
"(allowed to fail)"
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|