Fix the global publish for task

If there is a root execution then lazy load the
params field of the root execution

Change-Id: I6b188e315007391c738b8f821fad91c4fd8572ae
(cherry picked from commit ab4d4a5807)
This commit is contained in:
Eyal 2019-10-10 14:44:33 +03:00
parent 016509eb5e
commit ce4dad8a18
2 changed files with 7 additions and 0 deletions

View File

@ -67,6 +67,11 @@ def _get_task_execution(id):
['context', 'input', 'params', 'root_execution']
)
rest_utils.load_deferred_fields(
task_ex.workflow_execution.root_execution,
['params']
)
return _get_task_resource_with_result(task_ex), task_ex

View File

@ -144,6 +144,7 @@ RERUN_TASK = {
}
MOCK_WF_EX = mock.MagicMock(return_value=WF_EX)
TASK_EX.workflow_execution = WF_EX
MOCK_TASK = mock.MagicMock(return_value=TASK_EX)
MOCK_TASKS = mock.MagicMock(return_value=[TASK_EX])
MOCK_EMPTY = mock.MagicMock(return_value=[])
@ -153,6 +154,7 @@ MOCK_ERROR_ITEMS_TASK = mock.MagicMock(return_value=ERROR_ITEMS_TASK_EX)
TASK_EX_WITH_PROJECT_ID = TASK_EX.get_clone()
TASK_EX_WITH_PROJECT_ID.project_id = '<default-project>'
TASK_EX_WITH_PROJECT_ID.workflow_execution = WF_EX
@mock.patch.object(