@@ -139,7 +139,7 @@ def _handle_workflow_start_message(self, r_wfid: str) -> None:
139139 # Launch the first step.
140140 # If there's a launch problem the step (and running workflow) will have
141141 # 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 )
143143
144144 def _handle_pod_message (self , msg : PodMessage ) -> None :
145145 """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:
263263 )
264264
265265 self ._launch (
266- wf = wf_response ,
267266 rwf = rwf_response ,
268267 rwfs_id = r_wfsid ,
269268 step = next_step ,
@@ -286,7 +285,6 @@ def _validate_step_command(
286285 self ,
287286 * ,
288287 step : dict [str , Any ],
289- workflow_variables : dict [str , Any ] | None ,
290288 running_workflow_variables : dict [str , Any ] | None = None ,
291289 ) -> str | dict [str , Any ]:
292290 """Returns an error message if the command isn't valid.
@@ -328,7 +326,7 @@ def _validate_step_command(
328326 # 'decode()' method to do this. It returns a tuple (str and boolean).
329327 # If the boolean is True then the command can be compiled
330328 # (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.
332330 # If the returned boolean is False then we can expect the returned str
333331 # to contain an error message.
334332 #
@@ -337,17 +335,13 @@ def _validate_step_command(
337335 # (in descending order of priority) from...
338336 #
339337 # 1. The RunningWorkflow
340- # 2. The Workflow
341- # 3. The Job Step Specification Variables
338+ # 2. The Job Step Specification Variables
342339 #
343340 # If variable 'x' is defined in all three then the RunningWorkflow's
344341 # value must be used.
345342
346343 # Get any variables from the step specification.
347344 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
351345 # Merge running workflow variables on top of these
352346 if running_workflow_variables :
353347 all_variables |= running_workflow_variables
@@ -360,7 +354,6 @@ def _validate_step_command(
360354 def _launch (
361355 self ,
362356 * ,
363- wf : dict [str , Any ],
364357 rwf : dict [str , Any ],
365358 rwfs_id : str ,
366359 step : dict [str , Any ],
@@ -370,12 +363,15 @@ def _launch(
370363
371364 _LOGGER .info ("Validating step command: %s (step=%s)..." , rwf_id , step_name )
372365
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)
375372 running_workflow_variables : dict [str , Any ] | None = rwf .get ("variables" )
376373 error_or_variables : str | dict [str , Any ] = self ._validate_step_command (
377374 step = step ,
378- workflow_variables = workflow_variables ,
379375 running_workflow_variables = running_workflow_variables ,
380376 )
381377 if isinstance (error_or_variables , str ):
0 commit comments