Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/projects/auto_devops/disable_service.rb')
-rw-r--r--app/services/projects/auto_devops/disable_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/projects/auto_devops/disable_service.rb b/app/services/projects/auto_devops/disable_service.rb
index 9745ab67dbd..1b578a3c5ce 100644
--- a/app/services/projects/auto_devops/disable_service.rb
+++ b/app/services/projects/auto_devops/disable_service.rb
@@ -21,10 +21,12 @@ module Projects
# is an expensive operation. See
# https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21172#note_99037378
# for more context.
+ # rubocop: disable CodeReuse/ActiveRecord
def first_pipeline_failure?
auto_devops_pipelines.success.limit(1).count.zero? &&
auto_devops_pipelines.failed.limit(1).count.nonzero?
end
+ # rubocop: enable CodeReuse/ActiveRecord
def disable_auto_devops
project.auto_devops_attributes = { enabled: false }