)]}'
{"watcher/applier/action_plan/default.py":[{"author":{"_account_id":23871,"name":"MargaritaShakhova","email":"shakhova.margarita@gmail.com","username":"MargaritaShakhova"},"change_message_id":"21552aab3852b53f8fe7e0d89e8ef80669816198","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                action\u003dfields.NotificationAction.EXECUTION,"},{"line_number":58,"context_line":"                phase\u003dfields.NotificationPhase.END)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        except exception.ActionPlanCancel as e:"},{"line_number":61,"context_line":"            action_plan.state \u003d objects.action_plan.State.CANCELLED"},{"line_number":62,"context_line":"            self._update_action_state()"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_b906ef85","line":60,"range":{"start_line":60,"start_character":45,"end_line":60,"end_character":46},"updated":"2017-05-16 13:47:39.000000000","message":"Should this exception be logged?","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"2ecdb95cb35d2561d8618ec790791ff810614fa5","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                action\u003dfields.NotificationAction.EXECUTION,"},{"line_number":58,"context_line":"                phase\u003dfields.NotificationPhase.END)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        except exception.ActionPlanCancel as e:"},{"line_number":61,"context_line":"            action_plan.state \u003d objects.action_plan.State.CANCELLED"},{"line_number":62,"context_line":"            self._update_action_state()"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_51ed6d89","line":60,"range":{"start_line":60,"start_character":45,"end_line":60,"end_character":46},"in_reply_to":"1f013ff3_b906ef85","updated":"2017-05-17 05:21:56.000000000","message":"yes sit can be logged, i will add","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"d20552ba1123c592c5f0a2ad5964e2b60ac68fec","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        finally:"},{"line_number":73,"context_line":"            action_plan.save()"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def _update_action_state(self):"},{"line_number":76,"context_line":"        filters \u003d {\u0027action_plan_uuid\u0027: self.action_plan_uuid,"},{"line_number":77,"context_line":"                   \u0027state\u0027: objects.action.State.PENDING}"},{"line_number":78,"context_line":"        actions \u003d objects.Action.list(self.ctx, filters\u003dfilters, eager\u003dTrue)"},{"line_number":79,"context_line":"        for a in actions:"},{"line_number":80,"context_line":"            a.state \u003d objects.action.State.CANCELLED"},{"line_number":81,"context_line":"            a.save()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_07f45e85","line":81,"range":{"start_line":75,"start_character":1,"end_line":81,"end_character":20},"updated":"2017-05-16 14:47:47.000000000","message":"The function name is confusing. Seems the current implementation only change state from PENDING to CANCELLED. I think either keep the function name as is and add \"fromState\" and \"toState\", or change the function name to make it more specific.","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"2ecdb95cb35d2561d8618ec790791ff810614fa5","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        finally:"},{"line_number":73,"context_line":"            action_plan.save()"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def _update_action_state(self):"},{"line_number":76,"context_line":"        filters \u003d {\u0027action_plan_uuid\u0027: self.action_plan_uuid,"},{"line_number":77,"context_line":"                   \u0027state\u0027: objects.action.State.PENDING}"},{"line_number":78,"context_line":"        actions \u003d objects.Action.list(self.ctx, filters\u003dfilters, eager\u003dTrue)"},{"line_number":79,"context_line":"        for a in actions:"},{"line_number":80,"context_line":"            a.state \u003d objects.action.State.CANCELLED"},{"line_number":81,"context_line":"            a.save()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_b1f03169","line":81,"range":{"start_line":75,"start_character":1,"end_line":81,"end_character":20},"in_reply_to":"1f013ff3_07f45e85","updated":"2017-05-17 05:21:56.000000000","message":"ok, i will change it to be specific","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"from oslo_log import log"},{"line_number":20,"context_line":"from watcher.applier.action_plan import base"},{"line_number":21,"context_line":"from watcher.applier import default"},{"line_number":22,"context_line":"from watcher.common import exception"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2ff07967","line":19,"updated":"2017-05-30 08:07:59.000000000","message":"Please remain blank line.\nhttps://docs.openstack.org/developer/hacking/#real-world-import-order-examples","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"from oslo_log import log"},{"line_number":20,"context_line":"from watcher.applier.action_plan import base"},{"line_number":21,"context_line":"from watcher.applier import default"},{"line_number":22,"context_line":"from watcher.common import exception"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_adbc8c69","line":19,"in_reply_to":"df140735_2ff07967","updated":"2017-05-30 12:43:27.000000000","message":"Done","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from watcher.common import exception"},{"line_number":23,"context_line":"from watcher import notifications"},{"line_number":24,"context_line":"from watcher import objects"},{"line_number":25,"context_line":"from watcher.objects import fields"},{"line_number":26,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_0ff5b557","line":25,"updated":"2017-05-30 08:07:59.000000000","message":"ditto","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from watcher.common import exception"},{"line_number":23,"context_line":"from watcher import notifications"},{"line_number":24,"context_line":"from watcher import objects"},{"line_number":25,"context_line":"from watcher.objects import fields"},{"line_number":26,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_8db1c892","line":25,"in_reply_to":"df140735_0ff5b557","updated":"2017-05-30 12:43:27.000000000","message":"Done","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"}],"watcher/applier/actions/base.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"9164408f8e914c4ff1b5404536931e37ff6d1f92","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        return True"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def check_abort(self):"},{"line_number":137,"context_line":"        if self.__class__.__name__ in self.ABORT_TRUE:"},{"line_number":138,"context_line":"            return True"},{"line_number":139,"context_line":"        else:"},{"line_number":140,"context_line":"            False"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_92be6463","line":137,"range":{"start_line":137,"start_character":11,"end_line":137,"end_character":53},"updated":"2017-05-31 14:34:13.000000000","message":"nit: you can simplify this function to:\n\n    return bool(self.__class__.__name__ in self.ABORT_TRUE)","commit_id":"7e6aebea31ccab7f9eadcf7b0bab9ea88d6cb0e7"}],"watcher/applier/actions/migration.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"5858237e1dc8fe4068dfad66e49c1b0634e47bea","unresolved":false,"context_lines":[{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def abort(self):"},{"line_number":168,"context_line":"        # TODO(adisky): implement abort for migration"},{"line_number":169,"context_line":"        pass"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def pre_condition(self):"},{"line_number":172,"context_line":"        # TODO(jed): check if the instance exists / check if the instance is on"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_7d6a9c80","line":169,"range":{"start_line":169,"start_character":8,"end_line":169,"end_character":12},"updated":"2017-05-16 08:48:54.000000000","message":"instead of having a pass, can you instead add a LOG.info() or LOG.debug() so that people notice it\u0027s not done yet within the logs?","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":23871,"name":"MargaritaShakhova","email":"shakhova.margarita@gmail.com","username":"MargaritaShakhova"},"change_message_id":"a330af567b965609a504f5e2a3a598997b8ce274","unresolved":false,"context_lines":[{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def abort(self):"},{"line_number":168,"context_line":"        # TODO(adisky): implement abort for migration"},{"line_number":169,"context_line":"        pass"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def pre_condition(self):"},{"line_number":172,"context_line":"        # TODO(jed): check if the instance exists / check if the instance is on"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_397e5f19","line":169,"range":{"start_line":169,"start_character":8,"end_line":169,"end_character":12},"in_reply_to":"1f013ff3_7d6a9c80","updated":"2017-05-16 13:46:02.000000000","message":"I think it could be LOG.warning() until implemented.","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"}],"watcher/applier/actions/nop.py":[{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslo_log import log"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import voluptuous"},{"line_number":23,"context_line":"from watcher.applier.actions import base"},{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2fbe3965","line":22,"updated":"2017-05-30 08:07:59.000000000","message":"Please remain blank line.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslo_log import log"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import voluptuous"},{"line_number":23,"context_line":"from watcher.applier.actions import base"},{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_4dabb01c","line":22,"in_reply_to":"df140735_2fbe3965","updated":"2017-05-30 12:43:27.000000000","message":"Done","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from oslo_log import log"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import voluptuous"},{"line_number":23,"context_line":"from watcher.applier.actions import base"},{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_0fc375ef","line":23,"updated":"2017-05-30 08:07:59.000000000","message":"Please remain blank line.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from oslo_log import log"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import voluptuous"},{"line_number":23,"context_line":"from watcher.applier.actions import base"},{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2da87c1d","line":23,"in_reply_to":"df140735_0fc375ef","updated":"2017-05-30 12:43:27.000000000","message":"Done","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"}],"watcher/applier/workflow_engine/base.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"5858237e1dc8fe4068dfad66e49c1b0634e47bea","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def notify(self, action, state):"},{"line_number":83,"context_line":"        db_action \u003d objects.Action.get_by_uuid(self.context, action.uuid,"},{"line_number":84,"context_line":"                                               eager\u003dTrue)"},{"line_number":85,"context_line":"        if (db_action.state in [\"CANCELLING\", \"CANCELLED\"]"},{"line_number":86,"context_line":"                and state \u003d\u003d \"SUCCEEDED\"):"},{"line_number":87,"context_line":"            return"},{"line_number":88,"context_line":"        db_action.state \u003d state"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_bdd94484","line":85,"range":{"start_line":85,"start_character":33,"end_line":85,"end_character":43},"updated":"2017-05-16 08:48:54.000000000","message":"instead of using the string, can you please use the objects.action.State.CANCELLING value? I don\u0027t make the comment everywhere but if you can do it for the rest of this file that would be great :)","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"e86181ee74e65604d6ddc5fa9ee6ee7a54c77ef3","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def notify(self, action, state):"},{"line_number":83,"context_line":"        db_action \u003d objects.Action.get_by_uuid(self.context, action.uuid,"},{"line_number":84,"context_line":"                                               eager\u003dTrue)"},{"line_number":85,"context_line":"        if (db_action.state in [\"CANCELLING\", \"CANCELLED\"]"},{"line_number":86,"context_line":"                and state \u003d\u003d \"SUCCEEDED\"):"},{"line_number":87,"context_line":"            return"},{"line_number":88,"context_line":"        db_action.state \u003d state"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_3de2d4d6","line":85,"range":{"start_line":85,"start_character":33,"end_line":85,"end_character":43},"in_reply_to":"1f013ff3_bdd94484","updated":"2017-05-16 08:54:42.000000000","message":"i will change it everywhere","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"5858237e1dc8fe4068dfad66e49c1b0634e47bea","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                fields.NotificationPhase.ERROR,"},{"line_number":164,"context_line":"                priority\u003dfields.NotificationPriority.ERROR)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def execute(self, *args, **kwargs):"},{"line_number":167,"context_line":"        def _do_execute_action(*args, **kwargs):"},{"line_number":168,"context_line":"            try:"},{"line_number":169,"context_line":"                self.do_execute(*args, **kwargs)"},{"line_number":170,"context_line":"                notifications.action.send_execution_notification("},{"line_number":171,"context_line":"                    self.engine.context, self._db_action,"},{"line_number":172,"context_line":"                    fields.NotificationAction.EXECUTION,"},{"line_number":173,"context_line":"                    fields.NotificationPhase.END)"},{"line_number":174,"context_line":"            except Exception as e:"},{"line_number":175,"context_line":"                LOG.exception(e)"},{"line_number":176,"context_line":"                LOG.error(\u0027The workflow engine has failed\u0027"},{"line_number":177,"context_line":"                          \u0027to execute the action: %s\u0027, self.name)"},{"line_number":178,"context_line":"                self.engine.notify(self._db_action,"},{"line_number":179,"context_line":"                                   objects.action.State.FAILED)"},{"line_number":180,"context_line":"                notifications.action.send_execution_notification("},{"line_number":181,"context_line":"                    self.engine.context, self._db_action,"},{"line_number":182,"context_line":"                    fields.NotificationAction.EXECUTION,"},{"line_number":183,"context_line":"                    fields.NotificationPhase.ERROR,"},{"line_number":184,"context_line":"                    priority\u003dfields.NotificationPriority.ERROR)"},{"line_number":185,"context_line":"                raise"},{"line_number":186,"context_line":"        # NOTE: spawn a new thread for action execution, so that if action plan"},{"line_number":187,"context_line":"        # is cancelled workflow engine will not wait to finish action execution"},{"line_number":188,"context_line":"        et \u003d eventlet.spawn(_do_execute_action, *args, **kwargs)"},{"line_number":189,"context_line":"        # NOTE: check for the state of action plan periodically,so that if"},{"line_number":190,"context_line":"        # action is finished or action plan is cancelled we can exit from here."},{"line_number":191,"context_line":"        while True:"},{"line_number":192,"context_line":"            action_object \u003d objects.Action.get_by_uuid("},{"line_number":193,"context_line":"                self.engine.context, self._db_action.uuid, eager\u003dTrue)"},{"line_number":194,"context_line":"            action_plan_object \u003d objects.ActionPlan.get_by_id("},{"line_number":195,"context_line":"                self.engine.context, action_object.action_plan_id)"},{"line_number":196,"context_line":"            if (action_object.state in [\"SUCCEEDED\", \"FAILED\"] or"},{"line_number":197,"context_line":"               action_plan_object.state in [\"CANCELLING\", \"CANCELLED\"]):"},{"line_number":198,"context_line":"                break"},{"line_number":199,"context_line":"            time.sleep(2)"},{"line_number":200,"context_line":"        try:"},{"line_number":201,"context_line":"            # NOTE: kill the action execution thread, if action plan is"},{"line_number":202,"context_line":"            # cancelled for all other cases wait for the result from action"},{"line_number":203,"context_line":"            # execution thread."},{"line_number":204,"context_line":"            if action_plan_object.state in [\u0027CANCELLING\u0027, \"CANCELLED\"]:"},{"line_number":205,"context_line":"                et.kill()"},{"line_number":206,"context_line":"            et.wait()"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"            # NOTE: catch the greenlet exit exception due to thread kill,"},{"line_number":209,"context_line":"            # taskflow will call revert for the action,"},{"line_number":210,"context_line":"            # we will redirect it to abort."},{"line_number":211,"context_line":"        except eventlet.greenlet.GreenletExit:"},{"line_number":212,"context_line":"            pass"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        except Exception as e:"},{"line_number":215,"context_line":"            LOG.exception(e)"},{"line_number":216,"context_line":"            raise"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def post_execute(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_fda90cdf","line":215,"range":{"start_line":166,"start_character":0,"end_line":215,"end_character":28},"updated":"2017-05-16 08:48:54.000000000","message":"this piece of logic is quite complex and I don\u0027t see any new unit test that covers it. So can you please add some?","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"e86181ee74e65604d6ddc5fa9ee6ee7a54c77ef3","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                fields.NotificationPhase.ERROR,"},{"line_number":164,"context_line":"                priority\u003dfields.NotificationPriority.ERROR)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def execute(self, *args, **kwargs):"},{"line_number":167,"context_line":"        def _do_execute_action(*args, **kwargs):"},{"line_number":168,"context_line":"            try:"},{"line_number":169,"context_line":"                self.do_execute(*args, **kwargs)"},{"line_number":170,"context_line":"                notifications.action.send_execution_notification("},{"line_number":171,"context_line":"                    self.engine.context, self._db_action,"},{"line_number":172,"context_line":"                    fields.NotificationAction.EXECUTION,"},{"line_number":173,"context_line":"                    fields.NotificationPhase.END)"},{"line_number":174,"context_line":"            except Exception as e:"},{"line_number":175,"context_line":"                LOG.exception(e)"},{"line_number":176,"context_line":"                LOG.error(\u0027The workflow engine has failed\u0027"},{"line_number":177,"context_line":"                          \u0027to execute the action: %s\u0027, self.name)"},{"line_number":178,"context_line":"                self.engine.notify(self._db_action,"},{"line_number":179,"context_line":"                                   objects.action.State.FAILED)"},{"line_number":180,"context_line":"                notifications.action.send_execution_notification("},{"line_number":181,"context_line":"                    self.engine.context, self._db_action,"},{"line_number":182,"context_line":"                    fields.NotificationAction.EXECUTION,"},{"line_number":183,"context_line":"                    fields.NotificationPhase.ERROR,"},{"line_number":184,"context_line":"                    priority\u003dfields.NotificationPriority.ERROR)"},{"line_number":185,"context_line":"                raise"},{"line_number":186,"context_line":"        # NOTE: spawn a new thread for action execution, so that if action plan"},{"line_number":187,"context_line":"        # is cancelled workflow engine will not wait to finish action execution"},{"line_number":188,"context_line":"        et \u003d eventlet.spawn(_do_execute_action, *args, **kwargs)"},{"line_number":189,"context_line":"        # NOTE: check for the state of action plan periodically,so that if"},{"line_number":190,"context_line":"        # action is finished or action plan is cancelled we can exit from here."},{"line_number":191,"context_line":"        while True:"},{"line_number":192,"context_line":"            action_object \u003d objects.Action.get_by_uuid("},{"line_number":193,"context_line":"                self.engine.context, self._db_action.uuid, eager\u003dTrue)"},{"line_number":194,"context_line":"            action_plan_object \u003d objects.ActionPlan.get_by_id("},{"line_number":195,"context_line":"                self.engine.context, action_object.action_plan_id)"},{"line_number":196,"context_line":"            if (action_object.state in [\"SUCCEEDED\", \"FAILED\"] or"},{"line_number":197,"context_line":"               action_plan_object.state in [\"CANCELLING\", \"CANCELLED\"]):"},{"line_number":198,"context_line":"                break"},{"line_number":199,"context_line":"            time.sleep(2)"},{"line_number":200,"context_line":"        try:"},{"line_number":201,"context_line":"            # NOTE: kill the action execution thread, if action plan is"},{"line_number":202,"context_line":"            # cancelled for all other cases wait for the result from action"},{"line_number":203,"context_line":"            # execution thread."},{"line_number":204,"context_line":"            if action_plan_object.state in [\u0027CANCELLING\u0027, \"CANCELLED\"]:"},{"line_number":205,"context_line":"                et.kill()"},{"line_number":206,"context_line":"            et.wait()"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"            # NOTE: catch the greenlet exit exception due to thread kill,"},{"line_number":209,"context_line":"            # taskflow will call revert for the action,"},{"line_number":210,"context_line":"            # we will redirect it to abort."},{"line_number":211,"context_line":"        except eventlet.greenlet.GreenletExit:"},{"line_number":212,"context_line":"            pass"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        except Exception as e:"},{"line_number":215,"context_line":"            LOG.exception(e)"},{"line_number":216,"context_line":"            raise"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def post_execute(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_ddf9b080","line":215,"range":{"start_line":166,"start_character":0,"end_line":215,"end_character":28},"in_reply_to":"1f013ff3_fda90cdf","updated":"2017-05-16 08:54:42.000000000","message":"yes i have to add unit test, but they are more complex than it :(","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from oslo_log import log"},{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":"from taskflow import task as flow_task"},{"line_number":24,"context_line":"import time"},{"line_number":25,"context_line":"from watcher.applier.actions import factory"},{"line_number":26,"context_line":"from watcher.common import clients"},{"line_number":27,"context_line":"from watcher.common import exception"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_8fae652c","line":24,"updated":"2017-05-30 08:07:59.000000000","message":"Please insert blank line.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from oslo_log import log"},{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":"from taskflow import task as flow_task"},{"line_number":24,"context_line":"import time"},{"line_number":25,"context_line":"from watcher.applier.actions import factory"},{"line_number":26,"context_line":"from watcher.common import clients"},{"line_number":27,"context_line":"from watcher.common import exception"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_6d7314e9","line":24,"in_reply_to":"df140735_8fae652c","updated":"2017-05-30 12:43:27.000000000","message":"Done","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"CANCEL_STATE \u003d [objects.action_plan.State.CANCELLING,"},{"line_number":37,"context_line":"                objects.action_plan.State.CANCELLED]"},{"line_number":38,"context_line":"ABORT_TRUE \u003d [\"sleep\", \"nop\"]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2aff4702","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":10},"updated":"2017-05-30 08:07:59.000000000","message":"Where is this used?","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"205251c012190761974a82ca915528df1eab2b70","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"CANCEL_STATE \u003d [objects.action_plan.State.CANCELLING,"},{"line_number":37,"context_line":"                objects.action_plan.State.CANCELLED]"},{"line_number":38,"context_line":"ABORT_TRUE \u003d [\"sleep\", \"nop\"]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_5089f2c7","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":10},"in_reply_to":"df140735_04e7c042","updated":"2017-05-31 05:00:32.000000000","message":"yes, we can move this to watcher/objects/action.py, i also fell that is is not at right please but i think it is safe to not to call abort for actions which do not implement abort, check line 214, if we kill the thread and also we do not have abort implemented we won\u0027t be able to track what has happened to that action.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"CANCEL_STATE \u003d [objects.action_plan.State.CANCELLING,"},{"line_number":37,"context_line":"                objects.action_plan.State.CANCELLED]"},{"line_number":38,"context_line":"ABORT_TRUE \u003d [\"sleep\", \"nop\"]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_4d80508c","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":10},"in_reply_to":"df140735_2aff4702","updated":"2017-05-30 12:43:27.000000000","message":"line 213","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f2dad2a5dd740a940b8578b55a00840d1c0a1b7d","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"CANCEL_STATE \u003d [objects.action_plan.State.CANCELLING,"},{"line_number":37,"context_line":"                objects.action_plan.State.CANCELLED]"},{"line_number":38,"context_line":"ABORT_TRUE \u003d [\"sleep\", \"nop\"]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_04e7c042","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":10},"in_reply_to":"df140735_4d80508c","updated":"2017-05-31 00:01:19.000000000","message":"Thanks. So if we want to add abort method to action, we have to add action name to this list, right? I feel Action is too closely tied with base class.\nSince do_abort method must be implemented(you actually added LOG.warning when migration aborted), I think we can remove ABORT_TRUE, and simply abort all actions.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"f88a4561733c0e9af27ac1f18dbf05af91d221bf","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"CANCEL_STATE \u003d [objects.action_plan.State.CANCELLING,"},{"line_number":37,"context_line":"                objects.action_plan.State.CANCELLED]"},{"line_number":38,"context_line":"ABORT_TRUE \u003d [\"sleep\", \"nop\"]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_6aa3de9f","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":10},"in_reply_to":"df140735_5089f2c7","updated":"2017-05-31 07:44:25.000000000","message":"moved it to watcher/applier/actions/base.py","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f2dad2a5dd740a940b8578b55a00840d1c0a1b7d","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        raise NotImplementedError()"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    @abc.abstractmethod"},{"line_number":139,"context_line":"    def do_abort(self):"},{"line_number":140,"context_line":"        raise NotImplementedError()"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    # NOTE(alexchadin): taskflow does 3 method calls (pre_execute, execute,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_a4d5b445","line":139,"updated":"2017-05-31 00:01:19.000000000","message":"\"*args, **kwargs\" should be added.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"205251c012190761974a82ca915528df1eab2b70","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        raise NotImplementedError()"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    @abc.abstractmethod"},{"line_number":139,"context_line":"    def do_abort(self):"},{"line_number":140,"context_line":"        raise NotImplementedError()"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    # NOTE(alexchadin): taskflow does 3 method calls (pre_execute, execute,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_f08da6d3","line":139,"in_reply_to":"df140735_a4d5b445","updated":"2017-05-31 05:00:32.000000000","message":"wil add","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"f88a4561733c0e9af27ac1f18dbf05af91d221bf","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        raise NotImplementedError()"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    @abc.abstractmethod"},{"line_number":139,"context_line":"    def do_abort(self):"},{"line_number":140,"context_line":"        raise NotImplementedError()"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    # NOTE(alexchadin): taskflow does 3 method calls (pre_execute, execute,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2aade687","line":139,"in_reply_to":"df140735_f08da6d3","updated":"2017-05-31 07:44:25.000000000","message":"Done","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"}],"watcher/applier/workflow_engine/default.py":[{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        LOG.warning(\"Aborting action: %s\", self.name)"},{"line_number":145,"context_line":"        try:"},{"line_number":146,"context_line":"            self.action.abort()"},{"line_number":147,"context_line":"            self.engine.notify(self._db_action, objects.action.State.CANCELLED)"},{"line_number":148,"context_line":"        except Exception as e:"},{"line_number":149,"context_line":"            self.engine.notify(self._db_action, objects.action.State.FAILED)"},{"line_number":150,"context_line":"            LOG.exception(e)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_4f2bad93","line":147,"range":{"start_line":147,"start_character":22,"end_line":147,"end_character":79},"updated":"2017-05-30 08:07:59.000000000","message":"This implemented notifications-actionplan-cancel ?\nDo we need to do more?","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        LOG.warning(\"Aborting action: %s\", self.name)"},{"line_number":145,"context_line":"        try:"},{"line_number":146,"context_line":"            self.action.abort()"},{"line_number":147,"context_line":"            self.engine.notify(self._db_action, objects.action.State.CANCELLED)"},{"line_number":148,"context_line":"        except Exception as e:"},{"line_number":149,"context_line":"            self.engine.notify(self._db_action, objects.action.State.FAILED)"},{"line_number":150,"context_line":"            LOG.exception(e)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_cd458072","line":147,"range":{"start_line":147,"start_character":22,"end_line":147,"end_character":79},"in_reply_to":"df140735_4f2bad93","updated":"2017-05-30 12:43:27.000000000","message":"yes at other places.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"}],"watcher/common/exception.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"5858237e1dc8fe4068dfad66e49c1b0634e47bea","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                \"multiple actions\")"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"class ActionPlanCancel(WatcherException):"},{"line_number":278,"context_line":"    msg_fmt \u003d _(\"Action Plan %(action_plan)s is cancelled by user\")"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_1a14be4d","line":277,"range":{"start_line":277,"start_character":6,"end_line":277,"end_character":22},"updated":"2017-05-16 08:48:54.000000000","message":"nit: can you rename it to ActionPlanCancelled or ActionPlanIsCancelled?","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"e86181ee74e65604d6ddc5fa9ee6ee7a54c77ef3","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                \"multiple actions\")"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"class ActionPlanCancel(WatcherException):"},{"line_number":278,"context_line":"    msg_fmt \u003d _(\"Action Plan %(action_plan)s is cancelled by user\")"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_9dac488d","line":277,"range":{"start_line":277,"start_character":6,"end_line":277,"end_character":22},"in_reply_to":"1f013ff3_1a14be4d","updated":"2017-05-16 08:54:42.000000000","message":"ok i will do that","commit_id":"0aabd5ee17cc58df1f596a48a7e36eef06fbc545"}],"watcher/tests/api/v1/test_actions_plans.py":[{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.assertEqual(200, response.status_code)"},{"line_number":450,"context_line":"        applier_mock.assert_called_once_with(mock.ANY,"},{"line_number":451,"context_line":"                                             self.action_plan.uuid)"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"ALLOWED_TRANSITIONS \u003d ["},{"line_number":455,"context_line":"    {\"original_state\": objects.action_plan.State.RECOMMENDED,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2a8f4724","line":452,"updated":"2017-05-30 08:07:59.000000000","message":"Chould you add test if action plan is cancelled from pending or recommended state, update action state as NOTED in watcher/api/controllers/v1/action_plan.py?","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.assertEqual(200, response.status_code)"},{"line_number":450,"context_line":"        applier_mock.assert_called_once_with(mock.ANY,"},{"line_number":451,"context_line":"                                             self.action_plan.uuid)"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"ALLOWED_TRANSITIONS \u003d ["},{"line_number":455,"context_line":"    {\"original_state\": objects.action_plan.State.RECOMMENDED,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_2d2bdc94","line":452,"in_reply_to":"df140735_2a8f4724","updated":"2017-05-30 12:43:27.000000000","message":"if action_plan is cancelled from pending or recommended state, then no rpc call takes place only states are updates.\nThe state transition check for all the possible scenerios \nand states in watcher.objects.action_plan.State is already done below.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"}],"watcher/tests/applier/workflow_engine/test_default_workflow_engine.py":[{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"f13bb3303dbb46765c462f14f5fa1889593067ac","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            self.fail(exc)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def create_action(self, action_type, parameters, parents\u003dNone, uuid\u003dNone,"},{"line_number":77,"context_line":"                      state\u003dNone):"},{"line_number":78,"context_line":"        action \u003d {"},{"line_number":79,"context_line":"            \u0027uuid\u0027: uuid or utils.generate_uuid(),"},{"line_number":80,"context_line":"            \u0027action_plan_id\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_aac59790","line":77,"range":{"start_line":77,"start_character":22,"end_line":77,"end_character":32},"updated":"2017-05-30 08:07:59.000000000","message":"This is not used.","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"7c89555e29c046247f9cf3621dbb592c455c128d","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            self.fail(exc)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def create_action(self, action_type, parameters, parents\u003dNone, uuid\u003dNone,"},{"line_number":77,"context_line":"                      state\u003dNone):"},{"line_number":78,"context_line":"        action \u003d {"},{"line_number":79,"context_line":"            \u0027uuid\u0027: uuid or utils.generate_uuid(),"},{"line_number":80,"context_line":"            \u0027action_plan_id\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_6d0af426","line":77,"range":{"start_line":77,"start_character":22,"end_line":77,"end_character":32},"in_reply_to":"df140735_aac59790","updated":"2017-05-30 12:43:27.000000000","message":"yes, will remove it","commit_id":"7b50dc3f331563f184ea0ee95ca08bfe26e47164"}]}
