diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index 748579a4d38..bab5566754d 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -879,10 +879,13 @@ class ToolModule( WorkflowModule ): # Create new PJA associations with the created job, to be run on completion. # PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now) # Pass along replacement dict with the execution of the PJA so we don't have to modify the object. - post_job_actions = step.post_job_actions + + # Combine workflow and runtime post job actions into the effective post + # job actions for this execution. + effective_post_job_actions = step.post_job_actions[:] for key, value in self.runtime_post_job_actions.iteritems(): - post_job_actions.append( self.__to_pja( key, value, step ) ) - for pja in post_job_actions: + effective_post_job_actions.append( self.__to_pja( key, value, None ) ) + for pja in effective_post_job_actions: if pja.action_type in ActionBox.immediate_actions: ActionBox.execute( self.trans.app, self.trans.sa_session, pja, job, replacement_dict ) else: diff --git a/test/api/test_workflows.py b/test/api/test_workflows.py index 2e057545ec7..ac5a8c43c63 100644 --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -867,6 +867,13 @@ test_data: content = self.dataset_populator.get_history_dataset_details( history_id, wait=True, assert_ok=True ) assert content[ "name" ] == "foo was replaced", content[ "name" ] + # Test for regression of previous behavior where runtime post job actions + # would be added to the original workflow post job actions. + workflow_id = workflow_request["workflow_id"] + downloaded_workflow = self._download_workflow( workflow_id ) + pjas = downloaded_workflow[ "steps" ][ "2" ][ "post_job_actions" ].values() + assert len( pjas ) == 0, len( pjas ) + @skip_without_tool( "cat1" ) def test_run_with_delayed_runtime_pja( self ): workflow_id = self._upload_yaml_workflow("""