@@ -139,7 +139,7 @@ def _handle_workflow_start_message(self, r_wfid: str) -> None:
139
139
# Launch the first step.
140
140
# If there's a launch problem the step (and running workflow) will have
141
141
# and error, stopping it. There will be no Pod event as the launch has failed.
142
- self ._launch (wf = wf_response , rwf = rwf_response , rwfs_id = r_wfsid , step = first_step )
142
+ self ._launch (rwf = rwf_response , rwfs_id = r_wfsid , step = first_step )
143
143
144
144
def _handle_pod_message (self , msg : PodMessage ) -> None :
145
145
"""Handles a PodMessage. This is a message that signals the completion of a
@@ -263,7 +263,6 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
263
263
)
264
264
265
265
self ._launch (
266
- wf = wf_response ,
267
266
rwf = rwf_response ,
268
267
rwfs_id = r_wfsid ,
269
268
step = next_step ,
@@ -286,7 +285,6 @@ def _validate_step_command(
286
285
self ,
287
286
* ,
288
287
step : dict [str , Any ],
289
- workflow_variables : dict [str , Any ] | None ,
290
288
running_workflow_variables : dict [str , Any ] | None = None ,
291
289
) -> str | dict [str , Any ]:
292
290
"""Returns an error message if the command isn't valid.
@@ -328,7 +326,7 @@ def _validate_step_command(
328
326
# 'decode()' method to do this. It returns a tuple (str and boolean).
329
327
# If the boolean is True then the command can be compiled
330
328
# (i.e. it has no missing variables) and the launcher should not complain
331
- # about the command (as we'll pass the same variables to it) .
329
+ # about the command (as we'll pass the same variables to it.
332
330
# If the returned boolean is False then we can expect the returned str
333
331
# to contain an error message.
334
332
#
@@ -337,17 +335,13 @@ def _validate_step_command(
337
335
# (in descending order of priority) from...
338
336
#
339
337
# 1. The RunningWorkflow
340
- # 2. The Workflow
341
- # 3. The Job Step Specification Variables
338
+ # 2. The Job Step Specification Variables
342
339
#
343
340
# If variable 'x' is defined in all three then the RunningWorkflow's
344
341
# value must be used.
345
342
346
343
# Get any variables from the step specification.
347
344
all_variables = step_spec .pop ("variables" ) if "variables" in step_spec else {}
348
- # Merge workflow variables on top of these
349
- if workflow_variables :
350
- all_variables |= workflow_variables
351
345
# Merge running workflow variables on top of these
352
346
if running_workflow_variables :
353
347
all_variables |= running_workflow_variables
@@ -360,7 +354,6 @@ def _validate_step_command(
360
354
def _launch (
361
355
self ,
362
356
* ,
363
- wf : dict [str , Any ],
364
357
rwf : dict [str , Any ],
365
358
rwfs_id : str ,
366
359
step : dict [str , Any ],
@@ -370,12 +363,15 @@ def _launch(
370
363
371
364
_LOGGER .info ("Validating step command: %s (step=%s)..." , rwf_id , step_name )
372
365
373
- # Now check the step command can be executed (by decoding it)
374
- workflow_variables : dict [str , Any ] | None = wf .get ("variables" )
366
+ # Now check the step command can be executed
367
+ # (by trying to decoding the Job command).
368
+ #
369
+ # We pass in the workflow variables (these are provided by the user
370
+ # when the workflow is run. All workflow variables will be present in the
371
+ # running workflow record)
375
372
running_workflow_variables : dict [str , Any ] | None = rwf .get ("variables" )
376
373
error_or_variables : str | dict [str , Any ] = self ._validate_step_command (
377
374
step = step ,
378
- workflow_variables = workflow_variables ,
379
375
running_workflow_variables = running_workflow_variables ,
380
376
)
381
377
if isinstance (error_or_variables , str ):
0 commit comments