diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-01-22 15:56:06 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-01-25 12:37:18 +0300 |
commit | 20e7d4882c2ac111489ed44a7a51f6a9023b1d87 (patch) | |
tree | 7b8818f06e409cbbe0a77eacc3c24a3ae3d516a3 | |
parent | 76e7b19c8158bcf000db8575f958161a232d643e (diff) |
Make CI/CD bridge job a pipeline processable entity
-rw-r--r-- | app/models/ci/bridge.rb | 20 | ||||
-rw-r--r-- | app/presenters/ci/bridge_presenter.rb | 23 | ||||
-rw-r--r-- | lib/gitlab/ci/status/bridge/common.rb | 1 |
3 files changed, 43 insertions, 1 deletions
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb index 85234c06183..9fd802692ee 100644 --- a/app/models/ci/bridge.rb +++ b/app/models/ci/bridge.rb @@ -2,6 +2,7 @@ module Ci class Bridge < CommitStatus + include Ci::Processable include Importable include AfterCommitQueue include Gitlab::Utils::StrongMemoize @@ -24,6 +25,21 @@ module Ci .fabricate! end + def schedulable? + false + end + + def action? + false + end + + def artifacts? + false + end + + def expanded_environment_name + end + def predefined_variables raise NotImplementedError end @@ -31,5 +47,9 @@ module Ci def execute_hooks raise NotImplementedError end + + def to_partial_path + 'projects/ci/builds/build' + end end end diff --git a/app/presenters/ci/bridge_presenter.rb b/app/presenters/ci/bridge_presenter.rb new file mode 100644 index 00000000000..2c15f25da93 --- /dev/null +++ b/app/presenters/ci/bridge_presenter.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Ci + class BridgePresenter < CommitStatusPresenter + def status_title + tooltip_for_badge + end + + def tooltip_message + "#{subject.name} - #{detailed_status.status_tooltip}" + end + + private + + def tooltip_for_badge + detailed_status.badge_tooltip.capitalize + end + + def detailed_status + @detailed_status ||= subject.detailed_status(user) + end + end +end diff --git a/lib/gitlab/ci/status/bridge/common.rb b/lib/gitlab/ci/status/bridge/common.rb index c6cb620f7a0..4746195c618 100644 --- a/lib/gitlab/ci/status/bridge/common.rb +++ b/lib/gitlab/ci/status/bridge/common.rb @@ -18,7 +18,6 @@ module Gitlab end def details_path - raise NotImplementedError end end end |