summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /app/models/commit_status.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 046f131b041..7e99f128dad 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -7,8 +7,6 @@ class CommitStatus < ApplicationRecord
include Presentable
include EnumWithNil
- prepend_if_ee('::EE::CommitStatus') # rubocop: disable Cop/InjectEnterpriseEditionModule
-
self.table_name = 'ci_builds'
belongs_to :user
@@ -267,8 +265,16 @@ class CommitStatus < ApplicationRecord
end
end
+ def recoverable?
+ failed? && !unrecoverable_failure?
+ end
+
private
+ def unrecoverable_failure?
+ script_failure? || missing_dependency_failure? || archived_failure? || scheduler_failure? || data_integrity_failure?
+ end
+
def schedule_stage_and_pipeline_update
if Feature.enabled?(:ci_atomic_processing, project)
# Atomic Processing requires only single Worker
@@ -284,3 +290,5 @@ class CommitStatus < ApplicationRecord
end
end
end
+
+CommitStatus.prepend_if_ee('::EE::CommitStatus')