gitlab-org--gitlab-foss/app/helpers/auto_devops_helper.rb
Zeger-Jan van de Weg eeeea489fb
AutoDevOps banner hidden on explicit CI config
Extends the helper method to no show the banner as soon as the project
has a `.gitlab-ci.yml` file on the default branch.

Fixes gitlab-org/gitlab-ce#37652
2017-09-13 11:36:04 +02:00

10 lines
376 B
Ruby

module AutoDevopsHelper
def show_auto_devops_callout?(project)
Feature.get(:auto_devops_banner_disabled).off? &&
show_callout?('auto_devops_settings_dismissed') &&
can?(current_user, :admin_pipeline, project) &&
project.has_auto_devops_implicitly_disabled? &&
!project.repository.gitlab_ci_yml &&
project.ci_services.active.none?
end
end