)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"592b089c468fa26f60899037bc232089ff7a0d38","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Lajos Katona \u003clajos.katona@ericsson.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-07-31 10:29:15 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use Tag OVO in neutron/db/tag_db.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I147debf7f7c8388140b160cd835dbd4a95fee784"},{"line_number":10,"context_line":"Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_e31727a3","line":7,"range":{"start_line":7,"start_character":15,"end_line":7,"end_character":35},"updated":"2018-08-17 11:07:35.000000000","message":"This commit removes completely this module so probably this commit message should be changed a bit :)","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"8effd9571aacf720d8ba241201fd8ce81b3f03f4","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Lajos Katona \u003clajos.katona@ericsson.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-07-31 10:29:15 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use Tag OVO in neutron/db/tag_db.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I147debf7f7c8388140b160cd835dbd4a95fee784"},{"line_number":10,"context_line":"Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_440be528","line":7,"range":{"start_line":7,"start_character":15,"end_line":7,"end_character":35},"in_reply_to":"3f79a3b5_e31727a3","updated":"2018-08-24 09:09:01.000000000","message":"Thanks Slawek, I nearly missed that in the big code moving","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"}],"neutron/db/tag_db.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"853272feca1c931a96f4f5a276188acd58db960d","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if \u0027tags\u0027 in filters:"},{"line_number":51,"context_line":"        tags \u003d _get_tag_list(filters.pop(\u0027tags\u0027))"},{"line_number":52,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":53,"context_line":"        query \u003d query.join(tag_obj.Tag,"},{"line_number":54,"context_line":"            model.standard_attr_id \u003d\u003d tag_obj.Tag.standard_attr_id)"},{"line_number":55,"context_line":"        query \u003d query.filter(tag_obj.Tag.tag \u003d\u003d first_tag)"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_dc862b14","line":53,"range":{"start_line":53,"start_character":27,"end_line":53,"end_character":38},"updated":"2018-05-02 20:09:19.000000000","message":"I don\u0027t think that it\u0027s good to just replace db_model with OVO and use OVO in db query.\nYou should probably move db queries to OVO object and use it here if necessary","commit_id":"292ca5c7d570584ea91ef904c26fc2db08c75b22"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"b0ecdf6b82b74e7a14fb51bb2ecd93be811195d0","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if \u0027tags\u0027 in filters:"},{"line_number":51,"context_line":"        tags \u003d _get_tag_list(filters.pop(\u0027tags\u0027))"},{"line_number":52,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":53,"context_line":"        query \u003d query.join(tag_obj.Tag,"},{"line_number":54,"context_line":"            model.standard_attr_id \u003d\u003d tag_obj.Tag.standard_attr_id)"},{"line_number":55,"context_line":"        query \u003d query.filter(tag_obj.Tag.tag \u003d\u003d first_tag)"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_7ebd0067","line":53,"range":{"start_line":53,"start_character":27,"end_line":53,"end_character":38},"in_reply_to":"5f7c97a3_642a54e8","updated":"2018-05-03 09:41:40.000000000","message":"yes, but IMO we should \"hide\" db queries in OVO methods and use those methods outside, no?","commit_id":"292ca5c7d570584ea91ef904c26fc2db08c75b22"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"21f5e44baeba73e5b89a296f31ca0e09f56d5940","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if \u0027tags\u0027 in filters:"},{"line_number":51,"context_line":"        tags \u003d _get_tag_list(filters.pop(\u0027tags\u0027))"},{"line_number":52,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":53,"context_line":"        query \u003d query.join(tag_obj.Tag,"},{"line_number":54,"context_line":"            model.standard_attr_id \u003d\u003d tag_obj.Tag.standard_attr_id)"},{"line_number":55,"context_line":"        query \u003d query.filter(tag_obj.Tag.tag \u003d\u003d first_tag)"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_e1914454","line":53,"range":{"start_line":53,"start_character":27,"end_line":53,"end_character":38},"in_reply_to":"5f7c97a3_7ebd0067","updated":"2018-05-07 09:35:16.000000000","message":"Ok, I check and move the queries to the ovo, come back soon :-)","commit_id":"292ca5c7d570584ea91ef904c26fc2db08c75b22"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"8f617ca9888c0aabc992b23753ec4579f8c5f5cc","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    if \u0027tags\u0027 in filters:"},{"line_number":51,"context_line":"        tags \u003d _get_tag_list(filters.pop(\u0027tags\u0027))"},{"line_number":52,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":53,"context_line":"        query \u003d query.join(tag_obj.Tag,"},{"line_number":54,"context_line":"            model.standard_attr_id \u003d\u003d tag_obj.Tag.standard_attr_id)"},{"line_number":55,"context_line":"        query \u003d query.filter(tag_obj.Tag.tag \u003d\u003d first_tag)"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_642a54e8","line":53,"range":{"start_line":53,"start_character":27,"end_line":53,"end_character":38},"in_reply_to":"9f6a8fd7_dc862b14","updated":"2018-05-03 06:53:43.000000000","message":"If I understand well what is \"written\" into neutron/objects/tag.py, everything is there for db queries.","commit_id":"292ca5c7d570584ea91ef904c26fc2db08c75b22"}],"neutron/objects/tag.py":[{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"80f123816c7756de5218345d47e0557af80c92c1","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    primary_keys \u003d [\u0027tag\u0027, \u0027standard_attr_id\u0027]"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def apply_tags_filter(cls, model, query, tags):"},{"line_number":37,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":38,"context_line":"        query \u003d query.join(tag_model.Tag,"},{"line_number":39,"context_line":"            model.standard_attr_id \u003d\u003d tag_model.Tag.standard_attr_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_7027dbc9","line":36,"updated":"2018-07-17 20:21:07.000000000","message":"Is there a way to do this where \u0027query\u0027 is not passed around as an argument?  Part of OVO is freeing us from passing around SQL Alchemy queries, and so this goes against the purpose of what we are trying to do.","commit_id":"dc32c967c85c7668fa0cce75a368595eb6d40775"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"e47b24598e51fa7f6bf73f2583bbd88f63ffd757","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    primary_keys \u003d [\u0027tag\u0027, \u0027standard_attr_id\u0027]"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def apply_tags_filter(cls, model, query, tags):"},{"line_number":37,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":38,"context_line":"        query \u003d query.join(tag_model.Tag,"},{"line_number":39,"context_line":"            model.standard_attr_id \u003d\u003d tag_model.Tag.standard_attr_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_9ec87d21","line":36,"in_reply_to":"5f7c97a3_7027dbc9","updated":"2018-07-18 07:48:17.000000000","message":"As I see the problem is that tag filter methods are registered as result_filters hook (https://github.com/openstack/neutron/blob/master/neutron/services/tag/tag_plugin.py#LC51), and this means that the apply_filters method will receive a query as parameter, and my original thought was to pass that towards OVO.","commit_id":"dc32c967c85c7668fa0cce75a368595eb6d40775"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"1124c289b60bcd665915ca539d71f9462a1491db","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    primary_keys \u003d [\u0027tag\u0027, \u0027standard_attr_id\u0027]"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def apply_tags_filter(cls, model, query, tags):"},{"line_number":37,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":38,"context_line":"        query \u003d query.join(tag_model.Tag,"},{"line_number":39,"context_line":"            model.standard_attr_id \u003d\u003d tag_model.Tag.standard_attr_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_b9ce9258","line":36,"in_reply_to":"5f7c97a3_7a332313","updated":"2018-07-19 09:35:58.000000000","message":"I agree with Nate. I went through the codes and it seems to me that we need to convert model_query into OVO in order to avoid passing sql queries. \n\nI do not have any specific solutions yet, but I think that is the direction we should work on. I will look into it as well.","commit_id":"dc32c967c85c7668fa0cce75a368595eb6d40775"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"ed3df9179035322f7057c181016f0c5e3af24976","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    primary_keys \u003d [\u0027tag\u0027, \u0027standard_attr_id\u0027]"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def apply_tags_filter(cls, model, query, tags):"},{"line_number":37,"context_line":"        first_tag \u003d tags.pop(0)"},{"line_number":38,"context_line":"        query \u003d query.join(tag_model.Tag,"},{"line_number":39,"context_line":"            model.standard_attr_id \u003d\u003d tag_model.Tag.standard_attr_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_7a332313","line":36,"in_reply_to":"5f7c97a3_9ec87d21","updated":"2018-07-18 14:04:41.000000000","message":"I agree, this is a sticky situation.  The entire use of model_query would be something that we would need to pull into the OVOs in it\u0027s entirety, it seems to me, so that nothing that is outside OVO method code interacts with it.","commit_id":"dc32c967c85c7668fa0cce75a368595eb6d40775"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"b164da982a51b8a9541f1e2b1cf6acbe2766465e","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    return query"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"for model in resource_model_map.values():"},{"line_number":103,"context_line":"    method \u003d functools.partial(_apply_tag_filters, model)"},{"line_number":104,"context_line":"    _filter_methods.append(method)"},{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"},{"line_number":108,"context_line":"                              result_filters\u003dmethod)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"@base.NeutronObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_ebb891c7","line":108,"range":{"start_line":102,"start_character":0,"end_line":108,"end_character":52},"updated":"2018-07-20 08:22:04.000000000","message":"I have bad feelings of this part too. I will test this part more thoroughly.","commit_id":"26ced7c097ea11fed1ad05dab069ab5d2dcebec7"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"f64d61d8a674b5f9aeec84c6f28372f8495f7bd0","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"for model in resource_model_map.values():"},{"line_number":103,"context_line":"    method \u003d functools.partial(_apply_tag_filters, model)"},{"line_number":104,"context_line":"    _filter_methods.append(method)"},{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_0c23d5bc","line":104,"range":{"start_line":104,"start_character":4,"end_line":104,"end_character":34},"updated":"2018-07-30 22:46:01.000000000","message":"Just want to confirm. There is a comment in the old file \"# prevent GC of our partial functions\". I saw this comment was removed in here. Is it intentional?","commit_id":"5d16ab9c2ff1960d2188a5c2e2ccad4c9ed651d0"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"a35426f397146d40b1cab3fde0bbb012d1cda878","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"for model in resource_model_map.values():"},{"line_number":103,"context_line":"    method \u003d functools.partial(_apply_tag_filters, model)"},{"line_number":104,"context_line":"    _filter_methods.append(method)"},{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_cdeb910e","line":104,"range":{"start_line":104,"start_character":4,"end_line":104,"end_character":34},"in_reply_to":"5f7c97a3_0c23d5bc","updated":"2018-07-31 09:12:02.000000000","message":"Thanks for noting the missing comment, I added back to _filter_methods definition","commit_id":"5d16ab9c2ff1960d2188a5c2e2ccad4c9ed651d0"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"f64d61d8a674b5f9aeec84c6f28372f8495f7bd0","unresolved":false,"context_lines":[{"line_number":102,"context_line":"for model in resource_model_map.values():"},{"line_number":103,"context_line":"    method \u003d functools.partial(_apply_tag_filters, model)"},{"line_number":104,"context_line":"    _filter_methods.append(method)"},{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"},{"line_number":108,"context_line":"                              result_filters\u003dmethod)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_e013fd58","line":105,"range":{"start_line":105,"start_character":16,"end_line":105,"end_character":29},"updated":"2018-07-30 22:46:01.000000000","message":"If I am going to picky, there might be a performance implication after this move. In before, this registration happened when initializing the Tag plugin class, which might or might not happen. After this move, this registration happened on module importing, which will always happen, even the tag extension is not enabled or used?\n\nHowever, the performance implication is likely to be insignificant so I am fine with it.","commit_id":"5d16ab9c2ff1960d2188a5c2e2ccad4c9ed651d0"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"a35426f397146d40b1cab3fde0bbb012d1cda878","unresolved":false,"context_lines":[{"line_number":102,"context_line":"for model in resource_model_map.values():"},{"line_number":103,"context_line":"    method \u003d functools.partial(_apply_tag_filters, model)"},{"line_number":104,"context_line":"    _filter_methods.append(method)"},{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"},{"line_number":108,"context_line":"                              result_filters\u003dmethod)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_2d37a5b1","line":105,"range":{"start_line":105,"start_character":16,"end_line":105,"end_character":29},"in_reply_to":"5f7c97a3_e013fd58","updated":"2018-07-31 09:12:02.000000000","message":"Sure. This way the hooks will be always created when the module is loaded, compared to the old way when the extension was loaded the hooks were created.\nAs tag extension is by default loaded (as I see) I don\u0027t feel that this is a performance fallback, of course would be good to hear others opinion as well.","commit_id":"5d16ab9c2ff1960d2188a5c2e2ccad4c9ed651d0"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"f1fb26c3c733379cfe8494a70ef75d22e12c4c3e","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"},{"line_number":108,"context_line":"                              result_filters\u003dmethod)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"@base.NeutronObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_2c2a407e","line":108,"updated":"2018-08-24 20:11:22.000000000","message":"so now this \"register_hook\" will be done every time when someone will import neutron.objects.tag module. Is it really necessary?","commit_id":"ff95039b9e208053c19dc41bd81bcef595b74cce"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"6b8a9211ff800e3cb77472ec4933b4f56f74f230","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"},{"line_number":108,"context_line":"                              result_filters\u003dmethod)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"@base.NeutronObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_65e35006","line":108,"in_reply_to":"3f79a3b5_2c2a407e","updated":"2018-08-27 15:13:01.000000000","message":"Actually the difference is that the hook registration will happen when the objects.tag module is first loaded, instead of the old way when the hooks were registered when the tag plugin was loaded. So the hooks will be registered even if the tag plugin is not enabled. As I see it is always enabled.\n\nSee the comment from Hongbin: https://review.openstack.org/#/c/565773/4/neutron/objects/tag.py@105","commit_id":"ff95039b9e208053c19dc41bd81bcef595b74cce"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"93a056296951c297ed0f5be798078be54bcac459","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"},{"line_number":108,"context_line":"                              result_filters\u003dmethod)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"@base.NeutronObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_ade920b8","line":108,"in_reply_to":"3f79a3b5_41e3a105","updated":"2018-08-29 11:05:06.000000000","message":"I moved the hook registration part to a method and call from TagPlugin.__new__, could you please check?","commit_id":"ff95039b9e208053c19dc41bd81bcef595b74cce"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"35374ebe9534d0027637b2b6ae86fbc6567b15fa","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    model_query.register_hook(model, \"tag\","},{"line_number":106,"context_line":"                              query_hook\u003dNone,"},{"line_number":107,"context_line":"                              filter_hook\u003dNone,"},{"line_number":108,"context_line":"                              result_filters\u003dmethod)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"@base.NeutronObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_41e3a105","line":108,"in_reply_to":"3f79a3b5_65e35006","updated":"2018-08-27 19:44:26.000000000","message":"I\u0027m still not sure if doing it in such \"magic\" way during import of module is good idea. Maybe better would be something like add function \"register_tag_hook\" which should be called explicit when someone wants to register it, e.g. tag plugin would call it.\nIMHO that would be later easier to read and understand for readers.","commit_id":"ff95039b9e208053c19dc41bd81bcef595b74cce"}],"neutron/services/tag/tag_plugin.py":[{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"546c27ae29db8b5a0174755718c726f60848117c","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# Taggable resources"},{"line_number":30,"context_line":"resource_model_map \u003d standard_attr.get_standard_attr_resource_model_map()"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"@resource_extend.has_resource_extenders"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_7a0f6c37","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":73},"updated":"2018-08-01 16:19:54.000000000","message":"I think resource_model_map is a new OVO we should create.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"0c447933c00d1b617f99742ac93984d75eeebc1d","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# Taggable resources"},{"line_number":30,"context_line":"resource_model_map \u003d standard_attr.get_standard_attr_resource_model_map()"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"@resource_extend.has_resource_extenders"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_9e658ab2","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":73},"in_reply_to":"5f7c97a3_7a0f6c37","updated":"2018-08-02 09:43:33.000000000","message":"I do not quite understand how you plan to do that. Would you mind elaborating a bit?\n\nMy question is resource_mode_map is not a db object, how can we make an OVO out of it?","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"3a9727084be7c01ca32a9f7c785ee04fc9d97c86","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# Taggable resources"},{"line_number":30,"context_line":"resource_model_map \u003d standard_attr.get_standard_attr_resource_model_map()"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"@resource_extend.has_resource_extenders"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_36d5ad44","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":73},"in_reply_to":"5f7c97a3_9e658ab2","updated":"2018-08-14 14:19:50.000000000","message":"Never mind about this, I had confused resource_model_map with something else.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"546c27ae29db8b5a0174755718c726f60848117c","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"@resource_extend.has_resource_extenders"},{"line_number":34,"context_line":"class TagPlugin(common_db_mixin.CommonDbMixin, tagging.TagPluginBase):"},{"line_number":35,"context_line":"    \"\"\"Implementation of the Neutron Tag Service Plugin.\"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    supported_extension_aliases \u003d [\u0027standard-attr-tag\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_9a028871","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":70},"updated":"2018-08-01 16:19:54.000000000","message":"What happens if the inheritance from common_db_mixin.CommonDbMixin is removed - and the import of it as well?","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"b4f7ca19d40767b09a1f9fc9ebf518c860c3874e","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"@resource_extend.has_resource_extenders"},{"line_number":34,"context_line":"class TagPlugin(common_db_mixin.CommonDbMixin, tagging.TagPluginBase):"},{"line_number":35,"context_line":"    \"\"\"Implementation of the Neutron Tag Service Plugin.\"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    supported_extension_aliases \u003d [\u0027standard-attr-tag\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_be3de6b9","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":70},"in_reply_to":"5f7c97a3_9a028871","updated":"2018-08-02 09:37:13.000000000","message":"I tried without CommonDbMixin as parent (and the import), and actually it worked.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"7f33ff4c52cc2c12de2a58390eae3923a1181bdb","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    def _get_resource(self, context, resource, resource_id):"},{"line_number":50,"context_line":"        model \u003d resource_model_map[resource]"},{"line_number":51,"context_line":"        try:"},{"line_number":52,"context_line":"            return model_query.get_by_id(context, model, resource_id)"},{"line_number":53,"context_line":"        except exc.NoResultFound:"},{"line_number":54,"context_line":"            raise tagging.TagResourceNotFound(resource\u003dresource,"},{"line_number":55,"context_line":"                                              resource_id\u003dresource_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_ba8e6423","line":52,"updated":"2018-08-01 15:57:54.000000000","message":"Should this be moved into the tag object as well?","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"0c447933c00d1b617f99742ac93984d75eeebc1d","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    def _get_resource(self, context, resource, resource_id):"},{"line_number":50,"context_line":"        model \u003d resource_model_map[resource]"},{"line_number":51,"context_line":"        try:"},{"line_number":52,"context_line":"            return model_query.get_by_id(context, model, resource_id)"},{"line_number":53,"context_line":"        except exc.NoResultFound:"},{"line_number":54,"context_line":"            raise tagging.TagResourceNotFound(resource\u003dresource,"},{"line_number":55,"context_line":"                                              resource_id\u003dresource_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_7e2d0e43","line":52,"in_reply_to":"5f7c97a3_7d044613","updated":"2018-08-02 09:43:33.000000000","message":"My first thought was to move the whole model_query into OVO, to remove the dependency of db queries in it. But as my previous comment goes, I do not understand what you mean by moving resource_model_map to OVO..","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"3a9727084be7c01ca32a9f7c785ee04fc9d97c86","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    def _get_resource(self, context, resource, resource_id):"},{"line_number":50,"context_line":"        model \u003d resource_model_map[resource]"},{"line_number":51,"context_line":"        try:"},{"line_number":52,"context_line":"            return model_query.get_by_id(context, model, resource_id)"},{"line_number":53,"context_line":"        except exc.NoResultFound:"},{"line_number":54,"context_line":"            raise tagging.TagResourceNotFound(resource\u003dresource,"},{"line_number":55,"context_line":"                                              resource_id\u003dresource_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_76bec5ff","line":52,"in_reply_to":"5f7c97a3_7e2d0e43","updated":"2018-08-14 14:19:50.000000000","message":"Yeah forget moving resource_model_map to OVO, that was a bad thought.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"546c27ae29db8b5a0174755718c726f60848117c","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    def _get_resource(self, context, resource, resource_id):"},{"line_number":50,"context_line":"        model \u003d resource_model_map[resource]"},{"line_number":51,"context_line":"        try:"},{"line_number":52,"context_line":"            return model_query.get_by_id(context, model, resource_id)"},{"line_number":53,"context_line":"        except exc.NoResultFound:"},{"line_number":54,"context_line":"            raise tagging.TagResourceNotFound(resource\u003dresource,"},{"line_number":55,"context_line":"                                              resource_id\u003dresource_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_7d044613","line":52,"in_reply_to":"5f7c97a3_ba8e6423","updated":"2018-08-01 16:19:54.000000000","message":"Actually no, this whole method could be moved into the resource_model_map, which removed the dependency on model_query.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"f8cd16b8e3501bfc8d4cb62681f4ad8f0d9d6963","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            raise tagging.TagNotFound(tag\u003dtag)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_92276965","line":70,"updated":"2018-08-20 20:48:21.000000000","message":"Add this @db_api.retry_if_session_inactive decorator to tag_obj.Tag.delete_objects and tag_obj.Tag.create, and remove it here.\n\nThat will necessitate creating those methods in the Tag object; in each case all that they will have is the decorator, and then inside the function a call to super so that the method inherited from NeutronDbObject is exercised.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"546c27ae29db8b5a0174755718c726f60848117c","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            raise tagging.TagNotFound(tag\u003dtag)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_3a80149c","line":70,"range":{"start_line":70,"start_character":0,"end_line":70,"end_character":39},"updated":"2018-08-01 16:19:54.000000000","message":"If we wanted to move this retry decorator onto a method in the tag object, could we do that?","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"9c56e49b51fac77471f2568b92b88b95af343cf5","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            raise tagging.TagNotFound(tag\u003dtag)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_b48203ff","line":70,"range":{"start_line":70,"start_character":0,"end_line":70,"end_character":39},"in_reply_to":"3f79a3b5_1643d114","updated":"2018-08-15 09:40:37.000000000","message":"Nate, Lujin: could you please come some conclusion about what exactly I need to do to make this patch more mature?","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"c098ee673696eaec429baeefb7d0851abb67aafe","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            raise tagging.TagNotFound(tag\u003dtag)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_4c056a10","line":70,"in_reply_to":"3f79a3b5_92276965","updated":"2018-08-23 13:29:52.000000000","message":"I agreed with the idea to move all the session related codes to OVO. However, while doing the research, i found that this decorator is wildly used in Neutron code base. See [1]. \n\nI wonder whether we could move retry_if_session_inactive() to objects/db/api.py. \n\n[1] http://paste.openstack.org/show/728658/","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"0c447933c00d1b617f99742ac93984d75eeebc1d","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            raise tagging.TagNotFound(tag\u003dtag)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_fedd9e3e","line":70,"range":{"start_line":70,"start_character":0,"end_line":70,"end_character":39},"in_reply_to":"5f7c97a3_3a80149c","updated":"2018-08-02 09:43:33.000000000","message":"TBH, I am not sure. But why do you want to do that?","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"3a9727084be7c01ca32a9f7c785ee04fc9d97c86","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            raise tagging.TagNotFound(tag\u003dtag)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_1643d114","line":70,"range":{"start_line":70,"start_character":0,"end_line":70,"end_character":39},"in_reply_to":"5f7c97a3_fedd9e3e","updated":"2018-08-14 14:19:50.000000000","message":"To move dependencies on db_api into the OVO as much as possible.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"546c27ae29db8b5a0174755718c726f60848117c","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"},{"line_number":74,"context_line":"            res \u003d self._get_resource(context, resource, resource_id)"},{"line_number":75,"context_line":"            new_tags \u003d set(body[\u0027tags\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_fab85cc1","line":72,"range":{"start_line":72,"start_character":8,"end_line":72,"end_character":58},"updated":"2018-08-01 16:19:54.000000000","message":"Generally speaking when OVO objects are used correctly this should not be needed.","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"b4f7ca19d40767b09a1f9fc9ebf518c860c3874e","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    @log_helpers.log_method_call"},{"line_number":70,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":71,"context_line":"    def update_tags(self, context, resource, resource_id, body):"},{"line_number":72,"context_line":"        with db_api.context_manager.writer.using(context):"},{"line_number":73,"context_line":"            # We get and do all operations with objects in one session"},{"line_number":74,"context_line":"            res \u003d self._get_resource(context, resource, resource_id)"},{"line_number":75,"context_line":"            new_tags \u003d set(body[\u0027tags\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_3ea0f6f1","line":72,"range":{"start_line":72,"start_character":8,"end_line":72,"end_character":58},"in_reply_to":"5f7c97a3_fab85cc1","updated":"2018-08-02 09:37:13.000000000","message":"It\u0027s true, I can remove it","commit_id":"670f10cfcbcfee0c0c8dece4883e6d811f93663f"}]}
