Commit 53fa7948 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add failure reason enum to CI/CD pipeline model

parent 7b5a6be4
......@@ -71,6 +71,10 @@ module Ci
auto_devops_source: 2
}
enum failure_reason: {
unknown_failure: 0
}.merge(EE_FAILURE_REASONS)
state_machine :status, initial: :created do
event :enqueue do
transition created: :pending
......
module EE
module Ci
module Pipeline
EE_FAILURE_REASONS = {
activity_limit_exceeded: 20,
size_limit_exceeded: 21
}.freeze
def predefined_variables
result = super
result << { key: 'CI_PIPELINE_SOURCE', value: source.to_s, public: true }
......
require 'spec_helper'
describe Ci::Pipeline do
describe '.failure_reasons' do
it 'contains failure reasons about exceeded limits' do
expect(described_class.failure_reasons)
.to include 'activity_limit_exceeded', 'size_limit_exceeded'
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