summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-09-13 11:53:00 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-09-13 11:53:00 +0000
commit46bdcd64056e8e5ed8d397b0ad5accaa7e5e9d06 (patch)
tree09fb57a06c24f024d6dd183cad0d9948dc16b62b
parentd4303f82317cc5dfef93f04421c54a5a79827021 (diff)
parent69f7a12f0372a13357bf53d00125c72e06755dd6 (diff)
downloadgitlab-ce-46bdcd64056e8e5ed8d397b0ad5accaa7e5e9d06.tar.gz
Merge branch 'zj-auto-devops-banner' into 'master'
AutoDevOps banner hidden on explicit CI config Closes #37652 See merge request !14207
-rw-r--r--app/helpers/auto_devops_helper.rb4
-rw-r--r--changelogs/unreleased/zj-auto-devops-banner.yml6
-rw-r--r--spec/helpers/auto_devops_helper_spec.rb16
3 files changed, 25 insertions, 1 deletions
diff --git a/app/helpers/auto_devops_helper.rb b/app/helpers/auto_devops_helper.rb
index c132daed323..c455d18cff8 100644
--- a/app/helpers/auto_devops_helper.rb
+++ b/app/helpers/auto_devops_helper.rb
@@ -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
diff --git a/changelogs/unreleased/zj-auto-devops-banner.yml b/changelogs/unreleased/zj-auto-devops-banner.yml
new file mode 100644
index 00000000000..a2abed0b2ec
--- /dev/null
+++ b/changelogs/unreleased/zj-auto-devops-banner.yml
@@ -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
diff --git a/spec/helpers/auto_devops_helper_spec.rb b/spec/helpers/auto_devops_helper_spec.rb
index 80d58ff6bf7..5e272af6073 100644
--- a/spec/helpers/auto_devops_helper_spec.rb
+++ b/spec/helpers/auto_devops_helper_spec.rb
@@ -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