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
This commit is contained in:
parent
9c9b1774cb
commit
eeeea489fb
3 changed files with 25 additions and 1 deletions
|
@ -3,6 +3,8 @@ module AutoDevopsHelper
|
|||
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.has_auto_devops_implicitly_disabled? &&
|
||||
!project.repository.gitlab_ci_yml &&
|
||||
project.ci_services.active.none?
|
||||
end
|
||||
end
|
||||
|
|
6
changelogs/unreleased/zj-auto-devops-banner.yml
Normal file
6
changelogs/unreleased/zj-auto-devops-banner.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
title: Do not show the Auto DevOps banner when the project has a .gitlab-ci.yml on
|
||||
master
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
|
@ -65,5 +65,21 @@ describe AutoDevopsHelper do
|
|||
|
||||
it { is_expected.to eq(false) }
|
||||
end
|
||||
|
||||
context 'when master contains a .gitlab-ci.yml file' do
|
||||
before do
|
||||
allow(project.repository).to receive(:gitlab_ci_yml).and_return("script: [ 'test']")
|
||||
end
|
||||
|
||||
it { is_expected.to eq(false) }
|
||||
end
|
||||
|
||||
context 'when another service is enabled' do
|
||||
before do
|
||||
create(:service, project: project, category: :ci, active: true)
|
||||
end
|
||||
|
||||
it { is_expected.to eq(false) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue