Commit eb8421db authored by Vitali Tatarintev's avatar Vitali Tatarintev

Move CommitStatusEnums to Enums::CommitStatus

Move enum related modules into a separate directory
parent 7b98a9d3
...@@ -77,9 +77,9 @@ class CommitStatus < ApplicationRecord ...@@ -77,9 +77,9 @@ class CommitStatus < ApplicationRecord
merge(or_conditions) merge(or_conditions)
end end
# We use `CommitStatusEnums.failure_reasons` here so that EE can more easily # We use `Enums::CommitStatus.failure_reasons` here so that EE can more easily
# extend this `Hash` with new values. # extend this `Hash` with new values.
enum_with_nil failure_reason: ::CommitStatusEnums.failure_reasons enum_with_nil failure_reason: Enums::CommitStatus.failure_reasons
## ##
# We still create some CommitStatuses outside of CreatePipelineService. # We still create some CommitStatuses outside of CreatePipelineService.
......
# frozen_string_literal: true
module Enums
module CommitStatus
# Returns the Hash to use for creating the `failure_reason` enum for
# `CommitStatus`.
def self.failure_reasons
{
unknown_failure: nil,
script_failure: 1,
api_failure: 2,
stuck_or_timeout_failure: 3,
runner_system_failure: 4,
missing_dependency_failure: 5,
runner_unsupported: 6,
stale_schedule: 7,
job_execution_timeout: 8,
archived_failure: 9,
unmet_prerequisites: 10,
scheduler_failure: 11,
data_integrity_failure: 12,
forward_deployment_failure: 13,
protected_environment_failure: 1_000,
insufficient_bridge_permissions: 1_001,
downstream_bridge_project_not_found: 1_002,
invalid_bridge_trigger: 1_003,
upstream_bridge_project_not_found: 1_004,
insufficient_upstream_permissions: 1_005,
bridge_pipeline_is_child_pipeline: 1_006,
downstream_pipeline_creation_failed: 1_007
}
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment