Commit 36cc60a4 authored by allison.browne's avatar allison.browne

Revert "Make parent_validations work"

This reverts commit efab9bd02d6a962641bbdb7d53c63091e1299356.
parent 7eb70c63
......@@ -11,6 +11,8 @@ module Gitlab
include ::Gitlab::Config::Entry::Validatable
validations do
validates :config, type: Hash
validate do
each_unmatched_job do |name|
errors.add(name, 'config should implement a script: or a trigger: keyword')
......
......@@ -10,14 +10,12 @@ module Gitlab
class ComposableHash < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable
def self.parent_validations
validations do
validates :config, type: Hash
end
# TODO: Refactor Validatable so these validations will not apply to a child class
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/263231
validations do
validates :config, type: Hash
end
parent_validations
def compose!(deps = nil)
super do
@config.each do |name, config|
......
......@@ -20,8 +20,6 @@ module Gitlab
yield(self) if block_given?
self.class.parent_validations if self.class.respond_to?(:parent_validations)
self.class.aspects.to_a.each do |aspect|
instance_exec(&aspect)
end
......
......@@ -39,6 +39,8 @@ module Gitlab
end
end
private
def validations(&block)
(@validations ||= []).append(block)
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