Loading lib/galaxy/model/__init__.py +6 −1 Original line number Diff line number Diff line Loading @@ -9000,6 +9000,10 @@ class WorkflowInvocation(Base, UsesCreateAndUpdateTime, Dictifiable, Serializabl states = InvocationState non_terminal_states = [states.NEW, states.READY] def __strict_check_before_flush__(self): if self.state is None: raise Exception("Workflow invocation without state, this should not happen") def get_last_workflow_invocation_step_update_time(self) -> Optional[datetime]: session = required_object_session(self) stmt = select(func.max(WorkflowInvocationStep.update_time)).where( Loading Loading @@ -9331,7 +9335,8 @@ class WorkflowInvocation(Base, UsesCreateAndUpdateTime, Dictifiable, Serializabl def to_dict(self, view="collection", value_mapper=None, step_details=False, legacy_job_state=False): rval = super().to_dict(view=view, value_mapper=value_mapper) if rval["state"] is None: # bugs could result in no state being set # this shouldn't happen anymore, likely fixed in https://github.com/galaxyproject/galaxy/pull/20784 log.warning(f"Encountered workflow invocation [{self.id}] with no state set") rval["state"] = self.states.FAILED if view == "element": steps = [] Loading lib/galaxy/workflow/run_request.py +1 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,7 @@ def workflow_run_config_to_request( workflow_invocation = WorkflowInvocation() workflow_invocation.uuid = uuid.uuid1() workflow_invocation.history = run_config.target_history workflow_invocation.state = WorkflowInvocation.states.NEW ensure_object_added_to_session(workflow_invocation, object_in_session=run_config.target_history) def add_parameter(name: str, value: str, type: WorkflowRequestInputParameter.types) -> None: Loading lib/galaxy/workflow/scheduling_manager.py +7 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,13 @@ class WorkflowSchedulingManager(ConfiguresHandlers): if exception: raise exception def queue(self, workflow_invocation, request_params, flush=True, initial_state: Optional[InvocationState] = None): def queue( self, workflow_invocation: model.WorkflowInvocation, request_params, flush: bool = True, initial_state: Optional[InvocationState] = None, ): initial_state = initial_state or model.WorkflowInvocation.states.NEW workflow_invocation.set_state(initial_state) workflow_invocation.scheduler = request_params.get("scheduler", None) or self.default_scheduler_id Loading Loading
lib/galaxy/model/__init__.py +6 −1 Original line number Diff line number Diff line Loading @@ -9000,6 +9000,10 @@ class WorkflowInvocation(Base, UsesCreateAndUpdateTime, Dictifiable, Serializabl states = InvocationState non_terminal_states = [states.NEW, states.READY] def __strict_check_before_flush__(self): if self.state is None: raise Exception("Workflow invocation without state, this should not happen") def get_last_workflow_invocation_step_update_time(self) -> Optional[datetime]: session = required_object_session(self) stmt = select(func.max(WorkflowInvocationStep.update_time)).where( Loading Loading @@ -9331,7 +9335,8 @@ class WorkflowInvocation(Base, UsesCreateAndUpdateTime, Dictifiable, Serializabl def to_dict(self, view="collection", value_mapper=None, step_details=False, legacy_job_state=False): rval = super().to_dict(view=view, value_mapper=value_mapper) if rval["state"] is None: # bugs could result in no state being set # this shouldn't happen anymore, likely fixed in https://github.com/galaxyproject/galaxy/pull/20784 log.warning(f"Encountered workflow invocation [{self.id}] with no state set") rval["state"] = self.states.FAILED if view == "element": steps = [] Loading
lib/galaxy/workflow/run_request.py +1 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,7 @@ def workflow_run_config_to_request( workflow_invocation = WorkflowInvocation() workflow_invocation.uuid = uuid.uuid1() workflow_invocation.history = run_config.target_history workflow_invocation.state = WorkflowInvocation.states.NEW ensure_object_added_to_session(workflow_invocation, object_in_session=run_config.target_history) def add_parameter(name: str, value: str, type: WorkflowRequestInputParameter.types) -> None: Loading
lib/galaxy/workflow/scheduling_manager.py +7 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,13 @@ class WorkflowSchedulingManager(ConfiguresHandlers): if exception: raise exception def queue(self, workflow_invocation, request_params, flush=True, initial_state: Optional[InvocationState] = None): def queue( self, workflow_invocation: model.WorkflowInvocation, request_params, flush: bool = True, initial_state: Optional[InvocationState] = None, ): initial_state = initial_state or model.WorkflowInvocation.states.NEW workflow_invocation.set_state(initial_state) workflow_invocation.scheduler = request_params.get("scheduler", None) or self.default_scheduler_id Loading