2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Status
|
|
|
|
module Build
|
|
|
|
class Failed < Status::Extended
|
|
|
|
REASONS = {
|
2018-11-18 11:00:15 +05:30
|
|
|
unknown_failure: 'unknown failure',
|
|
|
|
script_failure: 'script failure',
|
|
|
|
api_failure: 'API failure',
|
|
|
|
stuck_or_timeout_failure: 'stuck or timeout failure',
|
|
|
|
runner_system_failure: 'runner system failure',
|
|
|
|
missing_dependency_failure: 'missing dependency failure',
|
2018-12-05 23:21:45 +05:30
|
|
|
runner_unsupported: 'unsupported runner',
|
2018-12-13 13:39:08 +05:30
|
|
|
stale_schedule: 'stale schedule',
|
|
|
|
job_execution_timeout: 'job execution timeout',
|
2019-07-07 11:18:12 +05:30
|
|
|
archived_failure: 'archived failure',
|
2019-12-26 22:10:19 +05:30
|
|
|
unmet_prerequisites: 'unmet prerequisites',
|
|
|
|
scheduler_failure: 'scheduler failure',
|
2020-03-13 15:44:24 +05:30
|
|
|
data_integrity_failure: 'data integrity failure',
|
|
|
|
forward_deployment_failure: 'forward deployment failure',
|
2021-06-08 01:23:25 +05:30
|
|
|
pipeline_loop_detected: 'job would create infinitely looping pipelines',
|
2020-03-13 15:44:24 +05:30
|
|
|
invalid_bridge_trigger: 'downstream pipeline trigger definition is invalid',
|
|
|
|
downstream_bridge_project_not_found: 'downstream project could not be found',
|
|
|
|
insufficient_bridge_permissions: 'no permissions to trigger downstream pipeline',
|
|
|
|
bridge_pipeline_is_child_pipeline: 'creation of child pipeline not allowed from another child pipeline',
|
2020-10-24 23:57:45 +05:30
|
|
|
downstream_pipeline_creation_failed: 'downstream pipeline can not be created',
|
2020-11-24 15:15:51 +05:30
|
|
|
secrets_provider_not_found: 'secrets provider can not be found',
|
2021-04-29 21:17:54 +05:30
|
|
|
reached_max_descendant_pipelines_depth: 'reached maximum depth of child pipelines',
|
|
|
|
project_deleted: 'pipeline project was deleted',
|
2021-06-08 01:23:25 +05:30
|
|
|
user_blocked: 'pipeline user was blocked',
|
2021-09-04 01:27:46 +05:30
|
|
|
ci_quota_exceeded: 'no more CI minutes available',
|
2021-09-30 23:02:18 +05:30
|
|
|
no_matching_runner: 'no matching runner available',
|
2021-11-11 11:23:49 +05:30
|
|
|
trace_size_exceeded: 'log size limit exceeded',
|
2021-11-18 22:05:49 +05:30
|
|
|
builds_disabled: 'project builds are disabled',
|
2022-01-26 12:08:38 +05:30
|
|
|
environment_creation_failure: 'environment creation failure',
|
2022-07-01 11:34:44 +05:30
|
|
|
deployment_rejected: 'deployment rejected',
|
|
|
|
ip_restriction_failure: 'IP address restriction failure'
|
2018-05-09 12:01:36 +05:30
|
|
|
}.freeze
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
private_constant :REASONS
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
def status_tooltip
|
|
|
|
base_message
|
|
|
|
end
|
|
|
|
|
|
|
|
def badge_tooltip
|
|
|
|
base_message
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.matches?(build, user)
|
|
|
|
build.failed?
|
|
|
|
end
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
def self.reasons
|
|
|
|
REASONS
|
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
def base_message
|
|
|
|
"#{s_('CiStatusLabel|failed')} #{description}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def description
|
2018-11-18 11:00:15 +05:30
|
|
|
"- (#{failure_reason_message})"
|
|
|
|
end
|
|
|
|
|
|
|
|
def failure_reason_message
|
2018-11-20 20:47:30 +05:30
|
|
|
self.class.reasons.fetch(subject.failure_reason.to_sym)
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Gitlab::Ci::Status::Build::Failed.prepend_mod_with('Gitlab::Ci::Status::Build::Failed')
|