Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
36cc60a4
Commit
36cc60a4
authored
Oct 07, 2020
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Make parent_validations work"
This reverts commit efab9bd02d6a962641bbdb7d53c63091e1299356.
parent
7eb70c63
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
lib/gitlab/ci/config/entry/jobs.rb
lib/gitlab/ci/config/entry/jobs.rb
+2
-0
lib/gitlab/config/entry/composable_hash.rb
lib/gitlab/config/entry/composable_hash.rb
+4
-6
lib/gitlab/config/entry/node.rb
lib/gitlab/config/entry/node.rb
+0
-2
lib/gitlab/config/entry/validatable.rb
lib/gitlab/config/entry/validatable.rb
+2
-0
No files found.
lib/gitlab/ci/config/entry/jobs.rb
View file @
36cc60a4
...
...
@@ -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'
)
...
...
lib/gitlab/config/entry/composable_hash.rb
View file @
36cc60a4
...
...
@@ -10,13 +10,11 @@ module Gitlab
class
ComposableHash
<
::
Gitlab
::
Config
::
Entry
::
Node
include
::
Gitlab
::
Config
::
Entry
::
Validatable
def
self
.
parent_validations
# 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
end
parent_validations
def
compose!
(
deps
=
nil
)
super
do
...
...
lib/gitlab/config/entry/node.rb
View file @
36cc60a4
...
...
@@ -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
...
...
lib/gitlab/config/entry/validatable.rb
View file @
36cc60a4
...
...
@@ -39,6 +39,8 @@ module Gitlab
end
end
private
def
validations
(
&
block
)
(
@validations
||=
[]).
append
(
block
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment