)]}'
{"mistral/db/sqlalchemy/model_base.py":[{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"ae2383606c6b7bba1c8f64def89fb5ae7ad0920f","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def datetime_to_str(dct, attr_name):"},{"line_number":104,"context_line":"    if (dct.get(attr_name) is not None"},{"line_number":105,"context_line":"            and not isinstance(dct.get(attr_name), six.string_types)):"},{"line_number":106,"context_line":"        dct[attr_name] \u003d dct[attr_name].isoformat(\u0027 \u0027)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_514ae584","line":105,"updated":"2015-10-28 00:41:26.000000000","message":"hi, nikolay, what\u0027s the reason of the logic changed here?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"ae2383606c6b7bba1c8f64def89fb5ae7ad0920f","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def datetime_to_str(dct, attr_name):"},{"line_number":104,"context_line":"    if (dct.get(attr_name) is not None"},{"line_number":105,"context_line":"            and not isinstance(dct.get(attr_name), six.string_types)):"},{"line_number":106,"context_line":"        dct[attr_name] \u003d dct[attr_name].isoformat(\u0027 \u0027)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_a4d8d91e","line":105,"updated":"2015-10-28 00:41:26.000000000","message":"hi, nikolay, what\u0027s the reason of the logic changed here?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"5853a362c2513dede7411c381725c224d60fab9e","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def datetime_to_str(dct, attr_name):"},{"line_number":104,"context_line":"    if (dct.get(attr_name) is not None"},{"line_number":105,"context_line":"            and not isinstance(dct.get(attr_name), six.string_types)):"},{"line_number":106,"context_line":"        dct[attr_name] \u003d dct[attr_name].isoformat(\u0027 \u0027)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_510f38e1","line":105,"in_reply_to":"1a26ad4f_a4d8d91e","updated":"2015-10-28 08:58:52.000000000","message":"In some cases dct[attr_name] is already a string, and this is a reason why I was getting attribute error here. (string doesn\u0027t have isoformat attribute)","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"}],"mistral/engine/default_engine.py":[{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"ae2383606c6b7bba1c8f64def89fb5ae7ad0920f","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                self._fail_workflow(wf_exec_id, e)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"                if wf_ex:"},{"line_number":98,"context_line":"                    return wf_ex.get_clone()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"                raise e"},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_e4ced159","line":98,"updated":"2015-10-28 00:41:26.000000000","message":"if the workflow execution is created and returned to users, i think it\u0027s useless of using transaction in L61, right?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"ae117bd30b4bf7c7ba0478b3419a2e3de691d6a9","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                self._fail_workflow(wf_exec_id, e)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"                if wf_ex:"},{"line_number":98,"context_line":"                    return wf_ex.get_clone()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"                raise e"},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_47bbd9e5","line":98,"in_reply_to":"1a26ad4f_7c46b224","updated":"2015-10-29 08:55:38.000000000","message":"yes, correct. As I understand, you suggest dividing that transaction block in two ones?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"5853a362c2513dede7411c381725c224d60fab9e","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                self._fail_workflow(wf_exec_id, e)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"                if wf_ex:"},{"line_number":98,"context_line":"                    return wf_ex.get_clone()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"                raise e"},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_f100c4ac","line":98,"in_reply_to":"1a26ad4f_e4ced159","updated":"2015-10-28 08:58:52.000000000","message":"Transaction can be rolled back if workflow execution is not created. But if it is created, then it returned and user can see error info in execution state_info.","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"22ab29a979cb04351b87534bf715487f2e8191d9","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                self._fail_workflow(wf_exec_id, e)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"                if wf_ex:"},{"line_number":98,"context_line":"                    return wf_ex.get_clone()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"                raise e"},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_7c46b224","line":98,"in_reply_to":"1a26ad4f_f100c4ac","updated":"2015-10-29 00:18:41.000000000","message":"yeah, what you said is right. I mean, after L68, the execution is already created, right? and we needn\u0027t have the code below protected under the transaction, because the transaction needn\u0027t rollback even with exception that occured after creation of the execution. Is my understanding correct?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                action_ex_id, e, traceback.format_exc()"},{"line_number":254,"context_line":"            )"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            with db_api.transaction():"},{"line_number":257,"context_line":"                self._fail_workflow(wf_ex_id, e)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"            raise e"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_f2f193ce","line":256,"updated":"2015-10-28 19:00:01.000000000","message":"Why not keep this consistent as start_workflow and move the try catch to the inside of the db_api.transaction above?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"ae117bd30b4bf7c7ba0478b3419a2e3de691d6a9","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                action_ex_id, e, traceback.format_exc()"},{"line_number":254,"context_line":"            )"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            with db_api.transaction():"},{"line_number":257,"context_line":"                self._fail_workflow(wf_ex_id, e)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"            raise e"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_67085592","line":256,"in_reply_to":"1a26ad4f_f2f193ce","updated":"2015-10-29 08:55:38.000000000","message":"That way transaction will be rolled back in case of any error occured in on_action_complete. And there is no need to do this because action_execution exists by definition of this method (except for run-action-command) in contrast to start_workflow method where wf_ex is created.","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"ff19afa421f21523b04489ef5ab2d9ff074e6e25","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                action_ex_id, e, traceback.format_exc()"},{"line_number":254,"context_line":"            )"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            with db_api.transaction():"},{"line_number":257,"context_line":"                self._fail_workflow(wf_ex_id, e)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"            raise e"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a26ad4f_f9a2b84a","line":256,"updated":"2015-10-29 17:09:23.000000000","message":"I ready your explanation in patch set #1. But I still don\u0027t get it. Sorry. But through out the file, you\u0027ve made changes to start_workflow, resume_workflow etc. to use the following pattern.\n\nwith db_api.transaction():\n    try:\n        ...\n    except Exception as e:\n        ...\n        self._fail_workflow(wf_ex_id, e)\n        raise e\n\nI don\u0027t see why you cannot keep the same pattern here in the on_action_complete method.","commit_id":"f8a136cba202a52b1f2a80595ea6d73ed76e0ca7"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"f294b88066e0b943f2035e0cbcde574f5a3c2d5a","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                action_ex_id, e, traceback.format_exc()"},{"line_number":254,"context_line":"            )"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            with db_api.transaction():"},{"line_number":257,"context_line":"                self._fail_workflow(wf_ex_id, e)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"            raise e"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a26ad4f_81a9bde1","line":256,"in_reply_to":"1a26ad4f_f9a2b84a","updated":"2015-10-30 07:08:58.000000000","message":"Maybe that pattern is wrong. So, if fail workflow is happened in the same transaction where an error appears, workflow can not be failed because the transaction will be rolled back. There should be another transaction for fail workflow. I try to find better solution for this.\n\nI think your solution is right at https://review.openstack.org/#/c/239793/2/mistral/engine/default_engine.py","commit_id":"f8a136cba202a52b1f2a80595ea6d73ed76e0ca7"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"3c0ba2649df95f7f39dd7816a37a9c499388935a","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        wf_exec_id \u003d None"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        params \u003d self._canonize_workflow_params(params)"},{"line_number":59,"context_line":"        wf_ex \u003d None"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        try:"},{"line_number":62,"context_line":"            with db_api.transaction():"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_88a107ac","line":59,"updated":"2015-11-04 01:54:17.000000000","message":"Soft: I don\u0027t think this is necessary.","commit_id":"15135962848bf5696a01d81eb9b7fd1a5af7caaf"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"d7f5ce8eb6f03e8717a35c41e3d53619acfb568c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        wf_exec_id \u003d None"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        params \u003d self._canonize_workflow_params(params)"},{"line_number":59,"context_line":"        wf_ex \u003d None"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        try:"},{"line_number":62,"context_line":"            with db_api.transaction():"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_eecbf870","line":59,"in_reply_to":"fa80f949_88a107ac","updated":"2015-11-04 06:09:44.000000000","message":"wf_ex var is used in \u0027except\u0027 block.","commit_id":"15135962848bf5696a01d81eb9b7fd1a5af7caaf"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"d9613c8abd568ebefd32800aefaf91bd1cf871bc","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        wf_exec_id \u003d None"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        params \u003d self._canonize_workflow_params(params)"},{"line_number":59,"context_line":"        wf_ex \u003d None"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        try:"},{"line_number":62,"context_line":"            with db_api.transaction():"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_de69b8bf","line":59,"in_reply_to":"fa80f949_a8911d9b","updated":"2015-11-05 18:48:04.000000000","message":"yep, nice catch! Thanks. I really frogot that.","commit_id":"15135962848bf5696a01d81eb9b7fd1a5af7caaf"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"a2e1f6be1e6364a0bcac2b66587b7b01db60f278","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        wf_exec_id \u003d None"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        params \u003d self._canonize_workflow_params(params)"},{"line_number":59,"context_line":"        wf_ex \u003d None"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        try:"},{"line_number":62,"context_line":"            with db_api.transaction():"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_a8911d9b","line":59,"in_reply_to":"fa80f949_eecbf870","updated":"2015-11-05 16:57:18.000000000","message":"But it\u0027s set by _fail_workflow before use unless I\u0027m missing something here...","commit_id":"15135962848bf5696a01d81eb9b7fd1a5af7caaf"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"a2e1f6be1e6364a0bcac2b66587b7b01db60f278","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                \"Failed to start workflow \u0027%s\u0027 id\u003d%s: %s\\n%s\","},{"line_number":99,"context_line":"                wf_name, wf_exec_id, e, traceback.format_exc()"},{"line_number":100,"context_line":"            )"},{"line_number":101,"context_line":"            wf_ex \u003d self._fail_workflow(wf_exec_id, e)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"            if wf_ex:"},{"line_number":104,"context_line":"                return wf_ex.get_clone()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_88ed3927","line":101,"updated":"2015-11-05 16:57:18.000000000","message":"It\u0027s set here before it\u0027s used in the except block.","commit_id":"15135962848bf5696a01d81eb9b7fd1a5af7caaf"}],"mistral/tests/unit/engine/test_adhoc_actions.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":137,"context_line":"            {\u0027str1\u0027: \u0027a\u0027, \u0027str2\u0027: \u0027b\u0027}"},{"line_number":138,"context_line":"        )"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        self.assertIn(\"Invalid input\", wf_ex.state_info)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_b2a1dbab","line":140,"updated":"2015-10-28 19:00:01.000000000","message":"Check wf_ex.state?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"}],"mistral/tests/unit/engine/test_direct_workflow.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        wf_ex \u003d self._run_workflow(wf_text)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        self.assertIn(\"Invalid input\", wf_ex.state_info)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def test_wrong_action(self):"},{"line_number":169,"context_line":"        wf_text \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_92b05ff6","line":166,"updated":"2015-10-28 19:00:01.000000000","message":"Check wf_ex.state?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        self.assertIn("},{"line_number":210,"context_line":"            \"Failed to find action [action_name\u003dwrong.task]\","},{"line_number":211,"context_line":"            wf_ex.state_info"},{"line_number":212,"context_line":"        )"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def test_messed_yaql(self):"},{"line_number":215,"context_line":"        wf_text \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_327dcb1c","line":212,"updated":"2015-10-28 19:00:01.000000000","message":"Check wf_ex.state?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"}],"mistral/tests/unit/engine/test_execution_fields_size_limitation.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        self.assertIn("},{"line_number":141,"context_line":"            \"Size of \u0027input\u0027 is 1KB which exceeds the limit of 0KB\","},{"line_number":142,"context_line":"            wf_ex.state_info"},{"line_number":143,"context_line":"        )"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def test_action_output_limit(self):"},{"line_number":146,"context_line":"        wf_service.create_workflows(WF)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_527ac725","line":143,"updated":"2015-10-28 19:00:01.000000000","message":"Check wf_ex.state?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        self.assertIn("},{"line_number":159,"context_line":"            \"Size of \u0027output\u0027 is 1KB which exceeds the limit of 0KB\","},{"line_number":160,"context_line":"            wf_ex.state_info"},{"line_number":161,"context_line":"        )"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def test_task_published_limit(self):"},{"line_number":164,"context_line":"        new_wf \u003d generate_workflow([\u0027__TASK_PUBLISHED__\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_b28f9b22","line":161,"updated":"2015-10-28 19:00:01.000000000","message":"Check wf_ex.state?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"}],"mistral/tests/unit/engine/test_policies.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":893,"context_line":"        self.assertIn("},{"line_number":894,"context_line":"            \u0027Invalid data type in WaitBeforePolicy\u0027,"},{"line_number":895,"context_line":"            wf_ex.state_info"},{"line_number":896,"context_line":"        )"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":"    def test_delayed_task_and_correct_finish_workflow(self):"},{"line_number":899,"context_line":"        wf_delayed_state \u003d \"\"\"---"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_929e1f55","line":896,"updated":"2015-10-28 19:00:01.000000000","message":"Check wf_ex.state?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"}],"mistral/tests/unit/engine/test_with_items.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"b9c410943e42e931440de51564f4bc2407f14a39","unresolved":false,"context_lines":[{"line_number":664,"context_line":"        self.assertIn("},{"line_number":665,"context_line":"            \"Invalid data type in ConcurrencyPolicy\","},{"line_number":666,"context_line":"            wf_ex.state_info"},{"line_number":667,"context_line":"        )"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    def test_with_items_concurrency_2(self):"},{"line_number":670,"context_line":"        workflow_with_concurrency_2 \u003d \"\"\"---"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a26ad4f_52a16793","line":667,"updated":"2015-10-28 19:00:01.000000000","message":"Check wf_ex.state?","commit_id":"d904e354fa1c798e503e8616b709c79e12da050d"}]}
