diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-17 21:10:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-17 21:10:12 +0300 |
commit | 708ee0bcb2c20cc73db53c092a26f916139d15d4 (patch) | |
tree | c0692fcc8b91d4936ffb9b4032a205dbb3ddc683 /lib/gitlab/ci/status | |
parent | e14148b7edcfc4aff7ec966c399b3913318fb293 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/status')
-rw-r--r-- | lib/gitlab/ci/status/bridge/common.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/gitlab/ci/status/bridge/common.rb b/lib/gitlab/ci/status/bridge/common.rb index 4746195c618..b95565b5e09 100644 --- a/lib/gitlab/ci/status/bridge/common.rb +++ b/lib/gitlab/ci/status/bridge/common.rb @@ -10,14 +10,28 @@ module Gitlab end def has_details? - false + !!details_path + end + + def details_path + return unless Feature.enabled?(:ci_bridge_pipeline_details, subject.project, default_enabled: true) + return unless can?(user, :read_pipeline, downstream_pipeline) + + project_pipeline_path(downstream_project, downstream_pipeline) end def has_action? false end - def details_path + private + + def downstream_pipeline + subject.downstream_pipeline + end + + def downstream_project + downstream_pipeline&.project end end end |