File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
gcloud/template_base/domains Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ class YamlSchemaConverter(BaseSchemaConverter):
59
59
"retryable" : True ,
60
60
"skippable" : True ,
61
61
"stage_name" : "" ,
62
+ "auto_retry" : {
63
+ "enable" : False ,
64
+ "times" : 0 ,
65
+ "interval" : 0 ,
66
+ },
62
67
},
63
68
"SubProcess" : {
64
69
"error_ignorable" : False ,
@@ -146,13 +151,21 @@ def validate_data(self, yaml_docs: list):
146
151
if "id" not in node or "type" not in node :
147
152
error .append ("模版下所有节点都必须包含id和type字段" )
148
153
continue
149
- if not set (self .NODE_NECESSARY_FIELDS [node ["type" ]]).issubset (node .keys ()):
150
- error .append (
151
- "节点{}所属的节点类型{}需缺少必须字段:{}" .format (
152
- node ["id" ], node ["type" ], set (self .NODE_NECESSARY_FIELDS [node ["type" ]]) - set (node .keys ())
153
- )
154
- )
155
- continue
154
+ missing_fields = set (self .NODE_NECESSARY_FIELDS [node ["type" ]]) - set (node .keys ())
155
+ if missing_fields :
156
+ node_defaults = self .NODE_DEFAULT_FIELD_VALUE .get (node ["type" ], {})
157
+ filled_fields = set ()
158
+
159
+ for field in missing_fields :
160
+ if field in node_defaults :
161
+ node [field ] = node_defaults [field ]
162
+ filled_fields .add (field )
163
+
164
+ missing_fields -= filled_fields
165
+
166
+ if missing_fields :
167
+ error .append ("节点{}所属的节点类型{}需缺少必须字段:{}" .format (node ["id" ], node ["type" ], sorted (missing_fields )))
168
+ continue
156
169
if node ["type" ] in ["ExclusiveGateway" , "ConditionalParallelGateway" ]:
157
170
for condition in node ["conditions" ].keys ():
158
171
if condition not in nodes_set :
You can’t perform that action at this time.
0 commit comments