)]}'
{"mistral/engine/workflow_handler.py":[{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"f399a8775a4cfd981a9651023260147697781a08","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    # with ERROR state."},{"line_number":51,"context_line":"    wf.stop(state, msg)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    # Cancels subworkflows."},{"line_number":54,"context_line":"    if state \u003d\u003d states.CANCELLED:"},{"line_number":55,"context_line":"        for task_ex in wf_ex.task_executions:"},{"line_number":56,"context_line":"            sub_wf_exs \u003d db_api.get_workflow_executions("},{"line_number":57,"context_line":"                task_execution_id\u003dtask_ex.id"},{"line_number":58,"context_line":"            )"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"            for sub_wf_ex in sub_wf_exs:"},{"line_number":61,"context_line":"                if not states.is_completed(sub_wf_ex.state):"},{"line_number":62,"context_line":"                    stop_workflow(sub_wf_ex, state, msg\u003dmsg)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def fail_workflow(wf_ex, msg\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_c7b07c8e","line":62,"range":{"start_line":53,"start_character":0,"end_line":62,"end_character":60},"updated":"2016-07-28 03:26:31.000000000","message":"Do we need to cancel sub-workflow? why not treat it as normal action? leave it running, when sub-workflow finishes, it will see the parent workflow was cancelled and do nothing.\n\nWhat I mean is just want to make the behaviour consistent between actions and sub-worklfows.","commit_id":"ed2aa90af51cf22d119841537d4ca3621c7a6f88"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"d81f228f5a137ca49556554e6e09993fae25d00b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    # with ERROR state."},{"line_number":51,"context_line":"    wf.stop(state, msg)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    # Cancels subworkflows."},{"line_number":54,"context_line":"    if state \u003d\u003d states.CANCELLED:"},{"line_number":55,"context_line":"        for task_ex in wf_ex.task_executions:"},{"line_number":56,"context_line":"            sub_wf_exs \u003d db_api.get_workflow_executions("},{"line_number":57,"context_line":"                task_execution_id\u003dtask_ex.id"},{"line_number":58,"context_line":"            )"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"            for sub_wf_ex in sub_wf_exs:"},{"line_number":61,"context_line":"                if not states.is_completed(sub_wf_ex.state):"},{"line_number":62,"context_line":"                    stop_workflow(sub_wf_ex, state, msg\u003dmsg)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def fail_workflow(wf_ex, msg\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_cac40394","line":62,"range":{"start_line":53,"start_character":0,"end_line":62,"end_character":60},"in_reply_to":"bacf61ea_c7b07c8e","updated":"2016-07-28 03:38:39.000000000","message":"Subworkflows and actions are different so I don\u0027t see inconsistency in the behavior. If a workflow is cancelled and state has already been changed to cancel, but subworkflows are still running (say a long running sub workflow), i think it\u0027s going to look like a bug.","commit_id":"ed2aa90af51cf22d119841537d4ca3621c7a6f88"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"d58c662d1e403ec52ef450a080ce072f0ecdae35","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    # with ERROR state."},{"line_number":51,"context_line":"    wf.stop(state, msg)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    # Cancels subworkflows."},{"line_number":54,"context_line":"    if state \u003d\u003d states.CANCELLED:"},{"line_number":55,"context_line":"        for task_ex in wf_ex.task_executions:"},{"line_number":56,"context_line":"            sub_wf_exs \u003d db_api.get_workflow_executions("},{"line_number":57,"context_line":"                task_execution_id\u003dtask_ex.id"},{"line_number":58,"context_line":"            )"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"            for sub_wf_ex in sub_wf_exs:"},{"line_number":61,"context_line":"                if not states.is_completed(sub_wf_ex.state):"},{"line_number":62,"context_line":"                    stop_workflow(sub_wf_ex, state, msg\u003dmsg)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def fail_workflow(wf_ex, msg\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_6a035774","line":62,"range":{"start_line":53,"start_character":0,"end_line":62,"end_character":60},"in_reply_to":"bacf61ea_cac40394","updated":"2016-07-28 03:50:00.000000000","message":"ok, make sense to me.","commit_id":"ed2aa90af51cf22d119841537d4ca3621c7a6f88"}],"mistral/tests/unit/engine/test_workflow_cancel.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1057dc541e4de01daddc1cdc6aee5f9908ac4997","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        wf_ex \u003d db_api.get_execution(ex_id)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.assertEqual(states.CANCELLED, wf_ex.state)"},{"line_number":56,"context_line":"        self.assertEqual(\"Cancelled by user.\", wf_ex.state_info)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_cancel_parent_workflow(self):"},{"line_number":59,"context_line":"        workbook \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_bc14429f","line":56,"range":{"start_line":56,"start_character":0,"end_line":56,"end_character":64},"updated":"2016-07-25 13:47:24.000000000","message":"IMHO this test should also check state of task2.","commit_id":"33c9b2e15915ee28074f6cca53adabd1b9b52c47"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"d656ef80593ccf9ba390bb0810768b26f085ed83","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        wf_ex \u003d db_api.get_execution(ex_id)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.assertEqual(states.CANCELLED, wf_ex.state)"},{"line_number":56,"context_line":"        self.assertEqual(\"Cancelled by user.\", wf_ex.state_info)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_cancel_parent_workflow(self):"},{"line_number":59,"context_line":"        workbook \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_5bbc196c","line":56,"range":{"start_line":56,"start_character":0,"end_line":56,"end_character":64},"in_reply_to":"dada55a8_bc14429f","updated":"2016-07-25 20:33:02.000000000","message":"There will be no task2.  But I will add some more checks here.","commit_id":"33c9b2e15915ee28074f6cca53adabd1b9b52c47"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"cfa54a8ebf01eb5e6886535f68cdbdae74b68ca8","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        task_ex \u003d self._assert_single_item(wf_ex.task_executions, name\u003d\u0027taskx\u0027)"},{"line_number":419,"context_line":"        subwf_exs \u003d self._assert_multiple_items(wf_execs, 2, name\u003d\u0027wb.subwf\u0027)"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        self.engine.stop_workflow("},{"line_number":422,"context_line":"            subwf_exs[0].id,"},{"line_number":423,"context_line":"            states.CANCELLED,"},{"line_number":424,"context_line":"            \"Cancelled by user.\""},{"line_number":425,"context_line":"        )"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"        self.engine.stop_workflow("},{"line_number":428,"context_line":"            subwf_exs[1].id,"},{"line_number":429,"context_line":"            states.ERROR,"},{"line_number":430,"context_line":"            \"Failed by user.\""},{"line_number":431,"context_line":"        )"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        self.await_execution_cancelled(subwf_exs[0].id)"},{"line_number":434,"context_line":"        self.await_execution_error(subwf_exs[1].id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_1d8d787b","line":431,"range":{"start_line":421,"start_character":0,"end_line":431,"end_character":9},"updated":"2016-07-29 09:35:01.000000000","message":"There should also be a test with this two operation in different order (first error then cancel) to check if new CANCEL operation behaves as expected.","commit_id":"f1321406da4482dbe480d588a63a7f22398d121c"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"e371ea63b7f3e043b00e844f34f2daf085b202e9","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        task_ex \u003d self._assert_single_item(wf_ex.task_executions, name\u003d\u0027taskx\u0027)"},{"line_number":419,"context_line":"        subwf_exs \u003d self._assert_multiple_items(wf_execs, 2, name\u003d\u0027wb.subwf\u0027)"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        self.engine.stop_workflow("},{"line_number":422,"context_line":"            subwf_exs[0].id,"},{"line_number":423,"context_line":"            states.CANCELLED,"},{"line_number":424,"context_line":"            \"Cancelled by user.\""},{"line_number":425,"context_line":"        )"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"        self.engine.stop_workflow("},{"line_number":428,"context_line":"            subwf_exs[1].id,"},{"line_number":429,"context_line":"            states.ERROR,"},{"line_number":430,"context_line":"            \"Failed by user.\""},{"line_number":431,"context_line":"        )"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        self.await_execution_cancelled(subwf_exs[0].id)"},{"line_number":434,"context_line":"        self.await_execution_error(subwf_exs[1].id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_a684ca0a","line":431,"range":{"start_line":421,"start_character":0,"end_line":431,"end_character":9},"in_reply_to":"bacf61ea_0da9b124","updated":"2016-08-01 11:42:57.000000000","message":"\u003e The order makes no difference.\n\nWell, it *should* make no difference, so it is good to check if it *does* not make difference. Thanks for adding it!","commit_id":"f1321406da4482dbe480d588a63a7f22398d121c"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"85ef0bb7b73215b7aa254ae83538227e7032da3a","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        task_ex \u003d self._assert_single_item(wf_ex.task_executions, name\u003d\u0027taskx\u0027)"},{"line_number":419,"context_line":"        subwf_exs \u003d self._assert_multiple_items(wf_execs, 2, name\u003d\u0027wb.subwf\u0027)"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        self.engine.stop_workflow("},{"line_number":422,"context_line":"            subwf_exs[0].id,"},{"line_number":423,"context_line":"            states.CANCELLED,"},{"line_number":424,"context_line":"            \"Cancelled by user.\""},{"line_number":425,"context_line":"        )"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"        self.engine.stop_workflow("},{"line_number":428,"context_line":"            subwf_exs[1].id,"},{"line_number":429,"context_line":"            states.ERROR,"},{"line_number":430,"context_line":"            \"Failed by user.\""},{"line_number":431,"context_line":"        )"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        self.await_execution_cancelled(subwf_exs[0].id)"},{"line_number":434,"context_line":"        self.await_execution_error(subwf_exs[1].id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_0da9b124","line":431,"range":{"start_line":421,"start_character":0,"end_line":431,"end_character":9},"in_reply_to":"bacf61ea_1d8d787b","updated":"2016-07-29 18:03:20.000000000","message":"The stop workflows here are for action executions under a with-items tasks.  The order makes no difference.  The task has to wait until all the action executions get processed before determining final state.  I can add another test just so I can get this patch thru...","commit_id":"f1321406da4482dbe480d588a63a7f22398d121c"}],"mistral/workflow/states.py":[{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"f399a8775a4cfd981a9651023260147697781a08","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    WAITING: [RUNNING],"},{"line_number":41,"context_line":"    RUNNING: [PAUSED, RUNNING_DELAYED, SUCCESS, ERROR, CANCELLED],"},{"line_number":42,"context_line":"    RUNNING_DELAYED: [RUNNING, ERROR, CANCELLED],"},{"line_number":43,"context_line":"    PAUSED: [RUNNING, ERROR, CANCELLED],"},{"line_number":44,"context_line":"    SUCCESS: [],"},{"line_number":45,"context_line":"    CANCELLED: [],"},{"line_number":46,"context_line":"    ERROR: [RUNNING]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_246876f5","line":43,"updated":"2016-07-28 03:26:31.000000000","message":"Here transition from \u0027paused\u0027 to \u0027cancelled\u0027 is allowed, but in _cancel_workflow() method in mistral/engine/workflows.py, just returned without changing the state. Is it allowed or not?","commit_id":"ed2aa90af51cf22d119841537d4ca3621c7a6f88"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"d81f228f5a137ca49556554e6e09993fae25d00b","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    WAITING: [RUNNING],"},{"line_number":41,"context_line":"    RUNNING: [PAUSED, RUNNING_DELAYED, SUCCESS, ERROR, CANCELLED],"},{"line_number":42,"context_line":"    RUNNING_DELAYED: [RUNNING, ERROR, CANCELLED],"},{"line_number":43,"context_line":"    PAUSED: [RUNNING, ERROR, CANCELLED],"},{"line_number":44,"context_line":"    SUCCESS: [],"},{"line_number":45,"context_line":"    CANCELLED: [],"},{"line_number":46,"context_line":"    ERROR: [RUNNING]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_6a46b724","line":43,"in_reply_to":"bacf61ea_246876f5","updated":"2016-07-28 03:38:39.000000000","message":"I will revisit code and address.  Thanks!","commit_id":"ed2aa90af51cf22d119841537d4ca3621c7a6f88"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"6a7cf5b9ef29b4f0b68cfb271c4c80d0b0a5fd63","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    WAITING: [RUNNING],"},{"line_number":41,"context_line":"    RUNNING: [PAUSED, RUNNING_DELAYED, SUCCESS, ERROR, CANCELLED],"},{"line_number":42,"context_line":"    RUNNING_DELAYED: [RUNNING, ERROR, CANCELLED],"},{"line_number":43,"context_line":"    PAUSED: [RUNNING, ERROR, CANCELLED],"},{"line_number":44,"context_line":"    SUCCESS: [],"},{"line_number":45,"context_line":"    CANCELLED: [],"},{"line_number":46,"context_line":"    ERROR: [RUNNING]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_8049bf62","line":43,"in_reply_to":"bacf61ea_6a46b724","updated":"2016-08-01 01:30:48.000000000","message":"Hi, Winson, I didn\u0027t see the fix, missing?","commit_id":"ed2aa90af51cf22d119841537d4ca3621c7a6f88"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"7c550dc625434531b1db9f7b5b9f914345ffc8f9","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    WAITING: [RUNNING],"},{"line_number":41,"context_line":"    RUNNING: [PAUSED, RUNNING_DELAYED, SUCCESS, ERROR, CANCELLED],"},{"line_number":42,"context_line":"    RUNNING_DELAYED: [RUNNING, ERROR, CANCELLED],"},{"line_number":43,"context_line":"    PAUSED: [RUNNING, ERROR, CANCELLED],"},{"line_number":44,"context_line":"    SUCCESS: [],"},{"line_number":45,"context_line":"    CANCELLED: [],"},{"line_number":46,"context_line":"    ERROR: [RUNNING]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_cdcf4454","line":43,"in_reply_to":"bacf61ea_8049bf62","updated":"2016-08-01 19:31:01.000000000","message":"PAUSED workflow can be CANCELLED. I added a unit test.","commit_id":"ed2aa90af51cf22d119841537d4ca3621c7a6f88"}],"mistral/workflow/utils.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1057dc541e4de01daddc1cdc6aee5f9908ac4997","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    def __init__(self, data\u003dNone, error\u003dNone, cancel\u003dFalse):"},{"line_number":25,"context_line":"        self.data \u003d data"},{"line_number":26,"context_line":"        self.error \u003d error"},{"line_number":27,"context_line":"        self.cancel \u003d cancel"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __repr__(self):"},{"line_number":30,"context_line":"        return \u0027Result [data\u003d%s, error\u003d%s, cancel\u003d%s]\u0027 % ("}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_b2010b07","line":27,"range":{"start_line":27,"start_character":13,"end_line":27,"end_character":19},"updated":"2016-07-25 13:47:24.000000000","message":"Soft: this can be treated as private value, and therefore should be change to _cancel.","commit_id":"33c9b2e15915ee28074f6cca53adabd1b9b52c47"}],"mistral/workflow/with_items.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1057dc541e4de01daddc1cdc6aee5f9908ac4997","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    find_error \u003d lambda x: x.accepted and x.state \u003d\u003d states.ERROR"},{"line_number":73,"context_line":"    find_cancel \u003d lambda x: x.accepted and x.state \u003d\u003d states.CANCELLED"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    if list(filter(find_cancel, task_ex.executions)):"},{"line_number":76,"context_line":"        return states.CANCELLED"},{"line_number":77,"context_line":"    elif list(filter(find_error, task_ex.executions)):"},{"line_number":78,"context_line":"        return states.ERROR"},{"line_number":79,"context_line":"    else:"},{"line_number":80,"context_line":"        return states.SUCCESS"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_f714154e","line":78,"range":{"start_line":75,"start_character":0,"end_line":78,"end_character":27},"updated":"2016-07-25 13:47:24.000000000","message":"I\u0027m not sure if this order is correct. I would say that ERROR is more important then CANCELLED.","commit_id":"33c9b2e15915ee28074f6cca53adabd1b9b52c47"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"d656ef80593ccf9ba390bb0810768b26f085ed83","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    find_error \u003d lambda x: x.accepted and x.state \u003d\u003d states.ERROR"},{"line_number":73,"context_line":"    find_cancel \u003d lambda x: x.accepted and x.state \u003d\u003d states.CANCELLED"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    if list(filter(find_cancel, task_ex.executions)):"},{"line_number":76,"context_line":"        return states.CANCELLED"},{"line_number":77,"context_line":"    elif list(filter(find_error, task_ex.executions)):"},{"line_number":78,"context_line":"        return states.ERROR"},{"line_number":79,"context_line":"    else:"},{"line_number":80,"context_line":"        return states.SUCCESS"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_becc2362","line":78,"range":{"start_line":75,"start_character":0,"end_line":78,"end_character":27},"in_reply_to":"dada55a8_f714154e","updated":"2016-07-25 20:33:02.000000000","message":"Done","commit_id":"33c9b2e15915ee28074f6cca53adabd1b9b52c47"}]}
