)]}'
{"watcher/applier/workflow_engine/default.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"92d4b220268a0deb861f28d2524c9f8c642320ec","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                    actions_uuid[a.uuid] \u003d task"},{"line_number":70,"context_line":"                else:"},{"line_number":71,"context_line":"                    task \u003d actions_uuid[a.uuid]"},{"line_number":72,"context_line":"                if a.parents:"},{"line_number":73,"context_line":"                    for parent_id in a.parents:"},{"line_number":74,"context_line":"                        parent_action \u003d [action for action in actions"},{"line_number":75,"context_line":"                                         if action.uuid \u003d\u003d parent_id][0]"},{"line_number":76,"context_line":"                        if parent_action.uuid not in actions_uuid:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_22046f48","line":73,"range":{"start_line":72,"start_character":16,"end_line":73,"end_character":47},"updated":"2017-01-17 14:53:00.000000000","message":"if parents is an empty list [], it will not iterate anyway so how about removing this \"if a.parents:\" ?","commit_id":"777fe0c2c5383de52741e9c5d3b449b8d9280ade"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"c805d8066cb1ae207a481e04032ba6562ea6b271","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"            e \u003d engines.load("},{"line_number":96,"context_line":"                flow, engine\u003d\u0027parallel\u0027,"},{"line_number":97,"context_line":"                max_workers\u003dCONF.watcher_workflow_engines.taskflow.max_workers)"},{"line_number":98,"context_line":"            e.run()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a3c09a3_a184af0a","line":97,"range":{"start_line":97,"start_character":28,"end_line":97,"end_character":66},"updated":"2017-01-18 08:45:32.000000000","message":"you can also write self.config.max_workers since plugin config is injected into the __init__() of the class when it gets instantiated (see https://github.com/openstack/watcher/blob/master/watcher/common/loader/loadable.py#L32-L34)","commit_id":"dc9d54720145f4ec50961659f332260326d29597"},{"author":{"_account_id":12394,"name":"David TARDIVEL","email":"David.TARDIVEL@b-com.com","username":"David.T"},"change_message_id":"77783137c97969ea361e222eb0a46f0c063a29da","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        return ["},{"line_number":55,"context_line":"            cfg.IntOpt("},{"line_number":56,"context_line":"                \u0027max_workers\u0027,"},{"line_number":57,"context_line":"                default\u003d2,"},{"line_number":58,"context_line":"                min\u003d1,"},{"line_number":59,"context_line":"                required\u003dTrue,"},{"line_number":60,"context_line":"                help\u003d\u0027Number of workers for taskflow engine \u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a3905b3_402bbceb","line":57,"range":{"start_line":57,"start_character":0,"end_line":57,"end_character":26},"updated":"2017-01-19 15:40:55.000000000","message":"If you set parallelization\u003d3, in the fact you will have only 2 workers working on Taskflow task (default\u003d2), not 3.\n\nSo this parameter should set, by default, with number of CPU available on the host. cf :\n\nhttps://github.com/openstack/watcher/blob/master/watcher/common/service.py#L86","commit_id":"55939200378e71d9db1ff0c9cd95b92e742a2b0c"},{"author":{"_account_id":19055,"name":"Alexander Chadin","email":"joker946@gmail.com","username":"joker946"},"change_message_id":"dd92a1787eb331cc3d04d062c45d39613a04656a","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        return ["},{"line_number":55,"context_line":"            cfg.IntOpt("},{"line_number":56,"context_line":"                \u0027max_workers\u0027,"},{"line_number":57,"context_line":"                default\u003d2,"},{"line_number":58,"context_line":"                min\u003d1,"},{"line_number":59,"context_line":"                required\u003dTrue,"},{"line_number":60,"context_line":"                help\u003d\u0027Number of workers for taskflow engine \u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a3905b3_d9abfd87","line":57,"range":{"start_line":57,"start_character":0,"end_line":57,"end_character":26},"in_reply_to":"5a3905b3_402bbceb","updated":"2017-01-20 10:49:18.000000000","message":"Done","commit_id":"55939200378e71d9db1ff0c9cd95b92e742a2b0c"},{"author":{"_account_id":12394,"name":"David TARDIVEL","email":"David.TARDIVEL@b-com.com","username":"David.T"},"change_message_id":"77783137c97969ea361e222eb0a46f0c063a29da","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            # The current implementation uses graph with linked actions."},{"line_number":73,"context_line":"            # todo(jed) add olso conf for retry and name"},{"line_number":74,"context_line":"            flow \u003d gf.Flow(\"watcher_flow\")"},{"line_number":75,"context_line":"            actions_uuid \u003d {}"},{"line_number":76,"context_line":"            for a in actions:"},{"line_number":77,"context_line":"                if a.uuid not in actions_uuid.keys():"},{"line_number":78,"context_line":"                    task \u003d TaskFlowActionContainer(a, self)"},{"line_number":79,"context_line":"                    flow.add(task)"},{"line_number":80,"context_line":"                    actions_uuid[a.uuid] \u003d task"},{"line_number":81,"context_line":"                else:"},{"line_number":82,"context_line":"                    task \u003d actions_uuid[a.uuid]"},{"line_number":83,"context_line":"                for parent_id in a.parents:"},{"line_number":84,"context_line":"                    parent_action \u003d [action for action in actions"},{"line_number":85,"context_line":"                                     if action.uuid \u003d\u003d parent_id][0]"},{"line_number":86,"context_line":"                    if parent_action.uuid not in actions_uuid:"},{"line_number":87,"context_line":"                        parent_task \u003d TaskFlowActionContainer("},{"line_number":88,"context_line":"                            parent_action, self)"},{"line_number":89,"context_line":"                        flow.add(parent_task)"},{"line_number":90,"context_line":"                        actions_uuid[parent_action.uuid] \u003d parent_task"},{"line_number":91,"context_line":"                    flow.link(actions_uuid[parent_action.uuid], task,"},{"line_number":92,"context_line":"                              decider\u003dself.decider)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"            e \u003d engines.load("},{"line_number":95,"context_line":"                flow, engine\u003d\u0027parallel\u0027,"},{"line_number":96,"context_line":"                max_workers\u003dself.config.max_workers)"},{"line_number":97,"context_line":"            e.run()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        except Exception as e:"},{"line_number":100,"context_line":"            raise exception.WorkflowExecutionException(error\u003de)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a3905b3_aba44157","line":97,"range":{"start_line":75,"start_character":0,"end_line":97,"end_character":19},"updated":"2017-01-19 15:40:55.000000000","message":"why not proceed in 2 steps:\n .first, create all task in the the flow\n . secondly, create the link between task (for each action, get parents uuid and create the link (you should create before a hash table with hash[action uuid] \u003d\u003e task.\n\nSo we should need only 2 iterative loops to build the flow graph.","commit_id":"55939200378e71d9db1ff0c9cd95b92e742a2b0c"},{"author":{"_account_id":19055,"name":"Alexander Chadin","email":"joker946@gmail.com","username":"joker946"},"change_message_id":"dd92a1787eb331cc3d04d062c45d39613a04656a","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            # The current implementation uses graph with linked actions."},{"line_number":73,"context_line":"            # todo(jed) add olso conf for retry and name"},{"line_number":74,"context_line":"            flow \u003d gf.Flow(\"watcher_flow\")"},{"line_number":75,"context_line":"            actions_uuid \u003d {}"},{"line_number":76,"context_line":"            for a in actions:"},{"line_number":77,"context_line":"                if a.uuid not in actions_uuid.keys():"},{"line_number":78,"context_line":"                    task \u003d TaskFlowActionContainer(a, self)"},{"line_number":79,"context_line":"                    flow.add(task)"},{"line_number":80,"context_line":"                    actions_uuid[a.uuid] \u003d task"},{"line_number":81,"context_line":"                else:"},{"line_number":82,"context_line":"                    task \u003d actions_uuid[a.uuid]"},{"line_number":83,"context_line":"                for parent_id in a.parents:"},{"line_number":84,"context_line":"                    parent_action \u003d [action for action in actions"},{"line_number":85,"context_line":"                                     if action.uuid \u003d\u003d parent_id][0]"},{"line_number":86,"context_line":"                    if parent_action.uuid not in actions_uuid:"},{"line_number":87,"context_line":"                        parent_task \u003d TaskFlowActionContainer("},{"line_number":88,"context_line":"                            parent_action, self)"},{"line_number":89,"context_line":"                        flow.add(parent_task)"},{"line_number":90,"context_line":"                        actions_uuid[parent_action.uuid] \u003d parent_task"},{"line_number":91,"context_line":"                    flow.link(actions_uuid[parent_action.uuid], task,"},{"line_number":92,"context_line":"                              decider\u003dself.decider)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"            e \u003d engines.load("},{"line_number":95,"context_line":"                flow, engine\u003d\u0027parallel\u0027,"},{"line_number":96,"context_line":"                max_workers\u003dself.config.max_workers)"},{"line_number":97,"context_line":"            e.run()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        except Exception as e:"},{"line_number":100,"context_line":"            raise exception.WorkflowExecutionException(error\u003de)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a3905b3_7cee77b5","line":97,"range":{"start_line":75,"start_character":0,"end_line":97,"end_character":19},"in_reply_to":"5a3905b3_aba44157","updated":"2017-01-20 10:49:18.000000000","message":"Done","commit_id":"55939200378e71d9db1ff0c9cd95b92e742a2b0c"}],"watcher/conf/applier.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"92d4b220268a0deb861f28d2524c9f8c642320ec","unresolved":false,"context_lines":[{"line_number":41,"context_line":"               default\u003d\u0027taskflow\u0027,"},{"line_number":42,"context_line":"               required\u003dTrue,"},{"line_number":43,"context_line":"               help\u003d\u0027Select the engine to use to execute the workflow\u0027),"},{"line_number":44,"context_line":"    cfg.IntOpt(\u0027max_workers\u0027,"},{"line_number":45,"context_line":"               default\u003d2,"},{"line_number":46,"context_line":"               min\u003d1,"},{"line_number":47,"context_line":"               required\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_fdf04cff","line":44,"range":{"start_line":44,"start_character":16,"end_line":44,"end_character":27},"updated":"2017-01-17 14:53:00.000000000","message":"Since this is a taskflow plugin parameter, we should instead declare it like below within watcher/applier/workflow_engine/default.py\n\nclass DefaultWorkFlowEngine():\n    # ...\n\n    @classmethod\n    def get_config_opts(cls):\n        return [\n            cfg.IntOpt(\n                \u0027max_workers\u0027,\n                default\u003d2,\n                min\u003d1,\n                required\u003dTrue,\n                help\u003d\u0027Number of workers for taskflow engine \u0027\n                     \u0027to execute actions.\u0027)","commit_id":"777fe0c2c5383de52741e9c5d3b449b8d9280ade"}],"watcher/tests/applier/workflow_engine/test_default_workflow_engine.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"6ed651e12f8522c853c8ae9923271b3ee7224933","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        except Exception as exc:"},{"line_number":131,"context_line":"            self.fail(exc)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def test_execute_with_two_actions(self):"},{"line_number":134,"context_line":"        actions \u003d []"},{"line_number":135,"context_line":"        second \u003d self.create_action(\"sleep\", {\u0027duration\u0027: 0.0}, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a3905b3_d35231dd","line":132,"updated":"2017-01-19 13:36:27.000000000","message":"Can you add one or more unit tests to check the actual structure of the flow you built is the same as the action plan\u0027s graph structure we provided in the first place?","commit_id":"55939200378e71d9db1ff0c9cd95b92e742a2b0c"},{"author":{"_account_id":19055,"name":"Alexander Chadin","email":"joker946@gmail.com","username":"joker946"},"change_message_id":"dd92a1787eb331cc3d04d062c45d39613a04656a","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        except Exception as exc:"},{"line_number":131,"context_line":"            self.fail(exc)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def test_execute_with_two_actions(self):"},{"line_number":134,"context_line":"        actions \u003d []"},{"line_number":135,"context_line":"        second \u003d self.create_action(\"sleep\", {\u0027duration\u0027: 0.0}, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a3905b3_e8153d49","line":132,"in_reply_to":"5a3905b3_d35231dd","updated":"2017-01-20 10:49:18.000000000","message":"Done","commit_id":"55939200378e71d9db1ff0c9cd95b92e742a2b0c"}]}
