)]}'
{"octavia/api/v2/controllers/flavor_profiles.py":[{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"b2ad64245f31b369f9652d7fefd74b81812ee4cf","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                context.session, flavor_profile_id\u003dflavor_profile_id) \u003e 0:"},{"line_number":201,"context_line":"            raise exceptions.ObjectInUse(object\u003d\u0027Flavor profile\u0027,"},{"line_number":202,"context_line":"                                         id\u003dflavor_profile_id)"},{"line_number":203,"context_line":"        if flavor_profile_id \u003d\u003d constants.NIL_UUID:"},{"line_number":204,"context_line":"            raise exceptions.NotFound(resource\u003d\u0027Flavor profile\u0027,"},{"line_number":205,"context_line":"                                      id\u003dconstants.NIL_UUID)"},{"line_number":206,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_3ec4f65f","line":203,"updated":"2019-11-16 08:48:51.000000000","message":"This is out of order -- needs to happen right after the auth validate.","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"78e2f66028f4d50533b52368cf27ad4a1a86cf5f","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                context.session, flavor_profile_id\u003dflavor_profile_id) \u003e 0:"},{"line_number":201,"context_line":"            raise exceptions.ObjectInUse(object\u003d\u0027Flavor profile\u0027,"},{"line_number":202,"context_line":"                                         id\u003dflavor_profile_id)"},{"line_number":203,"context_line":"        if flavor_profile_id \u003d\u003d constants.NIL_UUID:"},{"line_number":204,"context_line":"            raise exceptions.NotFound(resource\u003d\u0027Flavor profile\u0027,"},{"line_number":205,"context_line":"                                      id\u003dconstants.NIL_UUID)"},{"line_number":206,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_6feb9aa3","line":203,"in_reply_to":"3fa7e38b_3ec4f65f","updated":"2019-11-17 20:42:59.000000000","message":"Done","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"}],"octavia/api/v2/controllers/flavors.py":[{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"e4ead5f48bca71e06d4f33570f179fc01586cf7e","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            raise exceptions.NotFound(resource\u003d\u0027Flavor\u0027, id\u003dconstants.NIL_UUID)"},{"line_number":143,"context_line":"        serial_session \u003d db_api.get_session(autocommit\u003dFalse)"},{"line_number":144,"context_line":"        serial_session.connection("},{"line_number":145,"context_line":"            execution_options\u003d{\u0027isolation_level\u0027: \u0027SERIALIZABLE\u0027})"},{"line_number":146,"context_line":"        try:"},{"line_number":147,"context_line":"            self.repositories.flavor.delete(serial_session, id\u003dflavor_id)"},{"line_number":148,"context_line":"            serial_session.commit()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_159285fd","line":145,"updated":"2019-11-11 15:19:07.000000000","message":"this is a new one...","commit_id":"47634c1dfa5bfc7ac41f7446d5e864d35b372ec5"}],"octavia/db/migration/alembic_migrations/versions/e37941b010db_add_lb_flavor_constraint.py":[{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"e4ead5f48bca71e06d4f33570f179fc01586cf7e","unresolved":false,"context_lines":[{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_1549258d","line":75,"updated":"2019-11-11 15:19:07.000000000","message":"Won\u0027t this be the case for anything that legitimately doesn\u0027t use a flavor? Using a flavor isn\u0027t mandatory, there may be lots of existing LBs that are not using one, and those should not be changed...","commit_id":"47634c1dfa5bfc7ac41f7446d5e864d35b372ec5"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"9645580aae294781965e203ba6e0e1d9208f3921","unresolved":false,"context_lines":[{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_4c6ab7ed","line":75,"in_reply_to":"3fa7e38b_1549258d","updated":"2019-11-11 22:01:24.000000000","message":"Admittedly this is a tricky statement, but the key to notice here is the \"WHERE flavor.id IS NULL\". This is saying only where the \"flavor\" table had no matching ID. You read it as load_balancer.flavor_id IS NULL\".\nBasically I\u0027m looking LBs with flavor_id that no longer exists in the flavor table.","commit_id":"47634c1dfa5bfc7ac41f7446d5e864d35b372ec5"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"1e99c570a92e876266e4128559675da4d48431bb","unresolved":false,"context_lines":[{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_4c3877ed","line":75,"in_reply_to":"3fa7e38b_4c6ab7ed","updated":"2019-11-11 22:13:31.000000000","message":"Ah, yes, there is a bug here. fixing.","commit_id":"47634c1dfa5bfc7ac41f7446d5e864d35b372ec5"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"76a135df863a9a363e0c635cac852aa031251f16","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # Make sure any existing load balancers with invalid flavor_id"},{"line_number":69,"context_line":"    # map to a valid flavor."},{"line_number":70,"context_line":"    # Note: constant is not used here to not trigger security tool errors."},{"line_number":71,"context_line":"    op.execute(\"UPDATE load_balancer LEFT JOIN flavor ON \""},{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL and load_balancer.flavor_id IS NOT NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_97cb961b","line":75,"range":{"start_line":71,"start_character":15,"end_line":75,"end_character":74},"updated":"2019-11-15 15:36:58.000000000","message":"It is better to use sqlalchemy query options, rather then raw sql. Have you tried using https://docs.sqlalchemy.org/en/13/orm/query.html#sqlalchemy.orm.query.Query.outerjoin for such update?","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"9a6539c1b45d68d3f9087e4c0d7f050311991656","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # Make sure any existing load balancers with invalid flavor_id"},{"line_number":69,"context_line":"    # map to a valid flavor."},{"line_number":70,"context_line":"    # Note: constant is not used here to not trigger security tool errors."},{"line_number":71,"context_line":"    op.execute(\"UPDATE load_balancer LEFT JOIN flavor ON \""},{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL and load_balancer.flavor_id IS NOT NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_6f6e3a2d","line":75,"range":{"start_line":71,"start_character":15,"end_line":75,"end_character":74},"in_reply_to":"3fa7e38b_4feedeb5","updated":"2019-11-17 23:41:00.000000000","message":"Could you post link for issues with default?\nYou already introduce flavor and flavor_profile table here, so it already has some complexity :)\n\nI give my comment based on my experience working with/clearing neutron migrations in the past days.\nAs postgres support dropped - this is not urgent(I didn\u0027t even score with -1 this), but generally we should use sqlalchemy if it supports required operations.","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"7ad9f8981e343bdaa9fe21ab12d0eb5476930c63","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # Make sure any existing load balancers with invalid flavor_id"},{"line_number":69,"context_line":"    # map to a valid flavor."},{"line_number":70,"context_line":"    # Note: constant is not used here to not trigger security tool errors."},{"line_number":71,"context_line":"    op.execute(\"UPDATE load_balancer LEFT JOIN flavor ON \""},{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL and load_balancer.flavor_id IS NOT NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_fe82de51","line":75,"range":{"start_line":71,"start_character":15,"end_line":75,"end_character":74},"in_reply_to":"3fa7e38b_97cb961b","updated":"2019-11-16 06:43:33.000000000","message":"I generally agree, though I don\u0027t think we need to block this on that? It\u0027s a one-time query during an upgrade, so it should be fine.","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"78e2f66028f4d50533b52368cf27ad4a1a86cf5f","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # Make sure any existing load balancers with invalid flavor_id"},{"line_number":69,"context_line":"    # map to a valid flavor."},{"line_number":70,"context_line":"    # Note: constant is not used here to not trigger security tool errors."},{"line_number":71,"context_line":"    op.execute(\"UPDATE load_balancer LEFT JOIN flavor ON \""},{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL and load_balancer.flavor_id IS NOT NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_4feedeb5","line":75,"range":{"start_line":71,"start_character":15,"end_line":75,"end_character":74},"in_reply_to":"3fa7e38b_ef7d4a6d","updated":"2019-11-17 20:42:59.000000000","message":"I have a couple of comments about this.\n1. Remember this runs outside of the Octavia processes, meaning none of the SQLAlchemy data models are available and the ORM layer is not available. It would have to be created in this script to use the ORM query syntax. This would increase the required code and the complexity.\n2. OpenStack has stopped testing databases other than mysql.\n3. This is standard SQL-92 (section 7.5 covers the join syntax), so if the database doesn\u0027t support this we are going to have bigger issues using it.\n4. SQLAlchemy is error and bug prone, (see issues we have had with \"default\" values).\n\nThat said, if you feel I should change this into SA syntax, please comment here.","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"},{"author":{"_account_id":6469,"name":"Carlos Gonçalves","display_name":"Carlos Goncalves","email":"cgoncalves@redhat.com","username":"cgoncalves"},"change_message_id":"4c5c65ea91652a655fef358a8415b94826703603","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    # Make sure any existing load balancers with invalid flavor_id"},{"line_number":69,"context_line":"    # map to a valid flavor."},{"line_number":70,"context_line":"    # Note: constant is not used here to not trigger security tool errors."},{"line_number":71,"context_line":"    op.execute(\"UPDATE load_balancer LEFT JOIN flavor ON \""},{"line_number":72,"context_line":"               \"load_balancer.flavor_id \u003d flavor.id SET \""},{"line_number":73,"context_line":"               \"load_balancer.flavor_id \u003d \""},{"line_number":74,"context_line":"               \"\u002700000000-0000-0000-0000-000000000000\u0027 WHERE \""},{"line_number":75,"context_line":"               \"flavor.id IS NULL and load_balancer.flavor_id IS NOT NULL\")"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    op.create_foreign_key(\u0027fk_loadbalancer_flavor_id\u0027, \u0027load_balancer\u0027,"},{"line_number":78,"context_line":"                          \u0027flavor\u0027, [\u0027flavor_id\u0027], [\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_ef7d4a6d","line":75,"range":{"start_line":71,"start_character":15,"end_line":75,"end_character":74},"in_reply_to":"3fa7e38b_fe82de51","updated":"2019-11-17 14:36:38.000000000","message":"I agree with Ann. It could happen this SQL query is not compatible with other DBMS like PostgreSQL (unlikely but still). It would come at the cost of operators failing run this migration that could not be fixed with a follow-up migration.","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"}],"octavia/db/repositories.py":[{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"b2ad64245f31b369f9652d7fefd74b81812ee4cf","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"        :raises: sqlalchemy.orm.exc.NoResultFound"},{"line_number":1874,"context_line":"        \"\"\""},{"line_number":1875,"context_line":"        (serial_session.query(models.LoadBalancer)."},{"line_number":1876,"context_line":"         filter(models.LoadBalancer.flavor_id \u003d\u003d filters[\u0027id\u0027])."},{"line_number":1877,"context_line":"         update({models.LoadBalancer.flavor_id: consts.NIL_UUID},"},{"line_number":1878,"context_line":"                synchronize_session\u003dFalse))"},{"line_number":1879,"context_line":"        flavor \u003d (serial_session.query(self.model_class)."}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_9ecbaa70","line":1876,"updated":"2019-11-16 08:48:51.000000000","message":"I think you meant to check if the LB is deleted too... Need to add another filter line:\n\nfilter(models.LoadBalancer.provisioning_status \u003d\u003d consts.DELETED).","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"78e2f66028f4d50533b52368cf27ad4a1a86cf5f","unresolved":false,"context_lines":[{"line_number":1873,"context_line":"        :raises: sqlalchemy.orm.exc.NoResultFound"},{"line_number":1874,"context_line":"        \"\"\""},{"line_number":1875,"context_line":"        (serial_session.query(models.LoadBalancer)."},{"line_number":1876,"context_line":"         filter(models.LoadBalancer.flavor_id \u003d\u003d filters[\u0027id\u0027])."},{"line_number":1877,"context_line":"         update({models.LoadBalancer.flavor_id: consts.NIL_UUID},"},{"line_number":1878,"context_line":"                synchronize_session\u003dFalse))"},{"line_number":1879,"context_line":"        flavor \u003d (serial_session.query(self.model_class)."}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_0f2a26e6","line":1876,"in_reply_to":"3fa7e38b_9ecbaa70","updated":"2019-11-17 20:42:59.000000000","message":"Done","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"}],"octavia/tests/functional/db/base.py":[{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"b2ad64245f31b369f9652d7fefd74b81812ee4cf","unresolved":false,"context_lines":[{"line_number":106,"context_line":"            id\u003dconstants.NIL_UUID, flavor_profile_id\u003dconstants.NIL_UUID,"},{"line_number":107,"context_line":"            name\u003d\u0027DELETED-PLACEHOLDER\u0027, enabled\u003dFalse,"},{"line_number":108,"context_line":"            description\u003d\u0027Placeholder for DELETED LBs with DELETED flavors\u0027)"},{"line_number":109,"context_line":"        session.add(deleted_flavor)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _seed_lookup_table(self, session, name_list, model_cls):"},{"line_number":112,"context_line":"        for name in name_list:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_deb5a2ee","line":109,"updated":"2019-11-16 08:48:51.000000000","message":"Need a flush here! Otherwise your tests won\u0027t be accurate. Trust me. :D","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"78e2f66028f4d50533b52368cf27ad4a1a86cf5f","unresolved":false,"context_lines":[{"line_number":106,"context_line":"            id\u003dconstants.NIL_UUID, flavor_profile_id\u003dconstants.NIL_UUID,"},{"line_number":107,"context_line":"            name\u003d\u0027DELETED-PLACEHOLDER\u0027, enabled\u003dFalse,"},{"line_number":108,"context_line":"            description\u003d\u0027Placeholder for DELETED LBs with DELETED flavors\u0027)"},{"line_number":109,"context_line":"        session.add(deleted_flavor)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _seed_lookup_table(self, session, name_list, model_cls):"},{"line_number":112,"context_line":"        for name in name_list:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_2f2fe2f6","line":109,"in_reply_to":"3fa7e38b_deb5a2ee","updated":"2019-11-17 20:42:59.000000000","message":"Done","commit_id":"057354ab7d672179f2c21662b78c93a98a249fc3"}]}
