)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15de13f583f45c5b784b087636318c44a30b5223","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Agent-side receiver cache for ML2 OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Logic for subscribing to RPC callbacks,"},{"line_number":10,"context_line":"flooding the initial cache, storing updates,"},{"line_number":11,"context_line":"and generating local callback events."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"9a30ddce_9c980c1e","line":9,"updated":"2017-03-10 21:52:25.000000000","message":"that wrapping","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Agent-side receiver cache for ML2 OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Logic for subscribing to RPC callbacks,"},{"line_number":10,"context_line":"flooding the initial cache, storing updates,"},{"line_number":11,"context_line":"and generating local callback events."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"bff0334d_ed096edd","line":9,"in_reply_to":"9a30ddce_9c980c1e","updated":"2017-04-06 11:09:06.000000000","message":"Done","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"}],"neutron/agent/resource_cache.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"2e705174a7f7642ccc82ea305a09e9de1c06f100","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            return True"},{"line_number":79,"context_line":"        return False"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def record_resource_update(self, context, rtype, resource):"},{"line_number":82,"context_line":"        \"\"\"Takes in an OVO and generates an event on relevant changes."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        A change is deemed to be relevant if it is not stale and if fields"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a461143_5622c1ba","line":81,"range":{"start_line":81,"start_character":46,"end_line":81,"end_character":61},"updated":"2017-01-25 16:16:48.000000000","message":"Given that those two args are related, isn\u0027t a way to ensure that they correct? e.g passing a port type witha a network resource","commit_id":"b1d603ebc4657a143bb8ec5c7ad64313b5e8b1b0"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2b8fd59bc7df78f2ecd5c4777558311e321ce6e8","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            return True"},{"line_number":79,"context_line":"        return False"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def record_resource_update(self, context, rtype, resource):"},{"line_number":82,"context_line":"        \"\"\"Takes in an OVO and generates an event on relevant changes."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        A change is deemed to be relevant if it is not stale and if fields"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a461143_adce1658","line":81,"updated":"2017-01-26 07:28:26.000000000","message":"I\u0027m not sure if that buys us much. These come directly from the server which constructs the object and sets the type for the RPC callback and there is already a lot of test coverage there. I think we can trust it to send us the right thing.","commit_id":"b1d603ebc4657a143bb8ec5c7ad64313b5e8b1b0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15de13f583f45c5b784b087636318c44a30b5223","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from neutron import objects"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":"# ihar says this is the way to use objects. blame him :)"},{"line_number":31,"context_line":"utils.import_modules_recursively(os.path.dirname(objects.__file__))"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_174f9737","line":30,"updated":"2017-03-10 21:52:25.000000000","message":"huh, ok: https://review.openstack.org/#/c/444510/","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from neutron import objects"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":"# ihar says this is the way to use objects. blame him :)"},{"line_number":31,"context_line":"utils.import_modules_recursively(os.path.dirname(objects.__file__))"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_fcefe284","line":30,"in_reply_to":"9a30ddce_174f9737","updated":"2017-04-06 11:09:06.000000000","message":"Done","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15de13f583f45c5b784b087636318c44a30b5223","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def start_watcher(self):"},{"line_number":42,"context_line":"        self._watcher \u003d RemoteResourceWatcher(self)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def bulk_flood_cache(self):"},{"line_number":45,"context_line":"        # fills the cache with *every* entry from the server."},{"line_number":46,"context_line":"        # TODO(kevinbenton): make this more intelligent."},{"line_number":47,"context_line":"        # Cons: memory heavy, expensive initialization"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_57490fcf","line":44,"updated":"2017-03-10 21:52:25.000000000","message":"I imagine we may need to flood only objects matching particular filters passed into get_objects on server side. Is that the intelligence you talk about in line 46?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"4db4dbc7b8cb285de42aa8ed26793215fa52bdbc","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def start_watcher(self):"},{"line_number":42,"context_line":"        self._watcher \u003d RemoteResourceWatcher(self)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def bulk_flood_cache(self):"},{"line_number":45,"context_line":"        # fills the cache with *every* entry from the server."},{"line_number":46,"context_line":"        # TODO(kevinbenton): make this more intelligent."},{"line_number":47,"context_line":"        # Cons: memory heavy, expensive initialization"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a1ff146_48148a43","line":44,"range":{"start_line":44,"start_character":8,"end_line":44,"end_character":24},"updated":"2017-03-16 09:47:43.000000000","message":"should this be called on init?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def start_watcher(self):"},{"line_number":42,"context_line":"        self._watcher \u003d RemoteResourceWatcher(self)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def bulk_flood_cache(self):"},{"line_number":45,"context_line":"        # fills the cache with *every* entry from the server."},{"line_number":46,"context_line":"        # TODO(kevinbenton): make this more intelligent."},{"line_number":47,"context_line":"        # Cons: memory heavy, expensive initialization"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_9cbc566a","line":44,"range":{"start_line":44,"start_character":8,"end_line":44,"end_character":24},"in_reply_to":"3a1ff146_48148a43","updated":"2017-04-06 11:09:06.000000000","message":"No, i made it so the agent has to explicitly call it for now. It makes it so agent could initialize this and then trigger pull in background if it wanted to. It also makes testing a little easier.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def start_watcher(self):"},{"line_number":42,"context_line":"        self._watcher \u003d RemoteResourceWatcher(self)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def bulk_flood_cache(self):"},{"line_number":45,"context_line":"        # fills the cache with *every* entry from the server."},{"line_number":46,"context_line":"        # TODO(kevinbenton): make this more intelligent."},{"line_number":47,"context_line":"        # Cons: memory heavy, expensive initialization"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_1cfa8641","line":44,"in_reply_to":"9a30ddce_57490fcf","updated":"2017-04-06 11:09:06.000000000","message":"yes, i will clarify.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15de13f583f45c5b784b087636318c44a30b5223","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        puller \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":51,"context_line":"        for rtype in self.resource_types:"},{"line_number":52,"context_line":"            for resource in puller.bulk_pull(context, rtype):"},{"line_number":53,"context_line":"                self._cache_by_type_and_id[rtype][resource.id] \u003d resource"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def get_resource_by_id(self, rtype, thing_id):"},{"line_number":56,"context_line":"        \"\"\"Returns None if it doesn\u0027t exist.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_52b91d2d","line":53,"range":{"start_line":53,"start_character":58,"end_line":53,"end_character":61},"updated":"2017-03-10 21:52:25.000000000","message":"that assumes all objects have an \u0027id\u0027 field (probably not an issue right now, but maybe worth a NOTE).","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        puller \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":51,"context_line":"        for rtype in self.resource_types:"},{"line_number":52,"context_line":"            for resource in puller.bulk_pull(context, rtype):"},{"line_number":53,"context_line":"                self._cache_by_type_and_id[rtype][resource.id] \u003d resource"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def get_resource_by_id(self, rtype, thing_id):"},{"line_number":56,"context_line":"        \"\"\"Returns None if it doesn\u0027t exist.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_b7a973e0","line":53,"range":{"start_line":53,"start_character":58,"end_line":53,"end_character":61},"in_reply_to":"9a30ddce_52b91d2d","updated":"2017-04-06 11:09:06.000000000","message":"Done","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15de13f583f45c5b784b087636318c44a30b5223","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            for resource in puller.bulk_pull(context, rtype):"},{"line_number":53,"context_line":"                self._cache_by_type_and_id[rtype][resource.id] \u003d resource"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def get_resource_by_id(self, rtype, thing_id):"},{"line_number":56,"context_line":"        \"\"\"Returns None if it doesn\u0027t exist.\"\"\""},{"line_number":57,"context_line":"        return self._cache_by_type_and_id[rtype].get(thing_id)"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_d7825fc7","line":55,"range":{"start_line":55,"start_character":40,"end_line":55,"end_character":48},"updated":"2017-03-10 21:52:25.000000000","message":"obj_id?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            for resource in puller.bulk_pull(context, rtype):"},{"line_number":53,"context_line":"                self._cache_by_type_and_id[rtype][resource.id] \u003d resource"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def get_resource_by_id(self, rtype, thing_id):"},{"line_number":56,"context_line":"        \"\"\"Returns None if it doesn\u0027t exist.\"\"\""},{"line_number":57,"context_line":"        return self._cache_by_type_and_id[rtype].get(thing_id)"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_b75e13e4","line":55,"range":{"start_line":55,"start_character":40,"end_line":55,"end_character":48},"in_reply_to":"9a30ddce_d7825fc7","updated":"2017-04-06 11:09:06.000000000","message":"Done","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"b8cfece2baad4247158624e1887d2a964c2fecb4","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def get_resource_by_id(self, rtype, thing_id):"},{"line_number":56,"context_line":"        \"\"\"Returns None if it doesn\u0027t exist.\"\"\""},{"line_number":57,"context_line":"        return self._cache_by_type_and_id[rtype].get(thing_id)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_resources(self, rtype, matcher):"},{"line_number":60,"context_line":"        \"\"\"Returns a list of all resources satisfying func lambda.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"ba2be162_43403536","line":57,"range":{"start_line":57,"start_character":42,"end_line":57,"end_character":47},"updated":"2017-03-06 21:04:29.000000000","message":"Is there any chance, to receive keyword, which is not present in dictionary? Right now I didn\u0027t find any usage of this function. Probably we should ensure, that we will have rtype keyword in dict, before retrieving it.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def get_resource_by_id(self, rtype, thing_id):"},{"line_number":56,"context_line":"        \"\"\"Returns None if it doesn\u0027t exist.\"\"\""},{"line_number":57,"context_line":"        return self._cache_by_type_and_id[rtype].get(thing_id)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_resources(self, rtype, matcher):"},{"line_number":60,"context_line":"        \"\"\"Returns a list of all resources satisfying func lambda.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_379b2373","line":57,"range":{"start_line":57,"start_character":42,"end_line":57,"end_character":47},"in_reply_to":"ba2be162_43403536","updated":"2017-04-06 11:09:06.000000000","message":"I can make a nicer exception, but it definitely should still be an exception because it means someone asked the cache for a type it\u0027s not tracking.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15de13f583f45c5b784b087636318c44a30b5223","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def get_resource_by_id(self, rtype, thing_id):"},{"line_number":56,"context_line":"        \"\"\"Returns None if it doesn\u0027t exist.\"\"\""},{"line_number":57,"context_line":"        return self._cache_by_type_and_id[rtype].get(thing_id)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_resources(self, rtype, matcher):"},{"line_number":60,"context_line":"        \"\"\"Returns a list of all resources satisfying func lambda.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_b77fabde","line":57,"range":{"start_line":57,"start_character":42,"end_line":57,"end_character":47},"in_reply_to":"ba2be162_43403536","updated":"2017-03-10 21:52:25.000000000","message":"it can be achieved by: return self._cache_by_type_and_id.get(rtype).get(thing_id)","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"4db4dbc7b8cb285de42aa8ed26793215fa52bdbc","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_resources(self, rtype, matcher):"},{"line_number":60,"context_line":"        \"\"\"Returns a list of all resources satisfying func lambda.\"\"\""},{"line_number":61,"context_line":"        # TODO(kevinbenton): this is log(N), offer better lookup functions"},{"line_number":62,"context_line":"        return [r for r in self._cache_by_type_and_id[rtype].values()"},{"line_number":63,"context_line":"                if matcher(r)]"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3a1ff146_6836a6e8","line":61,"range":{"start_line":61,"start_character":37,"end_line":61,"end_character":43},"updated":"2017-03-16 09:47:43.000000000","message":"O(N)?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_resources(self, rtype, matcher):"},{"line_number":60,"context_line":"        \"\"\"Returns a list of all resources satisfying func lambda.\"\"\""},{"line_number":61,"context_line":"        # TODO(kevinbenton): this is log(N), offer better lookup functions"},{"line_number":62,"context_line":"        return [r for r in self._cache_by_type_and_id[rtype].values()"},{"line_number":63,"context_line":"                if matcher(r)]"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_5777c73b","line":61,"range":{"start_line":61,"start_character":37,"end_line":61,"end_character":43},"in_reply_to":"3a1ff146_6836a6e8","updated":"2017-04-06 11:09:06.000000000","message":"sorry, yes","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"b8cfece2baad4247158624e1887d2a964c2fecb4","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def get_resources(self, rtype, matcher):"},{"line_number":60,"context_line":"        \"\"\"Returns a list of all resources satisfying func lambda.\"\"\""},{"line_number":61,"context_line":"        # TODO(kevinbenton): this is log(N), offer better lookup functions"},{"line_number":62,"context_line":"        return [r for r in self._cache_by_type_and_id[rtype].values()"},{"line_number":63,"context_line":"                if matcher(r)]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def is_stale(self, rtype, resource):"},{"line_number":66,"context_line":"        \"\"\"Determines if a given resource update is safe to ignore."}],"source_content_type":"text/x-python","patch_set":11,"id":"ba2be162_e3bda9d8","line":63,"range":{"start_line":62,"start_character":0,"end_line":63,"end_character":30},"updated":"2017-03-06 21:04:29.000000000","message":"Is it worth to create hash table for that? How often function will be called?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def get_resources(self, rtype, matcher):"},{"line_number":60,"context_line":"        \"\"\"Returns a list of all resources satisfying func lambda.\"\"\""},{"line_number":61,"context_line":"        # TODO(kevinbenton): this is log(N), offer better lookup functions"},{"line_number":62,"context_line":"        return [r for r in self._cache_by_type_and_id[rtype].values()"},{"line_number":63,"context_line":"                if matcher(r)]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def is_stale(self, rtype, resource):"},{"line_number":66,"context_line":"        \"\"\"Determines if a given resource update is safe to ignore."}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_328e9178","line":63,"range":{"start_line":62,"start_character":0,"end_line":63,"end_character":30},"in_reply_to":"ba2be162_e3bda9d8","updated":"2017-04-06 11:09:06.000000000","message":"yeah, eventually we want to cache this stuff better. i\u0027m going to add another layer in between here so external callers don\u0027t get used to unnecessarily passing functions.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"4db4dbc7b8cb285de42aa8ed26793215fa52bdbc","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        It can be safe to ignore if it has already been deleted or if"},{"line_number":69,"context_line":"        we have a copy with a higher revision number."},{"line_number":70,"context_line":"        \"\"\""},{"line_number":71,"context_line":"        if resource.id in self._deleted_ids_by_type[rtype]:"},{"line_number":72,"context_line":"            return True"},{"line_number":73,"context_line":"        existing \u003d self._cache_by_type_and_id[rtype].get(resource.id)"},{"line_number":74,"context_line":"        if existing and existing.revision_number \u003e resource.revision_number:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a1ff146_0827f264","line":71,"range":{"start_line":71,"start_character":26,"end_line":71,"end_character":51},"updated":"2017-03-16 09:47:43.000000000","message":"This will grow over time, so the search time as well. Should there be some ttl for the entries? (like expiringdict for example)","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        It can be safe to ignore if it has already been deleted or if"},{"line_number":69,"context_line":"        we have a copy with a higher revision number."},{"line_number":70,"context_line":"        \"\"\""},{"line_number":71,"context_line":"        if resource.id in self._deleted_ids_by_type[rtype]:"},{"line_number":72,"context_line":"            return True"},{"line_number":73,"context_line":"        existing \u003d self._cache_by_type_and_id[rtype].get(resource.id)"},{"line_number":74,"context_line":"        if existing and existing.revision_number \u003e resource.revision_number:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_f2a5c9b6","line":71,"range":{"start_line":71,"start_character":26,"end_line":71,"end_character":51},"in_reply_to":"3a1ff146_0827f264","updated":"2017-04-06 11:09:06.000000000","message":"It\u0027s a set so search time should not significantly change. I\u0027ll add a TODO to expire for the size concern though.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"4db4dbc7b8cb285de42aa8ed26793215fa52bdbc","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def record_resource_update(self, context, rtype, resource):"},{"line_number":82,"context_line":"        \"\"\"Takes in an OVO and generates an event on relevant changes."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        A change is deemed to be relevant if it is not stale and if fields"},{"line_number":85,"context_line":"        changed that this cache is tracking."},{"line_number":86,"context_line":"        \"\"\""},{"line_number":87,"context_line":"        existing \u003d self._cache_by_type_and_id[rtype].get(resource.id)"},{"line_number":88,"context_line":"        self._cache_by_type_and_id[rtype][resource.id] \u003d resource"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a1ff146_e8e0d6ce","line":85,"range":{"start_line":84,"start_character":68,"end_line":85,"end_character":43},"updated":"2017-03-16 09:47:43.000000000","message":"currently it\u0027s tracking only if any fields were changed, right?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def record_resource_update(self, context, rtype, resource):"},{"line_number":82,"context_line":"        \"\"\"Takes in an OVO and generates an event on relevant changes."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        A change is deemed to be relevant if it is not stale and if fields"},{"line_number":85,"context_line":"        changed that this cache is tracking."},{"line_number":86,"context_line":"        \"\"\""},{"line_number":87,"context_line":"        existing \u003d self._cache_by_type_and_id[rtype].get(resource.id)"},{"line_number":88,"context_line":"        self._cache_by_type_and_id[rtype][resource.id] \u003d resource"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_52c5953b","line":85,"range":{"start_line":84,"start_character":68,"end_line":85,"end_character":43},"in_reply_to":"3a1ff146_e8e0d6ce","updated":"2017-04-06 11:09:06.000000000","message":"Yes, sorry, this comment is a little stale. I had a much more complex version before that worked with specific fields.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"b8cfece2baad4247158624e1887d2a964c2fecb4","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        A change is deemed to be relevant if it is not stale and if fields"},{"line_number":85,"context_line":"        changed that this cache is tracking."},{"line_number":86,"context_line":"        \"\"\""},{"line_number":87,"context_line":"        existing \u003d self._cache_by_type_and_id[rtype].get(resource.id)"},{"line_number":88,"context_line":"        self._cache_by_type_and_id[rtype][resource.id] \u003d resource"},{"line_number":89,"context_line":"        changed_fields \u003d self._get_changed_fields(existing, resource)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba2be162_1e485287","line":86,"updated":"2017-03-06 21:04:29.000000000","message":"Could you add comment, that both create and update are treated the same?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        A change is deemed to be relevant if it is not stale and if fields"},{"line_number":85,"context_line":"        changed that this cache is tracking."},{"line_number":86,"context_line":"        \"\"\""},{"line_number":87,"context_line":"        existing \u003d self._cache_by_type_and_id[rtype].get(resource.id)"},{"line_number":88,"context_line":"        self._cache_by_type_and_id[rtype][resource.id] \u003d resource"},{"line_number":89,"context_line":"        changed_fields \u003d self._get_changed_fields(existing, resource)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_5276b508","line":86,"in_reply_to":"ba2be162_1e485287","updated":"2017-04-06 11:09:06.000000000","message":"Done","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15de13f583f45c5b784b087636318c44a30b5223","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                      rtype, resource.id)"},{"line_number":93,"context_line":"            return"},{"line_number":94,"context_line":"        if existing:"},{"line_number":95,"context_line":"            LOG.debug(\"Resource %s %s updated. Old Fields: %s New Fields: %s\","},{"line_number":96,"context_line":"                      rtype, existing.id,"},{"line_number":97,"context_line":"                      {f: existing.get(f) for f in changed_fields},"},{"line_number":98,"context_line":"                      {f: resource.get(f) for f in changed_fields})"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_92d3955f","line":95,"range":{"start_line":95,"start_character":51,"end_line":95,"end_character":57},"updated":"2017-03-10 21:52:25.000000000","message":"case much?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                      rtype, resource.id)"},{"line_number":93,"context_line":"            return"},{"line_number":94,"context_line":"        if existing:"},{"line_number":95,"context_line":"            LOG.debug(\"Resource %s %s updated. Old Fields: %s New Fields: %s\","},{"line_number":96,"context_line":"                      rtype, existing.id,"},{"line_number":97,"context_line":"                      {f: existing.get(f) for f in changed_fields},"},{"line_number":98,"context_line":"                      {f: resource.get(f) for f in changed_fields})"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_52e475ac","line":95,"range":{"start_line":95,"start_character":51,"end_line":95,"end_character":57},"in_reply_to":"9a30ddce_92d3955f","updated":"2017-04-06 11:09:06.000000000","message":"Done","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"b8cfece2baad4247158624e1887d2a964c2fecb4","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                        existing\u003dexisting, updated\u003dresource,"},{"line_number":105,"context_line":"                        resource_id\u003dresource.id)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def record_resource_delete(self, context, rtype, rid):"},{"line_number":108,"context_line":"        # deletions are final, record them so we never"},{"line_number":109,"context_line":"        # accept new data for the same ID."},{"line_number":110,"context_line":"        LOG.debug(\"Resource %s deleted: %s\", rtype, rid)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba2be162_03347d48","line":107,"range":{"start_line":107,"start_character":53,"end_line":107,"end_character":56},"updated":"2017-03-06 21:04:29.000000000","message":"Could you change, for readability purposes, rid \u003d\u003e resource_id","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                        existing\u003dexisting, updated\u003dresource,"},{"line_number":105,"context_line":"                        resource_id\u003dresource.id)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def record_resource_delete(self, context, rtype, rid):"},{"line_number":108,"context_line":"        # deletions are final, record them so we never"},{"line_number":109,"context_line":"        # accept new data for the same ID."},{"line_number":110,"context_line":"        LOG.debug(\"Resource %s deleted: %s\", rtype, rid)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_529235f8","line":107,"range":{"start_line":107,"start_character":53,"end_line":107,"end_character":56},"in_reply_to":"ba2be162_03347d48","updated":"2017-04-06 11:09:06.000000000","message":"Done","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"4db4dbc7b8cb285de42aa8ed26793215fa52bdbc","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    def _get_changed_fields(self, old, new):"},{"line_number":118,"context_line":"        \"\"\"Returns a set of changed fields excluding the revision_number.\"\"\""},{"line_number":119,"context_line":"        new \u003d new.to_dict()"},{"line_number":120,"context_line":"        changed \u003d set(new)"},{"line_number":121,"context_line":"        if old:"},{"line_number":122,"context_line":"            for k, v in old.to_dict().items():"},{"line_number":123,"context_line":"                if v \u003d\u003d new.get(k):"},{"line_number":124,"context_line":"                    changed.discard(k)"},{"line_number":125,"context_line":"        changed.discard(\u0027revision_number\u0027)"},{"line_number":126,"context_line":"        return changed"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3a1ff146_e84d369a","line":124,"range":{"start_line":120,"start_character":8,"end_line":124,"end_character":38},"updated":"2017-03-16 09:47:43.000000000","message":"would smth like \u0027set(new.items()) - set(old.items())\u0027 work?","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3ac979e67c1b69b170f0215aca82d8451765d8fa","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    def _get_changed_fields(self, old, new):"},{"line_number":118,"context_line":"        \"\"\"Returns a set of changed fields excluding the revision_number.\"\"\""},{"line_number":119,"context_line":"        new \u003d new.to_dict()"},{"line_number":120,"context_line":"        changed \u003d set(new)"},{"line_number":121,"context_line":"        if old:"},{"line_number":122,"context_line":"            for k, v in old.to_dict().items():"},{"line_number":123,"context_line":"                if v \u003d\u003d new.get(k):"},{"line_number":124,"context_line":"                    changed.discard(k)"},{"line_number":125,"context_line":"        changed.discard(\u0027revision_number\u0027)"},{"line_number":126,"context_line":"        return changed"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bff0334d_ed2cce9a","line":124,"range":{"start_line":120,"start_character":8,"end_line":124,"end_character":38},"in_reply_to":"3a1ff146_e84d369a","updated":"2017-04-06 11:09:06.000000000","message":"IIRC I hit an un-hashable type error with that approach with some of the values.","commit_id":"ad26358a78b18aabc3c448d52cacb2883ec3639d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"24920a8668741e26265b9d4231de46467a37868f","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def record_resource_update(self, context, rtype, resource):"},{"line_number":90,"context_line":"        \"\"\"Takes in an OVO and generates an event on relevant changes."},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        A change is deemed to be relevant if it is not stale and if any"},{"line_number":93,"context_line":"        fields changed beyond the revision number and update time."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        Both creates and updates are handled in this function."}],"source_content_type":"text/x-python","patch_set":14,"id":"7ffa3b31_7fb84b75","line":92,"updated":"2017-04-17 22:50:29.000000000","message":"Yeah, that makes sense.","commit_id":"b6a726a6abf1348fc6d1f346fb53dac918d75db9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2a268d6de50ccab726ed86e3a3759f1ed7b4f282","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def record_resource_update(self, context, rtype, resource):"},{"line_number":90,"context_line":"        \"\"\"Takes in an OVO and generates an event on relevant changes."},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        A change is deemed to be relevant if it is not stale and if any"},{"line_number":93,"context_line":"        fields changed beyond the revision number and update time."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        Both creates and updates are handled in this function."}],"source_content_type":"text/x-python","patch_set":14,"id":"7ffa3b31_dfc52d90","line":92,"range":{"start_line":92,"start_character":42,"end_line":92,"end_character":60},"updated":"2017-04-17 12:57:55.000000000","message":"would it be better to check for \"is_stale\" here rather then in RemoteResourceWatcher (from separation of concerns perspective)?","commit_id":"b6a726a6abf1348fc6d1f346fb53dac918d75db9"}]}
