summaryrefslogtreecommitdiff
path: root/app/models/ci/processable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/processable.rb')
-rw-r--r--app/models/ci/processable.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/models/ci/processable.rb b/app/models/ci/processable.rb
index c123bd7c33b..cc00500662d 100644
--- a/app/models/ci/processable.rb
+++ b/app/models/ci/processable.rb
@@ -49,7 +49,7 @@ module Ci
end
validates :type, presence: true
- validates :scheduling_type, presence: true, on: :create, if: :validate_scheduling_type?
+ validates :scheduling_type, presence: true, on: :create, unless: :importing?
delegate :merge_request?,
:merge_request_ref?,
@@ -83,7 +83,7 @@ module Ci
# Overriding scheduling_type enum's method for nil `scheduling_type`s
def scheduling_type_dag?
- super || find_legacy_scheduling_type == :dag
+ scheduling_type.nil? ? find_legacy_scheduling_type == :dag : super
end
# scheduling_type column of previous builds/bridges have not been populated,
@@ -100,10 +100,12 @@ module Ci
end
end
- private
+ def ensure_scheduling_type!
+ # If this has a scheduling_type, it means all processables in the pipeline already have.
+ return if scheduling_type
- def validate_scheduling_type?
- !importing? && Feature.enabled?(:validate_scheduling_type_of_processables, project)
+ pipeline.ensure_scheduling_type!
+ reset
end
end
end