diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-12-07 20:11:07 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-12-07 20:11:07 +0300 |
commit | 245fad4d8854e74b6f39c763c2f8d047eeb5f4eb (patch) | |
tree | ebcea65553d80abc995ce753a8bcb185ed5a6875 /app/services | |
parent | 9dffd0ab6b2e9f5b0db55230d8991f50a01f7669 (diff) | |
parent | 5a2a0b284cf721e6cba63fc69fb7550f5039da8a (diff) |
Merge branch '40761-remove-the-checkbox-for-starting-a-new-pipeline-in-auto-devops-settings' into 'master'
Resolve "Remove the checkbox for starting a new pipeline in Auto DevOps settings"
Closes #40761
See merge request gitlab-org/gitlab-ce!15714
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/projects/update_service.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb index 72eecc61c96..ff4c73c886e 100644 --- a/app/services/projects/update_service.rb +++ b/app/services/projects/update_service.rb @@ -15,7 +15,7 @@ module Projects return error("Could not set the default branch") unless project.change_head(params[:default_branch]) end - if project.update_attributes(update_params) + if project.update_attributes(params.except(:default_branch)) if project.previous_changes.include?('path') project.rename_repo else @@ -32,15 +32,13 @@ module Projects end def run_auto_devops_pipeline? - params.dig(:run_auto_devops_pipeline_explicit) == 'true' || params.dig(:run_auto_devops_pipeline_implicit) == 'true' + return false if project.repository.gitlab_ci_yml || !project.auto_devops.previous_changes.include?('enabled') + + project.auto_devops.enabled? || (project.auto_devops.enabled.nil? && current_application_settings.auto_devops_enabled?) end private - def update_params - params.except(:default_branch, :run_auto_devops_pipeline_explicit, :run_auto_devops_pipeline_implicit) - end - def renaming_project_with_container_registry_tags? new_path = params[:path] |