diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-06 12:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-06 12:09:03 +0300 |
commit | 61ee5c363522f2639d1c515a74b9b02b7672c7c2 (patch) | |
tree | 65905860063ad3af3c31656b6aa1ca6f8fe36856 /app/models/commit_status.rb | |
parent | 5e230e10b86a9b65eb5a7aa532879fe7456003e6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 292d249cb23..ce253d5ad81 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -181,15 +181,16 @@ class CommitStatus < ApplicationRecord end after_transition any => :failed do |commit_status| - next if Feature.enabled?(:async_add_build_failure_todo, commit_status.project, default_enabled: :yaml) - next unless commit_status.project - - # rubocop: disable CodeReuse/ServiceClass commit_status.run_after_commit do - MergeRequests::AddTodoWhenBuildFailsService - .new(project, nil).execute(self) + ::Gitlab::Ci::Pipeline::Metrics.job_failure_reason_counter.increment(reason: commit_status.failure_reason) + + # rubocop: disable CodeReuse/ServiceClass + next if Feature.enabled?(:async_add_build_failure_todo, commit_status.project, default_enabled: :yaml) + next unless commit_status.project + + MergeRequests::AddTodoWhenBuildFailsService.new(project, nil).execute(self) + # rubocop: enable CodeReuse/ServiceClass end - # rubocop: enable CodeReuse/ServiceClass end end |