43
43
Connector ,
44
44
get_step ,
45
45
get_step_prior_step_plumbing ,
46
- get_step_workflow_plumbing ,
46
+ get_step_workflow_variable_connections ,
47
47
)
48
48
49
49
_LOGGER : logging .Logger = logging .getLogger (__name__ )
@@ -129,7 +129,7 @@ def _handle_workflow_start_message(self, r_wfid: str) -> None:
129
129
# Launch it.
130
130
# If there's a launch problem the step (and running workflow) will have
131
131
# and error, stopping it. There will be no Pod event as the launch has failed.
132
- self ._launch (wf = wf_response , rwf = rwf_response , step = first_step )
132
+ self ._launch (wf = wf_response , rwf = rwf_response , step_definition = first_step )
133
133
134
134
def _handle_workflow_stop_message (self , r_wfid : str ) -> None :
135
135
"""Logic to handle a STOP message."""
@@ -265,7 +265,9 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
265
265
# There's another step!
266
266
# For this simple logic it is the next step.
267
267
next_step = wf_response ["steps" ][step_index + 1 ]
268
- self ._launch (wf = wf_response , rwf = rwf_response , step = next_step )
268
+ self ._launch (
269
+ wf = wf_response , rwf = rwf_response , step_definition = next_step
270
+ )
269
271
270
272
# Something was started (or there was a launch error and the step
271
273
# and running workflow error will have been set).
@@ -330,7 +332,7 @@ def _validate_step_command(
330
332
# "in" variables are worklfow variables, and "out" variables
331
333
# are expected Job variables. We use this to add variables
332
334
# to the "all variables" map.
333
- for connector in get_step_workflow_plumbing ( step = step ):
335
+ for connector in get_step_workflow_variable_connections ( step_definition = step ):
334
336
assert connector .in_ in running_workflow_variables
335
337
all_variables [connector .out ] = running_workflow_variables [connector .in_ ]
336
338
@@ -339,7 +341,7 @@ def _validate_step_command(
339
341
# us a map indexed by prior step name that's a list of "in" "out"
340
342
# tuples as above.
341
343
prior_step_plumbing : dict [str , list [Connector ]] = get_step_prior_step_plumbing (
342
- step = step
344
+ step_definition = step
343
345
)
344
346
for prior_step_name , connections in prior_step_plumbing .items ():
345
347
# Retrieve the prior "running" step
@@ -360,9 +362,13 @@ def _validate_step_command(
360
362
return all_variables if success else message
361
363
362
364
def _launch (
363
- self , * , wf : dict [str , Any ], rwf : dict [str , Any ], step : dict [str , Any ]
365
+ self ,
366
+ * ,
367
+ wf : dict [str , Any ],
368
+ rwf : dict [str , Any ],
369
+ step_definition : dict [str , Any ],
364
370
) -> None :
365
- step_name : str = step ["name" ]
371
+ step_name : str = step_definition ["name" ]
366
372
rwf_id : str = rwf ["id" ]
367
373
project_id = rwf ["project" ]["id" ]
368
374
@@ -376,7 +382,7 @@ def _launch(
376
382
rwf_variables : dict [str , Any ] = rwf .get ("variables" , {})
377
383
error_or_variables : str | dict [str , Any ] = self ._validate_step_command (
378
384
running_workflow_id = rwf_id ,
379
- step = step ,
385
+ step = step_definition ,
380
386
running_workflow_variables = rwf_variables ,
381
387
)
382
388
if isinstance (error_or_variables , str ):
@@ -401,7 +407,9 @@ def _launch(
401
407
# be more than one prior step variable that is 'files'!
402
408
replication_values : list [str ] = []
403
409
iter_variable : str | None = None
404
- plumbing : dict [str , list [Connector ]] = get_step_prior_step_plumbing (step = step )
410
+ plumbing : dict [str , list [Connector ]] = get_step_prior_step_plumbing (
411
+ step_definition = step_definition
412
+ )
405
413
for p_step_name , connections in plumbing .items ():
406
414
# We need to get the Job definition for each step
407
415
# and then check whether the (ouptu) variable is of type 'files'...
@@ -468,7 +476,7 @@ def _launch(
468
476
debug = rwf .get ("debug" ),
469
477
launching_user_name = rwf ["running_user" ],
470
478
launching_user_api_token = rwf ["running_user_api_token" ],
471
- specification = step ["specification" ],
479
+ specification = step_definition ["specification" ],
472
480
variables = variables ,
473
481
running_workflow_id = rwf_id ,
474
482
step_name = step_name ,
0 commit comments