)]}'
{"smaug/services/protection/provider.py":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"eae4ab486f8fca777a19068557a2b9b21006e854","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            parameters \u003d plan.get(\u0027parameters\u0027)"},{"line_number":160,"context_line":"            graph_resources \u003d []"},{"line_number":161,"context_line":"            for resource in resources:"},{"line_number":162,"context_line":"                graph_resources.append(Resource(type\u003dresource[\u0027type\u0027],"},{"line_number":163,"context_line":"                                                id\u003dresource[\u0027id\u0027]))"},{"line_number":164,"context_line":"            resource_graph \u003d self.protectable_registry.build_graph("},{"line_number":165,"context_line":"                cntxt,"},{"line_number":166,"context_line":"                graph_resources)"}],"source_content_type":"text/x-python","patch_set":7,"id":"dab17558_95d2b65a","line":163,"range":{"start_line":162,"start_character":0,"end_line":163,"end_character":67},"updated":"2016-05-10 10:33:07.000000000","message":"missing name","commit_id":"a18c82f33d70aa4e3a9e868eb5c57732991d59c8"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"f1832d294eedc7394fe1cd70d0880c9064da3bfb","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                                                name\u003dresource[\u0027name\u0027]))"},{"line_number":163,"context_line":"            # TODO(luobin): pass registry in ctx"},{"line_number":164,"context_line":"            registry \u003d ProtectableRegistry()"},{"line_number":165,"context_line":"            registry.load_plugins()"},{"line_number":166,"context_line":"            resource_graph \u003d registry.build_graph(cntxt, graph_resources)"},{"line_number":167,"context_line":"            resource_context \u003d ResourceGraphContext("},{"line_number":168,"context_line":"                cntxt\u003dcntxt,"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_bda7d409","line":165,"range":{"start_line":165,"start_character":0,"end_line":165,"end_character":35},"updated":"2016-05-16 13:34:18.000000000","message":"no need to load_plugins, they are shared between every ProtectableRegistry object.","commit_id":"43105f8896b4eb2e5f8a6d4e5f2aace476ae7120"},{"author":{"_account_id":19345,"name":"smile-luobin","email":"luobin_smile@163.com","username":"smile-luobin"},"change_message_id":"6c4da159794422084e7ca520ff63dcb77562fe56","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                                                name\u003dresource[\u0027name\u0027]))"},{"line_number":163,"context_line":"            # TODO(luobin): pass registry in ctx"},{"line_number":164,"context_line":"            registry \u003d ProtectableRegistry()"},{"line_number":165,"context_line":"            registry.load_plugins()"},{"line_number":166,"context_line":"            resource_graph \u003d registry.build_graph(cntxt, graph_resources)"},{"line_number":167,"context_line":"            resource_context \u003d ResourceGraphContext("},{"line_number":168,"context_line":"                cntxt\u003dcntxt,"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_7c60ada5","line":165,"range":{"start_line":165,"start_character":0,"end_line":165,"end_character":35},"in_reply_to":"dab17558_bda7d409","updated":"2016-05-17 02:56:22.000000000","message":"OK","commit_id":"43105f8896b4eb2e5f8a6d4e5f2aace476ae7120"}],"smaug/services/protection/resource_graph.py":[{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"6caca2b8cc34fc181d6bbca808df52b41f5ec4f5","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def on_node_enter(self, node, already_visited):"},{"line_number":39,"context_line":"        resource \u003d node.value"},{"line_number":40,"context_line":"        resource_type \u003d getattr(resource, \"resource_type\", None)"},{"line_number":41,"context_line":"        protection_plugin \u003d self._get_protection_plugin(resource_type)"},{"line_number":42,"context_line":"        # update context"},{"line_number":43,"context_line":"        self.context.resource \u003d resource"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_9c0bfed5","line":40,"range":{"start_line":40,"start_character":43,"end_line":40,"end_character":56},"updated":"2016-03-04 02:02:03.000000000","message":"If resource here is the common Resource type defined in resource.py, attribute name should be \u0027type\u0027.","commit_id":"b9db83d79ac51a8020599cc3e1bbebf8d1462ec9"},{"author":{"_account_id":19346,"name":"yinwei","email":"yinweiishere@icloud.com","username":"yinwei"},"change_message_id":"a1b6c7690b4d8143fdae3363d08ef3a83abef2a8","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        resources \u003d plan.resources"},{"line_number":42,"context_line":"        if resource not in resources:"},{"line_number":43,"context_line":"            # this resource is not in protection_plan"},{"line_number":44,"context_line":"            return"},{"line_number":45,"context_line":"        resource_type \u003d getattr(resource, \"type\", None)"},{"line_number":46,"context_line":"        protection_plugin \u003d self._get_protection_plugin(resource_type)"},{"line_number":47,"context_line":"        # update context"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_61a40957","line":44,"updated":"2016-03-16 01:09:13.000000000","message":"should protect all dependent resources, this check is not necessary.","commit_id":"f30351d24ce8c5cc540e78e32bfb4c96752129df"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"80094ee7f70b2802a4d7f5c3af67e13b1d71334b","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        if resource not in resources:"},{"line_number":43,"context_line":"            # this resource is not in protection_plan"},{"line_number":44,"context_line":"            return"},{"line_number":45,"context_line":"        resource_type \u003d getattr(resource, \"type\", None)"},{"line_number":46,"context_line":"        protection_plugin \u003d self._get_protection_plugin(resource_type)"},{"line_number":47,"context_line":"        # update context"},{"line_number":48,"context_line":"        self.context.resource \u003d resource"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_54d1cbcc","line":45,"range":{"start_line":45,"start_character":24,"end_line":45,"end_character":55},"updated":"2016-03-21 13:29:54.000000000","message":"What is wrong with:\nresource.type","commit_id":"f30351d24ce8c5cc540e78e32bfb4c96752129df"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"80094ee7f70b2802a4d7f5c3af67e13b1d71334b","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        resource_type \u003d getattr(resource, \"type\", None)"},{"line_number":46,"context_line":"        protection_plugin \u003d self._get_protection_plugin(resource_type)"},{"line_number":47,"context_line":"        # update context"},{"line_number":48,"context_line":"        self.context.resource \u003d resource"},{"line_number":49,"context_line":"        self.context.is_first_visited \u003d not already_visited"},{"line_number":50,"context_line":"        # do something in protection_plugin"},{"line_number":51,"context_line":"        protection_plugin.on_resource_start(self.context)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa0719c6_56827053","line":48,"range":{"start_line":48,"start_character":0,"end_line":48,"end_character":40},"updated":"2016-03-21 13:29:54.000000000","message":"You need to clone the context before passing it to the protection plugin since it might keep it after the function returns.","commit_id":"f30351d24ce8c5cc540e78e32bfb4c96752129df"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"11748ad59068c8412f0f7e045ffbeb62a76c9b8d","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class ResourceGraphWalkerListener(GraphWalkerListener):"},{"line_number":33,"context_line":"    def __init__(self, context):"},{"line_number":34,"context_line":"        self.context \u003d context"},{"line_number":35,"context_line":"        self.plugin_map \u003d self.context.plugin_map"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def on_node_enter(self, node, already_visited):"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa0719c6_584864cc","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":30},"updated":"2016-03-23 14:03:57.000000000","message":"As Saggi said, you need to clone the context here","commit_id":"5deacaa4333dfc9417a304bf0d2de6858527b46c"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"418171e5a476d7f7c982e27299113a86b6d53673","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.node \u003d node"},{"line_number":27,"context_line":"        self.task_builder \u003d task_builder"},{"line_number":28,"context_line":"        self.task_flow \u003d task_flow"},{"line_number":29,"context_line":"        self.task_stack \u003d []"},{"line_number":30,"context_line":"        self.status_getters \u003d []"},{"line_number":31,"context_line":"        # TODO(luobin)"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_06656d44","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":28},"updated":"2016-04-04 15:59:57.000000000","message":"I understand why you want the task stack but this is open for abuse and will not work very well with plugins that do things differently. Please catch me on IRC so I could explain more.","commit_id":"c63fa642b81292791edac11fcb42142bf0d8f3fd"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"418171e5a476d7f7c982e27299113a86b6d53673","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class ResourceGraphWalkerListener(GraphWalkerListener):"},{"line_number":35,"context_line":"    def __init__(self, context):"},{"line_number":36,"context_line":"        self.context \u003d deepcopy(context)"},{"line_number":37,"context_line":"        self.plugin_map \u003d self.context.plugin_map"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def on_node_enter(self, node, already_visited):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_86233d05","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":40},"updated":"2016-04-04 15:59:57.000000000","message":"The context has to be cloned before every call to on_resource_start() and on_resource_exit().\n\nActually there is no need to even clone here.\n\nAlso making a deep copy is quite wasteful since most of the content can be copied using shallow copy.\n\nI think the best way to handle this is to make a copy() method in ResourceGraphContext() that will create a copy that makes since.","commit_id":"c63fa642b81292791edac11fcb42142bf0d8f3fd"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"d617383f1cb208ae63525c0a1e07d38cf1f7368b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        LOG.info(_(\"on_node_enter, node resource_type:%s\"), resource_type)"},{"line_number":53,"context_line":"        protection_plugin \u003d self._get_protection_plugin(resource_type)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        # TODO(luobin): add copy self.context before on_resource_start"},{"line_number":56,"context_line":"        # update context"},{"line_number":57,"context_line":"        self.context.node \u003d node"},{"line_number":58,"context_line":"        self.context.is_first_visited \u003d not already_visited"},{"line_number":59,"context_line":"        # do something in protection_plugin"},{"line_number":60,"context_line":"        protection_plugin.on_resource_start(self.context)"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"dab17558_608f1ccd","line":58,"range":{"start_line":55,"start_character":0,"end_line":58,"end_character":59},"updated":"2016-05-12 09:16:16.000000000","message":"Sorry, I don\u0027t understand why should copy the context before invoking on_resource_start, you just use context to pass the arguments. Maybe it is better to add more argument for on_resource_start.","commit_id":"a18c82f33d70aa4e3a9e868eb5c57732991d59c8"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"eae4ab486f8fca777a19068557a2b9b21006e854","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        LOG.info(_(\"on_node_enter, node resource_type:%s\"), resource_type)"},{"line_number":53,"context_line":"        protection_plugin \u003d self._get_protection_plugin(resource_type)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        # TODO(luobin): add copy self.context before on_resource_start"},{"line_number":56,"context_line":"        # update context"},{"line_number":57,"context_line":"        self.context.node \u003d node"},{"line_number":58,"context_line":"        self.context.is_first_visited \u003d not already_visited"},{"line_number":59,"context_line":"        # do something in protection_plugin"},{"line_number":60,"context_line":"        protection_plugin.on_resource_start(self.context)"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"dab17558_154246ae","line":58,"range":{"start_line":55,"start_character":0,"end_line":58,"end_character":59},"updated":"2016-05-10 10:33:07.000000000","message":"if the context is not copied, wouldn\u0027t is_first_visited be overwritten?","commit_id":"a18c82f33d70aa4e3a9e868eb5c57732991d59c8"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"314611ac9d34c939b7dedad02f77ef297fb45a51","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.heat_template \u003d heat_template"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_node_context(self, node, is_first_visited\u003dNone):"},{"line_number":46,"context_line":"        node_context \u003d ResourceGraphContext("},{"line_number":47,"context_line":"            self.cntxt,"},{"line_number":48,"context_line":"            is_first_visited\u003dis_first_visited,"},{"line_number":49,"context_line":"            operation\u003dcopy(self.operation),"},{"line_number":50,"context_line":"            parameters\u003dcopy(self.parameters),"},{"line_number":51,"context_line":"            plugin_map\u003dcopy(self.plugin_map),"},{"line_number":52,"context_line":"            node\u003dnode,"},{"line_number":53,"context_line":"            workflow_engine\u003dcopy(self.workflow_engine),"},{"line_number":54,"context_line":"            task_flow\u003dself.task_flow,"},{"line_number":55,"context_line":"            checkpoint\u003dcopy(self.checkpoint),"},{"line_number":56,"context_line":"            heat_template\u003dself.heat_template"},{"line_number":57,"context_line":"        )"},{"line_number":58,"context_line":"        node_context.task_stack \u003d self.task_stack"},{"line_number":59,"context_line":"        node_context.status_getters \u003d self.status_getters"},{"line_number":60,"context_line":"        return node_context"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_e20948df","line":57,"range":{"start_line":46,"start_character":0,"end_line":57,"end_character":9},"updated":"2016-05-18 09:28:00.000000000","message":"if you create a new ResourceGraphContext(), there is no need to `copy()` each parameter, especially since all these parameters are \u0027read-only\u0027","commit_id":"cb31d3323011df543e3d2b84698de9982b8528ef"},{"author":{"_account_id":19345,"name":"smile-luobin","email":"luobin_smile@163.com","username":"smile-luobin"},"change_message_id":"eb3c06456f214bd3834854ccc03ce994c1a53f66","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.heat_template \u003d heat_template"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_node_context(self, node, is_first_visited\u003dNone):"},{"line_number":46,"context_line":"        node_context \u003d ResourceGraphContext("},{"line_number":47,"context_line":"            self.cntxt,"},{"line_number":48,"context_line":"            is_first_visited\u003dis_first_visited,"},{"line_number":49,"context_line":"            operation\u003dcopy(self.operation),"},{"line_number":50,"context_line":"            parameters\u003dcopy(self.parameters),"},{"line_number":51,"context_line":"            plugin_map\u003dcopy(self.plugin_map),"},{"line_number":52,"context_line":"            node\u003dnode,"},{"line_number":53,"context_line":"            workflow_engine\u003dcopy(self.workflow_engine),"},{"line_number":54,"context_line":"            task_flow\u003dself.task_flow,"},{"line_number":55,"context_line":"            checkpoint\u003dcopy(self.checkpoint),"},{"line_number":56,"context_line":"            heat_template\u003dself.heat_template"},{"line_number":57,"context_line":"        )"},{"line_number":58,"context_line":"        node_context.task_stack \u003d self.task_stack"},{"line_number":59,"context_line":"        node_context.status_getters \u003d self.status_getters"},{"line_number":60,"context_line":"        return node_context"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_fcb6d9da","line":57,"range":{"start_line":46,"start_character":0,"end_line":57,"end_character":9},"in_reply_to":"bab6814e_e20948df","updated":"2016-05-19 02:59:48.000000000","message":"OK","commit_id":"cb31d3323011df543e3d2b84698de9982b8528ef"}]}
