)]}'
{"networking_bgpvpn/neutron/db/bgpvpn_db.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d18f62adf57f3803094e647433c1f4439d050bce","unresolved":true,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        return db_utils.resource_fields(res, fields)"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"    @db_api.CONTEXT_WRITER"},{"line_number":303,"context_line":"    def create_bgpvpn(self, context, bgpvpn):"},{"line_number":304,"context_line":"        rt \u003d utils.rtrd_list2str(bgpvpn[\u0027route_targets\u0027])"},{"line_number":305,"context_line":"        i_rt \u003d utils.rtrd_list2str(bgpvpn[\u0027import_targets\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"945c0300_c8753f44","side":"PARENT","line":302,"range":{"start_line":302,"start_character":4,"end_line":302,"end_character":26},"updated":"2021-07-07 12:16:27.000000000","message":"This is more expensive to create two different contexts in the same method rather than using the same CONTEXT_WRITER for all the method execution.\n\nI would remove the inner context and use this one.","commit_id":"5f7a129dbb30b5bd9af27653e66749a9d8888c5a"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6668c299f057e942679d75794fdf39f80b9a748a","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        return db_utils.resource_fields(res, fields)"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"    @db_api.CONTEXT_WRITER"},{"line_number":303,"context_line":"    def create_bgpvpn(self, context, bgpvpn):"},{"line_number":304,"context_line":"        rt \u003d utils.rtrd_list2str(bgpvpn[\u0027route_targets\u0027])"},{"line_number":305,"context_line":"        i_rt \u003d utils.rtrd_list2str(bgpvpn[\u0027import_targets\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1c1e6390_8a3d4f8c","side":"PARENT","line":302,"range":{"start_line":302,"start_character":4,"end_line":302,"end_character":26},"in_reply_to":"945c0300_c8753f44","updated":"2021-07-08 12:50:17.000000000","message":"Done","commit_id":"5f7a129dbb30b5bd9af27653e66749a9d8888c5a"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"8cab2482c6e194a78df1b16910df47bab5338b56","unresolved":true,"context_lines":[{"line_number":320,"context_line":"            )"},{"line_number":321,"context_line":"            context.session.add(bgpvpn_db)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        with db_api.CONTEXT_READER.using(context):"},{"line_number":324,"context_line":"            context.session.add(bgpvpn_db)"},{"line_number":325,"context_line":"            return self._make_bgpvpn_dict(bgpvpn_db)"},{"line_number":326,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f942fbb_f0fc216b","line":323,"range":{"start_line":323,"start_character":0,"end_line":323,"end_character":50},"updated":"2021-07-07 08:00:41.000000000","message":"yeah, make_bgpvpn_dict is decorated as CONTEXT_READER anyway","commit_id":"c9b9a191408fa6f9b2c36631e17e2a65b4136084"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d18f62adf57f3803094e647433c1f4439d050bce","unresolved":true,"context_lines":[{"line_number":321,"context_line":"            context.session.add(bgpvpn_db)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        with db_api.CONTEXT_READER.using(context):"},{"line_number":324,"context_line":"            context.session.add(bgpvpn_db)"},{"line_number":325,"context_line":"            return self._make_bgpvpn_dict(bgpvpn_db)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    @db_api.CONTEXT_READER"}],"source_content_type":"text/x-python","patch_set":1,"id":"076eafce_8b479744","line":324,"range":{"start_line":324,"start_character":0,"end_line":324,"end_character":1},"updated":"2021-07-07 12:16:27.000000000","message":"With the proposal written in base PS, you can skip this step and continue in the same txn, regardless of the CONTEXT_READER decorator of \"_make_bgpvpn_dict\".","commit_id":"c9b9a191408fa6f9b2c36631e17e2a65b4136084"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6668c299f057e942679d75794fdf39f80b9a748a","unresolved":false,"context_lines":[{"line_number":321,"context_line":"            context.session.add(bgpvpn_db)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        with db_api.CONTEXT_READER.using(context):"},{"line_number":324,"context_line":"            context.session.add(bgpvpn_db)"},{"line_number":325,"context_line":"            return self._make_bgpvpn_dict(bgpvpn_db)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    @db_api.CONTEXT_READER"}],"source_content_type":"text/x-python","patch_set":1,"id":"f48610a3_70f192b8","line":324,"range":{"start_line":324,"start_character":0,"end_line":324,"end_character":1},"in_reply_to":"076eafce_8b479744","updated":"2021-07-08 12:50:17.000000000","message":"Done","commit_id":"c9b9a191408fa6f9b2c36631e17e2a65b4136084"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"8cab2482c6e194a78df1b16910df47bab5338b56","unresolved":true,"context_lines":[{"line_number":548,"context_line":"            raise bgpvpn_rc_ext.BGPVPNPortAssocAlreadyExists("},{"line_number":549,"context_line":"                bgpvpn_id\u003dbgpvpn_id, port_id\u003dport_association[\u0027port_id\u0027])"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"        for route in port_association[\u0027routes\u0027]:"},{"line_number":552,"context_line":"            _add_port_assoc_route_db_from_dict("},{"line_number":553,"context_line":"                context, route, port_assoc_db.id)"},{"line_number":554,"context_line":"        return self._make_port_assoc_dict(port_assoc_db)"}],"source_content_type":"text/x-python","patch_set":1,"id":"e84badcb_1cd9a9bf","line":551,"updated":"2021-07-07 08:00:41.000000000","message":"I am not an expert on db things, but if above with....: is necessary for CONTEXT_READER  why it is not necessary for CONTEXT_WRITER?","commit_id":"c9b9a191408fa6f9b2c36631e17e2a65b4136084"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6668c299f057e942679d75794fdf39f80b9a748a","unresolved":true,"context_lines":[{"line_number":548,"context_line":"            raise bgpvpn_rc_ext.BGPVPNPortAssocAlreadyExists("},{"line_number":549,"context_line":"                bgpvpn_id\u003dbgpvpn_id, port_id\u003dport_association[\u0027port_id\u0027])"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":"        for route in port_association[\u0027routes\u0027]:"},{"line_number":552,"context_line":"            _add_port_assoc_route_db_from_dict("},{"line_number":553,"context_line":"                context, route, port_assoc_db.id)"},{"line_number":554,"context_line":"        return self._make_port_assoc_dict(port_assoc_db)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ddf94202_427dfc78","line":551,"in_reply_to":"e84badcb_1cd9a9bf","updated":"2021-07-08 12:50:17.000000000","message":"This function _add_port_assoc_route_db_from_dict is decorated with CONTEXT_WRITER already","commit_id":"c9b9a191408fa6f9b2c36631e17e2a65b4136084"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c19eb3b59822cd4b19e3a39556525abade0b2aba","unresolved":true,"context_lines":[{"line_number":318,"context_line":"            vni\u003dbgpvpn.get(bgpvpn_vni_def.VNI),"},{"line_number":319,"context_line":"            local_pref\u003dbgpvpn.get(bgpvpn_rc_def.LOCAL_PREF_KEY),"},{"line_number":320,"context_line":"        )"},{"line_number":321,"context_line":"        context.session.add(bgpvpn_db)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        context.session.add(bgpvpn_db)"},{"line_number":324,"context_line":"        return self._make_bgpvpn_dict(bgpvpn_db)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    @db_api.CONTEXT_READER"}],"source_content_type":"text/x-python","patch_set":2,"id":"c671edfb_dddd9a74","line":323,"range":{"start_line":321,"start_character":0,"end_line":323,"end_character":38},"updated":"2021-07-08 13:33:18.000000000","message":"duplicated","commit_id":"b27104c5b92422689552d6354f375f0a9dfe4ae1"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2f56eecae73d646e72fc29371116d1132e423af3","unresolved":true,"context_lines":[{"line_number":457,"context_line":"    def create_router_assoc(self, context, bgpvpn_id, router_association):"},{"line_number":458,"context_line":"        router_id \u003d router_association[\u0027router_id\u0027]"},{"line_number":459,"context_line":"        try:"},{"line_number":460,"context_line":"            with db_api.CONTEXT_WRITER.using(context):"},{"line_number":461,"context_line":"                router_assoc_db \u003d BGPVPNRouterAssociation("},{"line_number":462,"context_line":"                    tenant_id\u003drouter_association[\u0027tenant_id\u0027],"},{"line_number":463,"context_line":"                    bgpvpn_id\u003dbgpvpn_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"d465119b_a0257f62","side":"PARENT","line":460,"range":{"start_line":460,"start_character":12,"end_line":460,"end_character":53},"updated":"2021-07-20 15:39:38.000000000","message":"why here removing \"with\" while removing decorator for create_net_assoc? What\u0027s the difference?","commit_id":"5f7a129dbb30b5bd9af27653e66749a9d8888c5a"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"7fe1699fb14df061f8d4db6b91f3d4c653c58098","unresolved":true,"context_lines":[{"line_number":458,"context_line":"                bgpvpn_id\u003dbgpvpn_id,"},{"line_number":459,"context_line":"                router_id\u003drouter_id)"},{"line_number":460,"context_line":"            context.session.add(router_assoc_db)"},{"line_number":461,"context_line":"            context.session.flush()"},{"line_number":462,"context_line":"            return self._make_router_assoc_dict(router_assoc_db)"},{"line_number":463,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":464,"context_line":"            LOG.warning(\"router %(router_id)s is already associated to \""}],"source_content_type":"text/x-python","patch_set":3,"id":"4e6113a6_02793df0","line":461,"range":{"start_line":461,"start_character":12,"end_line":461,"end_character":35},"updated":"2021-07-21 07:21:51.000000000","message":"will we need this flush if leave \"with db_api.CONTEXT_WRITER.using(context)\" and just remove redundant decorator at #452?","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"17dd365f028949a44152b8f5aebe37948a376770","unresolved":true,"context_lines":[{"line_number":458,"context_line":"                bgpvpn_id\u003dbgpvpn_id,"},{"line_number":459,"context_line":"                router_id\u003drouter_id)"},{"line_number":460,"context_line":"            context.session.add(router_assoc_db)"},{"line_number":461,"context_line":"            context.session.flush()"},{"line_number":462,"context_line":"            return self._make_router_assoc_dict(router_assoc_db)"},{"line_number":463,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":464,"context_line":"            LOG.warning(\"router %(router_id)s is already associated to \""}],"source_content_type":"text/x-python","patch_set":3,"id":"6054daca_8fd8d2d6","line":461,"range":{"start_line":461,"start_character":12,"end_line":461,"end_character":35},"in_reply_to":"4e6113a6_02793df0","updated":"2021-07-21 07:36:09.000000000","message":"This could be necessary in _make_router_assoc_dict, refreshin expired attributes. But in this case the object has been created and the attributes needed are DB object columns, not references to other objects. This flush could be avoided.","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"dd57880603042b63e682c4b7e7ca6632a09688d3","unresolved":true,"context_lines":[{"line_number":458,"context_line":"                bgpvpn_id\u003dbgpvpn_id,"},{"line_number":459,"context_line":"                router_id\u003drouter_id)"},{"line_number":460,"context_line":"            context.session.add(router_assoc_db)"},{"line_number":461,"context_line":"            context.session.flush()"},{"line_number":462,"context_line":"            return self._make_router_assoc_dict(router_assoc_db)"},{"line_number":463,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":464,"context_line":"            LOG.warning(\"router %(router_id)s is already associated to \""}],"source_content_type":"text/x-python","patch_set":3,"id":"e6988a8e_18aa9aa9","line":461,"range":{"start_line":461,"start_character":12,"end_line":461,"end_character":35},"in_reply_to":"6054daca_8fd8d2d6","updated":"2021-08-06 10:29:15.000000000","message":"But then I would need something like\n\n     def create_router_assoc(self, context, bgpvpn_id, router_association):      \n            router_id \u003d router_association[\u0027router_id\u0027]                             \n            try:                                                                    \n                with db_api.CONTEXT_WRITER.using(context):                          \n                    router_assoc_db \u003d BGPVPNRouterAssociation(                      \n                        tenant_id\u003drouter_association[\u0027tenant_id\u0027],                  \n                        bgpvpn_id\u003dbgpvpn_id,                                        \n                        router_id\u003drouter_id)                                        \n                    context.session.add(router_assoc_db)                            \n                with db_api.CONTEXT_READER.using(context):                          \n                    context.session.add(router_assoc_db)                                                                                                                                                                                       \n                    return self._make_router_assoc_dict(router_assoc_db)  \n\nto make UT passing at least.","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"12dafa5a6722cb156e279aea29e15935287762b0","unresolved":true,"context_lines":[{"line_number":458,"context_line":"                bgpvpn_id\u003dbgpvpn_id,"},{"line_number":459,"context_line":"                router_id\u003drouter_id)"},{"line_number":460,"context_line":"            context.session.add(router_assoc_db)"},{"line_number":461,"context_line":"            context.session.flush()"},{"line_number":462,"context_line":"            return self._make_router_assoc_dict(router_assoc_db)"},{"line_number":463,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":464,"context_line":"            LOG.warning(\"router %(router_id)s is already associated to \""}],"source_content_type":"text/x-python","patch_set":3,"id":"1bd69bfc_cbcb3d4b","line":461,"range":{"start_line":461,"start_character":12,"end_line":461,"end_character":35},"in_reply_to":"e6988a8e_18aa9aa9","updated":"2021-08-09 09:17:22.000000000","message":"Yes, you need the BGPVPNRouterAssociation object committed before calling _make_router_assoc_dict","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"6c078ffd9226c92ef0a8844eec5803bc968ebb73","unresolved":true,"context_lines":[{"line_number":547,"context_line":"        for route in port_association[\u0027routes\u0027]:"},{"line_number":548,"context_line":"            _add_port_assoc_route_db_from_dict("},{"line_number":549,"context_line":"                context, route, port_assoc_db.id)"},{"line_number":550,"context_line":"        return self._make_port_assoc_dict(port_assoc_db)"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"    @db_api.CONTEXT_READER"},{"line_number":553,"context_line":"    def get_port_assoc(self, context, assoc_id, bgpvpn_id, fields\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1c6f312b_f0e4ee75","line":550,"updated":"2021-07-08 14:55:43.000000000","message":"Be careful! You are removing the reader context from \"_make_port_assoc_dict\" and at the same time from this method, \"create_port_assoc\". That\u0027s not correct.","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"e7e130e9ad4c0bd38f288b66b9b7c53cd6bda88f","unresolved":true,"context_lines":[{"line_number":547,"context_line":"        for route in port_association[\u0027routes\u0027]:"},{"line_number":548,"context_line":"            _add_port_assoc_route_db_from_dict("},{"line_number":549,"context_line":"                context, route, port_assoc_db.id)"},{"line_number":550,"context_line":"        return self._make_port_assoc_dict(port_assoc_db)"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"    @db_api.CONTEXT_READER"},{"line_number":553,"context_line":"    def get_port_assoc(self, context, assoc_id, bgpvpn_id, fields\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"d10c5f85_b12f1138","line":550,"in_reply_to":"17900e3d_e604d046","updated":"2021-07-20 12:25:19.000000000","message":"Exactly as Lajos said. I don\u0027t see any issue here TBH","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"7e00b70cf90bd3d7a7b51de2b1a496a23c31fab5","unresolved":true,"context_lines":[{"line_number":547,"context_line":"        for route in port_association[\u0027routes\u0027]:"},{"line_number":548,"context_line":"            _add_port_assoc_route_db_from_dict("},{"line_number":549,"context_line":"                context, route, port_assoc_db.id)"},{"line_number":550,"context_line":"        return self._make_port_assoc_dict(port_assoc_db)"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"    @db_api.CONTEXT_READER"},{"line_number":553,"context_line":"    def get_port_assoc(self, context, assoc_id, bgpvpn_id, fields\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"17900e3d_e604d046","line":550,"in_reply_to":"1c6f312b_f0e4ee75","updated":"2021-07-09 08:50:51.000000000","message":"CONTEXT_READER decorator is still on _make_port_assoc_dict (@l505)","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"57a23a6e14428d9eea226507ecc0ec025417ea40","unresolved":true,"context_lines":[{"line_number":547,"context_line":"        for route in port_association[\u0027routes\u0027]:"},{"line_number":548,"context_line":"            _add_port_assoc_route_db_from_dict("},{"line_number":549,"context_line":"                context, route, port_assoc_db.id)"},{"line_number":550,"context_line":"        return self._make_port_assoc_dict(port_assoc_db)"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"    @db_api.CONTEXT_READER"},{"line_number":553,"context_line":"    def get_port_assoc(self, context, assoc_id, bgpvpn_id, fields\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"0368c452_cebcdbc6","line":550,"in_reply_to":"d10c5f85_b12f1138","updated":"2021-07-20 12:37:47.000000000","message":"Now I don\u0027t remember what version I reviewed (probably one I modified to test). In any case, you are right, this method has a reader decorator.","commit_id":"fcc0f2ccb396541f54752bf509ab835fb9ef0cd6"}]}
