@@ -16,13 +16,6 @@ class Job < ::Gitlab::Config::Entry::Node
16
16
dependencies before_script after_script variables
17
17
environment coverage retry parallel extends ] . freeze
18
18
19
- DEFAULT_ONLY_POLICY = {
20
- refs : %w( branches tags )
21
- } . freeze
22
-
23
- DEFAULT_EXCEPT_POLICY = {
24
- } . freeze
25
-
26
19
validations do
27
20
validates :config , allowed_keys : ALLOWED_KEYS
28
21
validates :config , presence : true
@@ -73,7 +66,8 @@ class Job < ::Gitlab::Config::Entry::Node
73
66
description : 'Services that will be used to execute this job.'
74
67
75
68
entry :only , Entry ::Policy ,
76
- description : 'Refs policy this job will be executed for.'
69
+ description : 'Refs policy this job will be executed for.' ,
70
+ default : { refs : %w[ branches tags ] }
77
71
78
72
entry :except , Entry ::Policy ,
79
73
description : 'Refs policy this job will be executed for.'
@@ -156,8 +150,8 @@ def to_hash
156
150
services : services_value ,
157
151
stage : stage_value ,
158
152
cache : cache_value ,
159
- only : DEFAULT_ONLY_POLICY . deep_merge ( only_value . to_h ) ,
160
- except : DEFAULT_EXCEPT_POLICY . deep_merge ( except_value . to_h ) ,
153
+ only : only_value ,
154
+ except : except_value ,
161
155
variables : variables_defined? ? variables_value : nil ,
162
156
environment : environment_defined? ? environment_value : nil ,
163
157
environment_name : environment_defined? ? environment_value [ :name ] : nil ,
0 commit comments