Skip to content
代码片段 群组 项目
提交 f2c1a351 编辑于 作者: Fabio Pitino's avatar Fabio Pitino
浏览文件

Merge branch 'mb-unify-ci-jobs-failure-reasons' into 'master'

Unify CI job failure reasons

See merge request gitlab-org/gitlab!91031
No related branches found
No related tags found
无相关合并请求
...@@ -321,5 +321,3 @@ def unrecoverable_failure? ...@@ -321,5 +321,3 @@ def unrecoverable_failure?
script_failure? || missing_dependency_failure? || archived_failure? || scheduler_failure? || data_integrity_failure? script_failure? || missing_dependency_failure? || archived_failure? || scheduler_failure? || data_integrity_failure?
end end
end end
CommitStatus.prepend_mod_with('CommitStatus')
...@@ -29,9 +29,12 @@ def self.failure_reasons ...@@ -29,9 +29,12 @@ def self.failure_reasons
builds_disabled: 20, builds_disabled: 20,
environment_creation_failure: 21, environment_creation_failure: 21,
deployment_rejected: 22, deployment_rejected: 22,
protected_environment_failure: 1_000,
insufficient_bridge_permissions: 1_001, insufficient_bridge_permissions: 1_001,
downstream_bridge_project_not_found: 1_002, downstream_bridge_project_not_found: 1_002,
invalid_bridge_trigger: 1_003, invalid_bridge_trigger: 1_003,
upstream_bridge_project_not_found: 1_004,
insufficient_upstream_permissions: 1_005,
bridge_pipeline_is_child_pipeline: 1_006, # not used anymore, but cannot be deleted because of old data bridge_pipeline_is_child_pipeline: 1_006, # not used anymore, but cannot be deleted because of old data
downstream_pipeline_creation_failed: 1_007, downstream_pipeline_creation_failed: 1_007,
secrets_provider_not_found: 1_008, secrets_provider_not_found: 1_008,
...@@ -41,5 +44,3 @@ def self.failure_reasons ...@@ -41,5 +44,3 @@ def self.failure_reasons
end end
end end
end end
Enums::Ci::CommitStatus.prepend_mod_with('Enums::Ci::CommitStatus')
...@@ -16,8 +16,11 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated ...@@ -16,8 +16,11 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
data_integrity_failure: 'There has been a structural integrity problem detected, please contact system administrator', data_integrity_failure: 'There has been a structural integrity problem detected, please contact system administrator',
forward_deployment_failure: 'The deployment job is older than the previously succeeded deployment job, and therefore cannot be run', forward_deployment_failure: 'The deployment job is older than the previously succeeded deployment job, and therefore cannot be run',
pipeline_loop_detected: 'This job could not be executed because it would create infinitely looping pipelines', pipeline_loop_detected: 'This job could not be executed because it would create infinitely looping pipelines',
insufficient_upstream_permissions: 'This job could not be executed because of insufficient permissions to track the upstream project.',
upstream_bridge_project_not_found: 'This job could not be executed because upstream bridge project could not be found.',
invalid_bridge_trigger: 'This job could not be executed because downstream pipeline trigger definition is invalid', invalid_bridge_trigger: 'This job could not be executed because downstream pipeline trigger definition is invalid',
downstream_bridge_project_not_found: 'This job could not be executed because downstream bridge project could not be found', downstream_bridge_project_not_found: 'This job could not be executed because downstream bridge project could not be found',
protected_environment_failure: 'The environment this job is deploying to is protected. Only users with permission may successfully run this job.',
insufficient_bridge_permissions: 'This job could not be executed because of insufficient permissions to create a downstream pipeline', insufficient_bridge_permissions: 'This job could not be executed because of insufficient permissions to create a downstream pipeline',
bridge_pipeline_is_child_pipeline: 'This job belongs to a child pipeline and cannot create further child pipelines', bridge_pipeline_is_child_pipeline: 'This job belongs to a child pipeline and cannot create further child pipelines',
downstream_pipeline_creation_failed: 'The downstream pipeline could not be created', downstream_pipeline_creation_failed: 'The downstream pipeline could not be created',
...@@ -61,5 +64,3 @@ def help_page_link(path, anchor) ...@@ -61,5 +64,3 @@ def help_page_link(path, anchor)
ActionController::Base.helpers.link_to('How do I fix it?', help_page_path(path, anchor: anchor)) ActionController::Base.helpers.link_to('How do I fix it?', help_page_path(path, anchor: anchor))
end end
end end
CommitStatusPresenter.prepend_mod_with('CommitStatusPresenter')
# frozen_string_literal: true
module EE
module Enums
module Ci
module CommitStatus
extend ActiveSupport::Concern
class_methods do
extend ::Gitlab::Utils::Override
override :failure_reasons
def failure_reasons
super.merge(protected_environment_failure: 1_000,
upstream_bridge_project_not_found: 1_004,
insufficient_upstream_permissions: 1_005)
end
end
end
end
end
end
# frozen_string_literal: true
module EE
module CommitStatus
EE_FAILURE_REASONS = {
protected_environment_failure: 1_000
}.freeze
end
end
# frozen_string_literal: true
module EE
module CommitStatusPresenter
extend ActiveSupport::Concern
prepended do
EE_CALLOUT_FAILURE_MESSAGES = const_get(:CALLOUT_FAILURE_MESSAGES, false).merge(
protected_environment_failure: 'The environment this job is deploying to is protected. Only users with permission may successfully run this job.',
insufficient_upstream_permissions: 'This job could not be executed because of insufficient permissions to track the upstream project.',
upstream_bridge_project_not_found: 'This job could not be executed because upstream bridge project could not be found.'
).freeze
EE::CommitStatusPresenter.private_constant :EE_CALLOUT_FAILURE_MESSAGES
end
class_methods do
def callout_failure_messages
EE_CALLOUT_FAILURE_MESSAGES
end
end
end
end
# frozen_string_literal: true
module EE
module Gitlab
module Ci
module Status
module Build
module Failed
extend ActiveSupport::Concern
prepended do
EE_REASONS = const_get(:REASONS, false).merge(
protected_environment_failure: 'protected environment failure',
upstream_bridge_project_not_found: 'upstream project could not be found',
insufficient_upstream_permissions: 'no permissions to read upstream project'
).freeze
EE::Gitlab::Ci::Status::Build::Failed.private_constant :EE_REASONS
end
class_methods do
extend ::Gitlab::Utils::Override
override :reasons
def reasons
EE_REASONS
end
end
end
end
end
end
end
end
...@@ -20,10 +20,13 @@ class Failed < Status::Extended ...@@ -20,10 +20,13 @@ class Failed < Status::Extended
scheduler_failure: 'scheduler failure', scheduler_failure: 'scheduler failure',
data_integrity_failure: 'data integrity failure', data_integrity_failure: 'data integrity failure',
forward_deployment_failure: 'forward deployment failure', forward_deployment_failure: 'forward deployment failure',
protected_environment_failure: 'protected environment failure',
pipeline_loop_detected: 'job would create infinitely looping pipelines', pipeline_loop_detected: 'job would create infinitely looping pipelines',
invalid_bridge_trigger: 'downstream pipeline trigger definition is invalid', invalid_bridge_trigger: 'downstream pipeline trigger definition is invalid',
downstream_bridge_project_not_found: 'downstream project could not be found', downstream_bridge_project_not_found: 'downstream project could not be found',
upstream_bridge_project_not_found: 'upstream project could not be found',
insufficient_bridge_permissions: 'no permissions to trigger downstream pipeline', insufficient_bridge_permissions: 'no permissions to trigger downstream pipeline',
insufficient_upstream_permissions: 'no permissions to read upstream project',
bridge_pipeline_is_child_pipeline: 'creation of child pipeline not allowed from another child pipeline', bridge_pipeline_is_child_pipeline: 'creation of child pipeline not allowed from another child pipeline',
downstream_pipeline_creation_failed: 'downstream pipeline can not be created', downstream_pipeline_creation_failed: 'downstream pipeline can not be created',
secrets_provider_not_found: 'secrets provider can not be found', secrets_provider_not_found: 'secrets provider can not be found',
...@@ -74,5 +77,3 @@ def failure_reason_message ...@@ -74,5 +77,3 @@ def failure_reason_message
end end
end end
end end
Gitlab::Ci::Status::Build::Failed.prepend_mod_with('Gitlab::Ci::Status::Build::Failed')
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册