)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"21d2b4dc7cbdbd6cd2ea84160b00e8cce208f64e","unresolved":false,"context_lines":[{"line_number":14,"context_line":"should check all existing image-member records including the deleted"},{"line_number":15,"context_line":"image-member before create image-member, then update it if it exists,"},{"line_number":16,"context_line":"otherwise create a new one."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Closes-Bug: #1462315"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I84f88d133bf4ac6daa0ff5d148aed86c0ff2cb2d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3a50d1a3_b76808bc","line":17,"updated":"2015-07-20 05:52:47.000000000","message":"IMO APIImpact flag is required","commit_id":"6cc4d3d01c77c5f8392fabfade5d1bf595a47d5a"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"37d9a02f379c75644c1411b7d7c713f968dad00a","unresolved":false,"context_lines":[{"line_number":14,"context_line":"should check all existing image-member records including the deleted"},{"line_number":15,"context_line":"image-member before create image-member, then update it if it exists,"},{"line_number":16,"context_line":"otherwise create a new one."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Closes-Bug: #1462315"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I84f88d133bf4ac6daa0ff5d148aed86c0ff2cb2d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3a50d1a3_48d80554","line":17,"in_reply_to":"3a50d1a3_b76808bc","updated":"2015-07-20 08:05:20.000000000","message":"Done","commit_id":"6cc4d3d01c77c5f8392fabfade5d1bf595a47d5a"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"bc81436ac5c9e5f62a312991c24d0a2f139ef3c7","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Long Quan Sha \u003cshalq@cn.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-07-20 16:01:10 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"member-create should handle the deleted image-member"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If an image-member is deleted, then create it again with the same"},{"line_number":10,"context_line":"parameters, glance searches db to see if there is already an"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3a50d1a3_67d34b39","line":7,"updated":"2015-07-27 16:53:44.000000000","message":"Commit title should indicate in one line what this patch is intending to do vs. what is expected behavior.\n\nYou have indicated the later. Please correct the title.","commit_id":"59a20298ff9a06173a95e05248de1255652b3e0e"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"967201dc70a29b105ffb8ebe68249f6ff290affc","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Long Quan Sha \u003cshalq@cn.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-07-20 16:01:10 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"member-create should handle the deleted image-member"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If an image-member is deleted, then create it again with the same"},{"line_number":10,"context_line":"parameters, glance searches db to see if there is already an"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3a50d1a3_9c6a36b4","line":7,"in_reply_to":"3a50d1a3_67d34b39","updated":"2015-07-28 15:21:12.000000000","message":"Done","commit_id":"59a20298ff9a06173a95e05248de1255652b3e0e"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"bc81436ac5c9e5f62a312991c24d0a2f139ef3c7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"member-create should handle the deleted image-member"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If an image-member is deleted, then create it again with the same"},{"line_number":10,"context_line":"parameters, glance searches db to see if there is already an"},{"line_number":11,"context_line":"existing one, but the result doesn\u0027t include the record which was"},{"line_number":12,"context_line":"marked as deleted, glance will try to create a new one with the"},{"line_number":13,"context_line":"same parameters, it will fail with SQL0803N error. To fix this,we"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3a50d1a3_87a457b9","line":10,"updated":"2015-07-27 16:53:44.000000000","message":"initiates a query.","commit_id":"59a20298ff9a06173a95e05248de1255652b3e0e"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"967201dc70a29b105ffb8ebe68249f6ff290affc","unresolved":false,"context_lines":[{"line_number":7,"context_line":"member-create should handle the deleted image-member"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If an image-member is deleted, then create it again with the same"},{"line_number":10,"context_line":"parameters, glance searches db to see if there is already an"},{"line_number":11,"context_line":"existing one, but the result doesn\u0027t include the record which was"},{"line_number":12,"context_line":"marked as deleted, glance will try to create a new one with the"},{"line_number":13,"context_line":"same parameters, it will fail with SQL0803N error. To fix this,we"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3a50d1a3_5c690ebd","line":10,"in_reply_to":"3a50d1a3_87a457b9","updated":"2015-07-28 15:21:12.000000000","message":"Done","commit_id":"59a20298ff9a06173a95e05248de1255652b3e0e"}],"glance/db/__init__.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"11706b0b92f55fba6eae7fb07289b58d2c441672","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            raise exception.Duplicate(msg)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        image_member_values \u003d self._format_image_member_to_db(image_member)"},{"line_number":356,"context_line":"        members \u003d self.db_api.image_member_find(self.context,"},{"line_number":357,"context_line":"                                                image_id\u003dself.image.image_id,"},{"line_number":358,"context_line":"                                                member\u003dimage_member.member_id,"},{"line_number":359,"context_line":"                                                include_deleted\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_73ad9a30","line":356,"updated":"2015-07-17 11:29:34.000000000","message":"self.get is already called at #345 can we use this here.\n\nAdd include_deleted\u003dFalse to get() at #388 then the code will be like\n\nmembers \u003d None\ntry:\n    members \u003d self.get(image_member.member_id, include_deleted\u003dTrue)\nexcept exception.NotFound:\n     # create new record here\nelse:\n    if deleted:\n        raise exception.Duplicate(msg)\n\n    Update the record","commit_id":"6cc4d3d01c77c5f8392fabfade5d1bf595a47d5a"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"ebd78a94d8219bc3d52686c814e5da0732cd12fd","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            raise exception.Duplicate(msg)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        image_member_values \u003d self._format_image_member_to_db(image_member)"},{"line_number":356,"context_line":"        members \u003d self.db_api.image_member_find(self.context,"},{"line_number":357,"context_line":"                                                image_id\u003dself.image.image_id,"},{"line_number":358,"context_line":"                                                member\u003dimage_member.member_id,"},{"line_number":359,"context_line":"                                                include_deleted\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_9ee7dfab","line":356,"in_reply_to":"9a41bdd9_73ad9a30","updated":"2015-07-18 03:44:30.000000000","message":"Thanks for your comments, yes,we may could do it, but my consideration is we\u0027d better alter less public interface, the less the better. I\u0027d like to limit the change in membership create case. Get is used in many cases, in future if we do need to get the delelted member, then we could expand get method.","commit_id":"6cc4d3d01c77c5f8392fabfade5d1bf595a47d5a"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"b8af13cbb21825296520a34b822c91903cd7d2cd","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            raise exception.Duplicate(msg)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        image_member_values \u003d self._format_image_member_to_db(image_member)"},{"line_number":356,"context_line":"        members \u003d self.db_api.image_member_find(self.context,"},{"line_number":357,"context_line":"                                                image_id\u003dself.image.image_id,"},{"line_number":358,"context_line":"                                                member\u003dimage_member.member_id,"},{"line_number":359,"context_line":"                                                include_deleted\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa1b9901_d5f076cb","line":356,"updated":"2015-08-20 16:08:45.000000000","message":"It might be worth adding a note to the above line for the reason to include_deleted\u003dTrue by default so that it\u0027s not confusing for people.","commit_id":"3cf2d44099e3d2849dc98fae35c11484ceaa3ca7"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"e2b421eb278cc8b4e164437a824e3ee9e7191225","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            raise exception.Duplicate(msg)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"        image_member_values \u003d self._format_image_member_to_db(image_member)"},{"line_number":356,"context_line":"        members \u003d self.db_api.image_member_find(self.context,"},{"line_number":357,"context_line":"                                                image_id\u003dself.image.image_id,"},{"line_number":358,"context_line":"                                                member\u003dimage_member.member_id,"},{"line_number":359,"context_line":"                                                include_deleted\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa1b9901_e74ff731","line":356,"in_reply_to":"fa1b9901_d5f076cb","updated":"2015-08-21 01:57:38.000000000","message":"Done","commit_id":"3cf2d44099e3d2849dc98fae35c11484ceaa3ca7"}],"glance/db/sqlalchemy/api.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"184b6d4a87a52b20e6a4767e58c6e95828ec748e","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"                       member\u003dNone, status\u003dNone, include_deleted\u003dFalse):"},{"line_number":1099,"context_line":"    query \u003d session.query(models.ImageMember)"},{"line_number":1100,"context_line":"    if not include_deleted:"},{"line_number":1101,"context_line":"        query \u003d query.filter_by(deleted\u003dFalse)"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"    if not context.is_admin:"},{"line_number":1104,"context_line":"        query \u003d query.join(models.Image)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa1b9901_2618bf74","line":1101,"updated":"2015-08-20 09:22:43.000000000","message":"IMO, no need of if condition\n\nyou can also use \n\nquery \u003d query.filter_by(deleted\u003dinclude_deleted)","commit_id":"fdafda723c6ead5f5f16118de5c3fda28983abf1"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"716e078b52a1f38dd17469a59467c6ad2c6d2d68","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"                       member\u003dNone, status\u003dNone, include_deleted\u003dFalse):"},{"line_number":1099,"context_line":"    query \u003d session.query(models.ImageMember)"},{"line_number":1100,"context_line":"    if not include_deleted:"},{"line_number":1101,"context_line":"        query \u003d query.filter_by(deleted\u003dFalse)"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"    if not context.is_admin:"},{"line_number":1104,"context_line":"        query \u003d query.join(models.Image)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa1b9901_e5114b05","line":1101,"in_reply_to":"fa1b9901_2618bf74","updated":"2015-08-20 15:18:20.000000000","message":"Done. Thank you Abhishek for your comments.","commit_id":"fdafda723c6ead5f5f16118de5c3fda28983abf1"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"57ed76da3891710f6ff79fbeac59a38230398774","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"                       member\u003dNone, status\u003dNone, include_deleted\u003dFalse):"},{"line_number":1099,"context_line":"    query \u003d session.query(models.ImageMember)"},{"line_number":1100,"context_line":"    if not include_deleted:"},{"line_number":1101,"context_line":"        query \u003d query.filter_by(deleted\u003dFalse)"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"    if not context.is_admin:"},{"line_number":1104,"context_line":"        query \u003d query.join(models.Image)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa1b9901_6af5eeea","line":1101,"in_reply_to":"fa1b9901_e5114b05","updated":"2015-08-21 02:12:21.000000000","message":"Abhishek, I did the change as your example, but the unit test failed in patch 20. That made me think twice about this line,I think the original line is correct. Let\u0027s explain:\n\nif include_deleted is True, what we want is all records including the deleted, so don\u0027t need to filter anything. \n\nif we use query \u003d query.filter_by(deleted\u003dinclude_deleted), then it becomes query.filter_by(deleted\u003dTrue) in this case, it will just leave records which are not marked with deleted.\n\nIt is interesting, it proves the value of unit test. That also makes me believe unit test is very necessary. :)","commit_id":"fdafda723c6ead5f5f16118de5c3fda28983abf1"}]}
