057c0d7a5c
Not only tracking auto-cancelling in pipelines, we'll also track this in jobs because pipelines could be retried and the information would get lost when this happened. Also erase auto-cancelling relation for pipelines when they're retried.
21 lines
496 B
Ruby
21 lines
496 B
Ruby
module Ci
|
|
class BuildPresenter < Gitlab::View::Presenter::Delegated
|
|
presents :build
|
|
|
|
def erased_by_user?
|
|
# Build can be erased through API, therefore it does not have
|
|
# `erased_by` user assigned in that case.
|
|
erased? && erased_by
|
|
end
|
|
|
|
def erased_by_name
|
|
erased_by.name if erased_by_user?
|
|
end
|
|
|
|
def status_title
|
|
if auto_canceled?
|
|
"Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}"
|
|
end
|
|
end
|
|
end
|
|
end
|