)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"5635663d64fab506dc944e83939334e2fa62e084","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Will Foster \u003cwfoster@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-11-24 22:07:52 -0500"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"LP #1395959: Skip assignment table inserts during db_sync if duplicate entries present."},{"line_number":8,"context_line":"Change-Id: I394a0391ee074c3ee79bdb06391fc4d5fb9067a9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a890539_06dfe23a","line":7,"updated":"2014-11-25 14:00:37.000000000","message":"I think the bug number should be removed from the subject and should be placed in description, in format \"Closes-Bug: #123456\" or \"Partial-Bug: #123456\".","commit_id":"51a1744b6486f34dd5e196f28e22dfdce4059c61"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"9da353bd87a49e1650b86c745c9dad4467dea176","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Will Foster \u003cwfoster@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-11-25 18:13:29 -0500"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"skip assignment table migrate if duplicate entry exists."},{"line_number":8,"context_line":"Closes-bug: #1395959"},{"line_number":9,"context_line":"Change-Id: I394a0391ee074c3ee79bdb06391fc4d5fb9067a9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5a890539_a20d03ea","line":7,"updated":"2014-11-26 00:15:38.000000000","message":"add a new line here","commit_id":"ad744f58ee6c835352f547e0e993126c1323ee39"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"ff4a22043ed253fb6cb46d45b2bb51dbbea03ffd","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Will Foster \u003cwfoster@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-11-26 00:04:34 -0500"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"skip assignment table migrate if duplicate entry exists."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Closes-bug: #1395959"},{"line_number":10,"context_line":"Change-Id: I394a0391ee074c3ee79bdb06391fc4d5fb9067a9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5a890539_c6d93184","line":7,"updated":"2014-11-26 13:02:47.000000000","message":"This is also kind of missleading - as we just skip individual rows - not the migration of the whole table.","commit_id":"77712b344c8de9eb4cf0e349e3751d2607fd64bb"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"80fbe4a570d2235656635153416e9b81f204749f","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2014-11-26 17:18:50 -0500"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"skip assignment rows migrate if duplicate entry exists."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Closes-bug: #1395959"},{"line_number":10,"context_line":"Change-Id: I394a0391ee074c3ee79bdb06391fc4d5fb9067a9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"5a890539_7daee3e8","line":8,"updated":"2014-12-01 19:12:20.000000000","message":"describe a bit more of how you are changing the code to fix the problem.","commit_id":"4a0cab97df4dac6be0754b8aa96ecd7725e2fdb7"}],"keystone/common/sql/migrate_repo/versions/039_grant_to_assignment.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"4f7cdb68bf7ddaeaaeb90d8183bd0fc2ec28cfc4","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        # Delete all the rows"},{"line_number":88,"context_line":"        session.execute(upgrade_table.delete())"},{"line_number":89,"context_line":"        session.commit()"},{"line_number":90,"context_line":"    except:"},{"line_number":91,"context_line":"         LOG.warning(\u0027Skipping assignment table inserts for older schema,\u0027"},{"line_number":92,"context_line":"                     \u0027possible duplicate entries present\u0027)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_2a574bcb","line":90,"updated":"2014-11-25 09:45:45.000000000","message":"This is one of the reasons why pep8 fails - you should at least use except Exception.\n\nIdeally you want to use except sql.exc.IntegrityError but even that is not completely correct if you want to just make sure we are catching the duplicate error reported in the bug (for the complexity of figuring out the right exception per backend see https://github.com/openstack/oslo.db/blob/master/oslo/db/sqlalchemy/exc_filters.py)\n\nAlso and more importantly - the try should probably only catch the the single insert and skip it - not the whole loop?","commit_id":"51a1744b6486f34dd5e196f28e22dfdce4059c61"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"4f7cdb68bf7ddaeaaeb90d8183bd0fc2ec28cfc4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        session.execute(upgrade_table.delete())"},{"line_number":89,"context_line":"        session.commit()"},{"line_number":90,"context_line":"    except:"},{"line_number":91,"context_line":"         LOG.warning(\u0027Skipping assignment table inserts for older schema,\u0027"},{"line_number":92,"context_line":"                     \u0027possible duplicate entries present\u0027)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def downgrade_assignment_table(meta, migrate_engine):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_ea2e2342","line":91,"updated":"2014-11-25 09:45:45.000000000","message":"You may also need to import LOG, and this line seems to be wrongly indented.","commit_id":"51a1744b6486f34dd5e196f28e22dfdce4059c61"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"9da353bd87a49e1650b86c745c9dad4467dea176","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                GROUP_PROJECT_TABLE, GROUP_DOMAIN_TABLE]"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def migrate_grant_table(meta, session, table_name):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def extract_actor_and_target(table_name, composite_grant):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_e2faabbb","line":32,"updated":"2014-11-26 00:15:38.000000000","message":"need an extra line here","commit_id":"ad744f58ee6c835352f547e0e993126c1323ee39"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"9da353bd87a49e1650b86c745c9dad4467dea176","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                session.execute(new_entry)"},{"line_number":86,"context_line":"                session.commit()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        # Delete all the rows"},{"line_number":89,"context_line":"                session.execute(upgrade_table.delete())"},{"line_number":90,"context_line":"                session.commit()"},{"line_number":91,"context_line":"            except sql.exc.IntegrityError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_a2242360","line":88,"updated":"2014-11-26 00:15:38.000000000","message":"not idented","commit_id":"ad744f58ee6c835352f547e0e993126c1323ee39"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"9da353bd87a49e1650b86c745c9dad4467dea176","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                session.execute(upgrade_table.delete())"},{"line_number":90,"context_line":"                session.commit()"},{"line_number":91,"context_line":"            except sql.exc.IntegrityError:"},{"line_number":92,"context_line":"                LOG.warning(\u0027Skipping older schema assignment table inserts,\u0027"},{"line_number":93,"context_line":"                            \u0027possible duplicate entries present\u0027)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_622ebb44","line":92,"updated":"2014-11-26 00:15:38.000000000","message":"missing space after comma","commit_id":"ad744f58ee6c835352f547e0e993126c1323ee39"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"404fd18cf0c20fab612aa3f5b13080356f5018f4","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import json"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import sqlalchemy as sql"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from keystone.assignment.backends import sql as assignment_sql"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_c6abf1d3","side":"PARENT","line":16,"updated":"2014-11-26 13:01:35.000000000","message":"don\u0027t delete this line here - it is there to separate standard library imports (like json) from third party library imports (like sqlalchemy)","commit_id":"ea4fcec2a0da298c8484309966aa632d9ebfaeab"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"404fd18cf0c20fab612aa3f5b13080356f5018f4","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    # Delete all the rows"},{"line_number":91,"context_line":"                session.execute(upgrade_table.delete())"},{"line_number":92,"context_line":"                session.commit()"},{"line_number":93,"context_line":"            except sql.exc.IntegrityError:"},{"line_number":94,"context_line":"                LOG.warning(\u0027Skipping older schema assignment table inserts, \u0027"},{"line_number":95,"context_line":"                            \u0027possible duplicate entries present\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_4679c191","line":92,"updated":"2014-11-26 13:01:35.000000000","message":"I think these two lines need to stay out of the loops and thus the new try-except block too - they need to happen only once after the data mangling is done as they drop the table that was just migrated","commit_id":"77712b344c8de9eb4cf0e349e3751d2607fd64bb"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"6aebb1c778e7ab21d1ac2e7af4d1df2b48aa6b54","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    # For each grant in this table, expand it out to be an assignment entry for"},{"line_number":76,"context_line":"    # each role in the metadata"},{"line_number":77,"context_line":"    # wfoster-b: #1395959 skip if duplicate entries exist, else db_sync fails"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    for grant in session.query(upgrade_table).all():"},{"line_number":80,"context_line":"        for grant_role in grant_to_grant_dict_list(table_name, grant):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_cf76943f","line":77,"updated":"2014-11-26 21:20:00.000000000","message":"you should change a bit this comment:\n\n# NOTE(wfoster-b): due bug #1395959 skip if duplicate entries exist, else db_sync fails\n\nfrom http://legacy.python.org/dev/peps/pep-0350/#what-are-codetags\n\nNOTE (HELP)\nNotes: Sections where a code reviewer found something that needs discussion or further investigation.","commit_id":"3a5c7c111d04ba962e80b4530ffa4f796935a85e"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"5b87f74b5b1de4b22a6d6a663965f18ad2342d2d","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    # For each grant in this table, expand it out to be an assignment entry for"},{"line_number":76,"context_line":"    # each role in the metadata"},{"line_number":77,"context_line":"    # NOTE(wfoster-b): LP#1395959 skip if duplicate entries exist or db_sync fails"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    for grant in session.query(upgrade_table).all():"},{"line_number":80,"context_line":"        for grant_role in grant_to_grant_dict_list(table_name, grant):"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a890539_aa121607","line":77,"updated":"2014-11-26 21:58:27.000000000","message":"LP?","commit_id":"d07146f740572c881e1ac0f86e8a5a5668673794"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"80fbe4a570d2235656635153416e9b81f204749f","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    # For each grant in this table, expand it out to be an assignment entry for"},{"line_number":76,"context_line":"    # each role in the metadata"},{"line_number":77,"context_line":"    # NOTE(wfoster-b): skip assignment table inserts if duplicate entries exist"},{"line_number":78,"context_line":"    # or nova-manage db_sync fails when upgrading from Havana."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    for grant in session.query(upgrade_table).all():"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a890539_fd73b3b1","line":77,"updated":"2014-12-01 19:12:20.000000000","message":"capitalize the S in skip","commit_id":"4a0cab97df4dac6be0754b8aa96ecd7725e2fdb7"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"80fbe4a570d2235656635153416e9b81f204749f","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    # For each grant in this table, expand it out to be an assignment entry for"},{"line_number":76,"context_line":"    # each role in the metadata"},{"line_number":77,"context_line":"    # NOTE(wfoster-b): skip assignment table inserts if duplicate entries exist"},{"line_number":78,"context_line":"    # or nova-manage db_sync fails when upgrading from Havana."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    for grant in session.query(upgrade_table).all():"},{"line_number":81,"context_line":"        for grant_role in grant_to_grant_dict_list(table_name, grant):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a890539_9d3b8fc7","line":78,"updated":"2014-12-01 19:12:20.000000000","message":"keystone-manage instead of nova-manage","commit_id":"4a0cab97df4dac6be0754b8aa96ecd7725e2fdb7"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"80fbe4a570d2235656635153416e9b81f204749f","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                session.execute(new_entry)"},{"line_number":90,"context_line":"                session.commit()"},{"line_number":91,"context_line":"            except sql.exc.IntegrityError:"},{"line_number":92,"context_line":"                LOG.warning(\u0027Skipping older schema assignment table inserts, \u0027"},{"line_number":93,"context_line":"                            \u0027possible duplicate entries present\u0027)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    # Delete all the rows"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a890539_1d295f89","line":92,"updated":"2014-12-01 19:12:20.000000000","message":"use _LW() to indicate it\u0027s marked for translation","commit_id":"4a0cab97df4dac6be0754b8aa96ecd7725e2fdb7"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"d8c9076e938b734e3fd85d1f2f2379454b889c59","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                            \u0027possible duplicate entries present\u0027)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    # Delete all the rows"},{"line_number":96,"context_line":"    # This happens only once after mangling is done, dropping migrated table"},{"line_number":97,"context_line":"    session.execute(upgrade_table.delete())"},{"line_number":98,"context_line":"    session.commit()"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a890539_67fe9bb0","line":96,"updated":"2014-11-27 10:04:50.000000000","message":"Not sure we need to add this particular comment  as it was like that even before this patch, but no need to hold up the fix for that.","commit_id":"4a0cab97df4dac6be0754b8aa96ecd7725e2fdb7"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"b45fc4c5119d863f7eed347becec7edc09dd40ec","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    inherited\u003dgrant_role[\u0027inherited\u0027])"},{"line_number":89,"context_line":"                session.execute(new_entry)"},{"line_number":90,"context_line":"                session.commit()"},{"line_number":91,"context_line":"            except sql.exc.IntegrityError:"},{"line_number":92,"context_line":"                LOG.warning(\u0027Skip older schema assignment table inserts, \u0027"},{"line_number":93,"context_line":"                            \u0027possible duplicate entries present\u0027),"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5a890539_c3e408aa","line":91,"updated":"2014-12-03 15:29:56.000000000","message":"You cannot be sure about the exact integrity error. I\u0027d rather use \u0027if-not-exists\u0027 logic here:\n\n1) select count(1) from assignment table where \u003cyour credentials\u003e\n\n2) if count is 0, perform insert","commit_id":"2e39728bef66356b869cb2d729dc5cd190686422"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"24bb0ed794ecf6a62de56b91286f22a57408450b","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    inherited\u003dgrant_role[\u0027inherited\u0027])"},{"line_number":89,"context_line":"                session.execute(new_entry)"},{"line_number":90,"context_line":"                session.commit()"},{"line_number":91,"context_line":"            except sql.exc.IntegrityError:"},{"line_number":92,"context_line":"                LOG.warning(\u0027Skip older schema assignment table inserts, \u0027"},{"line_number":93,"context_line":"                            \u0027possible duplicate entries present\u0027),"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a961159_779b4972","line":91,"in_reply_to":"5a890539_c3e408aa","updated":"2014-12-10 17:43:51.000000000","message":"I really dislike that approach - it adds overhead to migrations which are already a source of pain and downtime for deployers.\n\nAfter speaking to Mike Bayer, he seems to suggest the following:\n\n1) Best: Move this migration to using oslo.db\u0027s create_engine - in which case you can be sure that oslo.db.exception.DBDuplicateEntry will catch these.\n\n2) Keep the integrity error and make it future proof with (IntegrityError, oslo.db.exception.DBDuplicateEntry): as IntegrityError should really be fine for this as long as the db driver implements pythons DBAPI correctly.\n\nSeeing what this fixes is about - I\u0027d suggest 2) in this patch with 1) followup","commit_id":"2e39728bef66356b869cb2d729dc5cd190686422"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"96331a8c88584b74811804162a8417b23da63575","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                session.execute(new_entry)"},{"line_number":90,"context_line":"                session.commit()"},{"line_number":91,"context_line":"            except sql.exc.IntegrityError:"},{"line_number":92,"context_line":"                LOG.warning(\u0027Skip older schema assignment table inserts, \u0027"},{"line_number":93,"context_line":"                            \u0027possible duplicate entries present\u0027),"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    # Delete all the rows"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a961159_3aca886e","line":92,"updated":"2014-12-10 18:11:17.000000000","message":"Needs to use log hint _LW for i18n.","commit_id":"2e39728bef66356b869cb2d729dc5cd190686422"}]}
