Commit a0761591 authored by Matija Čupić's avatar Matija Čupić
Browse files

Add check for nil auto_devops in Projects::UpdateService

parent a5a089c8e913
......@@ -36,7 +36,7 @@ def execute
def run_auto_devops_pipeline?
return false if project.repository.gitlab_ci_yml || !project.auto_devops.previous_changes.include?('enabled')
return false if project.repository.gitlab_ci_yml || project.auto_devops.nil? || !project.auto_devops.previous_changes.include?('enabled')
project.auto_devops.enabled? || (project.auto_devops.enabled.nil? && Gitlab::CurrentSettings.auto_devops_enabled?)
......@@ -275,6 +275,10 @@
it { eq(false) }
context 'when auto devops is nil' do
it { eq(false) }
context 'when auto devops is explicitly enabled' do
before do
project.create_auto_devops!(enabled: true)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment