)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fd0e651f37c82a689b04cb0681fd47609a750ec8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f401bd99_ac5f65dd","updated":"2025-05-13 14:04:57.000000000","message":"This swift code sure seems like it could use a general refactor. A huge long while loop with nested exception handlers is :(","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"}],"glance_store/_drivers/swift/store.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"425172a4ba0c9b40d1fc3729044ddd84c927856b","unresolved":false,"context_lines":[{"line_number":993,"context_line":"                        # image_size"},{"line_number":994,"context_line":"                        if (image_size !\u003d 0 and"},{"line_number":995,"context_line":"                                combined_chunks_size \u003e image_size):"},{"line_number":996,"context_line":"                            # Cleanup: delete all uploaded chunks so far"},{"line_number":997,"context_line":"                            self._delete_stale_chunks("},{"line_number":998,"context_line":"                                manager.get_connection(),"},{"line_number":999,"context_line":"                                location.container, written_chunks)"},{"line_number":1000,"context_line":"                            # Also delete the object if it exists"},{"line_number":1001,"context_line":"                            self._delete_object(location, manager)"},{"line_number":1002,"context_line":"                            raise exceptions.Invalid("},{"line_number":1003,"context_line":"                                \"Uploaded data exceeds the specified \""},{"line_number":1004,"context_line":"                                \"size (%d).\" % image_size)"}],"source_content_type":"text/x-python","patch_set":1,"id":"b2ac0998_f91b7c62","line":1001,"range":{"start_line":996,"start_character":28,"end_line":1001,"end_character":66},"updated":"2025-05-13 13:00:32.000000000","message":"NOTE: I think this can be removed as 1021 line will take care of this!","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"bc6dc53488de4a897d3db5dca4ab5fba0bad592f","unresolved":false,"context_lines":[{"line_number":993,"context_line":"                        # image_size"},{"line_number":994,"context_line":"                        if (image_size !\u003d 0 and"},{"line_number":995,"context_line":"                                combined_chunks_size \u003e image_size):"},{"line_number":996,"context_line":"                            # Cleanup: delete all uploaded chunks so far"},{"line_number":997,"context_line":"                            self._delete_stale_chunks("},{"line_number":998,"context_line":"                                manager.get_connection(),"},{"line_number":999,"context_line":"                                location.container, written_chunks)"},{"line_number":1000,"context_line":"                            # Also delete the object if it exists"},{"line_number":1001,"context_line":"                            self._delete_object(location, manager)"},{"line_number":1002,"context_line":"                            raise exceptions.Invalid("},{"line_number":1003,"context_line":"                                \"Uploaded data exceeds the specified \""},{"line_number":1004,"context_line":"                                \"size (%d).\" % image_size)"}],"source_content_type":"text/x-python","patch_set":1,"id":"e22958b2_f1beb7e2","line":1001,"range":{"start_line":996,"start_character":28,"end_line":1001,"end_character":66},"in_reply_to":"042e9677_ce4cd305","updated":"2025-05-13 14:36:46.000000000","message":"Yes","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fd0e651f37c82a689b04cb0681fd47609a750ec8","unresolved":false,"context_lines":[{"line_number":993,"context_line":"                        # image_size"},{"line_number":994,"context_line":"                        if (image_size !\u003d 0 and"},{"line_number":995,"context_line":"                                combined_chunks_size \u003e image_size):"},{"line_number":996,"context_line":"                            # Cleanup: delete all uploaded chunks so far"},{"line_number":997,"context_line":"                            self._delete_stale_chunks("},{"line_number":998,"context_line":"                                manager.get_connection(),"},{"line_number":999,"context_line":"                                location.container, written_chunks)"},{"line_number":1000,"context_line":"                            # Also delete the object if it exists"},{"line_number":1001,"context_line":"                            self._delete_object(location, manager)"},{"line_number":1002,"context_line":"                            raise exceptions.Invalid("},{"line_number":1003,"context_line":"                                \"Uploaded data exceeds the specified \""},{"line_number":1004,"context_line":"                                \"size (%d).\" % image_size)"}],"source_content_type":"text/x-python","patch_set":1,"id":"042e9677_ce4cd305","line":1001,"range":{"start_line":996,"start_character":28,"end_line":1001,"end_character":66},"in_reply_to":"b2ac0998_f91b7c62","updated":"2025-05-13 14:04:57.000000000","message":"And that means we don\u0027t need to add your `_delete_object()` helper at all either?","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fd0e651f37c82a689b04cb0681fd47609a750ec8","unresolved":true,"context_lines":[{"line_number":1051,"context_line":"                                  \"data.\", combined_chunks_size, image_size)"},{"line_number":1052,"context_line":"                        # Cleanup: delete object and chunks"},{"line_number":1053,"context_line":"                        self._delete_object(location, manager)"},{"line_number":1054,"context_line":"                        self._delete_stale_chunks("},{"line_number":1055,"context_line":"                            manager.get_connection(),"},{"line_number":1056,"context_line":"                            location.container, written_chunks)"},{"line_number":1057,"context_line":"                        raise exceptions.Invalid(\"Size mismatch after \""}],"source_content_type":"text/x-python","patch_set":1,"id":"edac456f_a7e3c19e","line":1054,"updated":"2025-05-13 14:04:57.000000000","message":"Why not put this into an except handler below, like near L1099? In fact, can we move handling of both cases? The L1021 handler will re-raise and could be caught/cleaned by a single exception handler, no?","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"0960b37109a870362505ad6d417843784d804963","unresolved":false,"context_lines":[{"line_number":1051,"context_line":"                                  \"data.\", combined_chunks_size, image_size)"},{"line_number":1052,"context_line":"                        # Cleanup: delete object and chunks"},{"line_number":1053,"context_line":"                        self._delete_object(location, manager)"},{"line_number":1054,"context_line":"                        self._delete_stale_chunks("},{"line_number":1055,"context_line":"                            manager.get_connection(),"},{"line_number":1056,"context_line":"                            location.container, written_chunks)"},{"line_number":1057,"context_line":"                        raise exceptions.Invalid(\"Size mismatch after \""}],"source_content_type":"text/x-python","patch_set":1,"id":"ae4dfd4f_7e2d970d","line":1054,"in_reply_to":"483e79f2_99687517","updated":"2025-05-13 14:47:16.000000000","message":"Acknowledged","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dc5936dcba64ed1b977f8bf6f0ab4e89411cac95","unresolved":true,"context_lines":[{"line_number":1051,"context_line":"                                  \"data.\", combined_chunks_size, image_size)"},{"line_number":1052,"context_line":"                        # Cleanup: delete object and chunks"},{"line_number":1053,"context_line":"                        self._delete_object(location, manager)"},{"line_number":1054,"context_line":"                        self._delete_stale_chunks("},{"line_number":1055,"context_line":"                            manager.get_connection(),"},{"line_number":1056,"context_line":"                            location.container, written_chunks)"},{"line_number":1057,"context_line":"                        raise exceptions.Invalid(\"Size mismatch after \""}],"source_content_type":"text/x-python","patch_set":1,"id":"483e79f2_99687517","line":1054,"in_reply_to":"98c5a329_6dd39aaa","updated":"2025-05-13 14:44:11.000000000","message":"What I mean is on L1099, before we raise the new exception, do the cleanup of the old chunks so we don\u0027t have to do it in multiple places inside this massive code block.","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"bc6dc53488de4a897d3db5dca4ab5fba0bad592f","unresolved":true,"context_lines":[{"line_number":1051,"context_line":"                                  \"data.\", combined_chunks_size, image_size)"},{"line_number":1052,"context_line":"                        # Cleanup: delete object and chunks"},{"line_number":1053,"context_line":"                        self._delete_object(location, manager)"},{"line_number":1054,"context_line":"                        self._delete_stale_chunks("},{"line_number":1055,"context_line":"                            manager.get_connection(),"},{"line_number":1056,"context_line":"                            location.container, written_chunks)"},{"line_number":1057,"context_line":"                        raise exceptions.Invalid(\"Size mismatch after \""}],"source_content_type":"text/x-python","patch_set":1,"id":"98c5a329_6dd39aaa","line":1054,"in_reply_to":"edac456f_a7e3c19e","updated":"2025-05-13 14:36:46.000000000","message":"You mean to say after exception handled on line #1099, right?","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dc5936dcba64ed1b977f8bf6f0ab4e89411cac95","unresolved":true,"context_lines":[{"line_number":1096,"context_line":"                return (location.get_uri(credentials_included\u003dinclude_creds),"},{"line_number":1097,"context_line":"                        image_size, obj_etag, os_hash_value.hexdigest(),"},{"line_number":1098,"context_line":"                        metadata)"},{"line_number":1099,"context_line":"            except swiftclient.ClientException as e:"},{"line_number":1100,"context_line":"                if e.http_status \u003d\u003d http.client.CONFLICT:"},{"line_number":1101,"context_line":"                    msg \u003d _(\"Swift already has an image at this location\")"},{"line_number":1102,"context_line":"                    raise exceptions.Duplicate(message\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"071d6e68_e2f2f71b","line":1099,"updated":"2025-05-13 14:44:11.000000000","message":"```\nself._delete_object()\nself._delete_stale_chunks()\n```\n...right?","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"0960b37109a870362505ad6d417843784d804963","unresolved":false,"context_lines":[{"line_number":1096,"context_line":"                return (location.get_uri(credentials_included\u003dinclude_creds),"},{"line_number":1097,"context_line":"                        image_size, obj_etag, os_hash_value.hexdigest(),"},{"line_number":1098,"context_line":"                        metadata)"},{"line_number":1099,"context_line":"            except swiftclient.ClientException as e:"},{"line_number":1100,"context_line":"                if e.http_status \u003d\u003d http.client.CONFLICT:"},{"line_number":1101,"context_line":"                    msg \u003d _(\"Swift already has an image at this location\")"},{"line_number":1102,"context_line":"                    raise exceptions.Duplicate(message\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9e7e8d_391ff7af","line":1099,"in_reply_to":"071d6e68_e2f2f71b","updated":"2025-05-13 14:47:16.000000000","message":"Acknowledged","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"1711f95b1d93829fb8f7d6b226c2066bcb093280","unresolved":true,"context_lines":[{"line_number":1036,"context_line":"                        raise exceptions.Invalid(\"Size mismatch after \""},{"line_number":1037,"context_line":"                                                 \"chunked upload.\")"},{"line_number":1038,"context_line":""},{"line_number":1039,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":1040,"context_line":"                    # set the size to the total size of the combined chunks."},{"line_number":1041,"context_line":"                    image_size \u003d combined_chunks_size"},{"line_number":1042,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5cd819c9_0538bef1","line":1039,"range":{"start_line":1039,"start_character":21,"end_line":1039,"end_character":22},"updated":"2025-06-17 18:42:42.000000000","message":"This comment is outdated, please remove it.","commit_id":"768a6280283562bcd3cb8d429203dbe86e1a5385"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"0171d94dae5df95b0ffa09bafca5cbeddc452901","unresolved":false,"context_lines":[{"line_number":1036,"context_line":"                        raise exceptions.Invalid(\"Size mismatch after \""},{"line_number":1037,"context_line":"                                                 \"chunked upload.\")"},{"line_number":1038,"context_line":""},{"line_number":1039,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":1040,"context_line":"                    # set the size to the total size of the combined chunks."},{"line_number":1041,"context_line":"                    image_size \u003d combined_chunks_size"},{"line_number":1042,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7b72e825_a256ecd0","line":1039,"range":{"start_line":1039,"start_character":21,"end_line":1039,"end_character":22},"in_reply_to":"5cd819c9_0538bef1","updated":"2025-06-19 16:42:04.000000000","message":"Acknowledged","commit_id":"768a6280283562bcd3cb8d429203dbe86e1a5385"}],"glance_store/tests/unit/test_swift_store.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"425172a4ba0c9b40d1fc3729044ddd84c927856b","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"Store \u003d swift.Store"},{"line_number":55,"context_line":"FIVE_KB \u003d 5 * units.Ki"},{"line_number":56,"context_line":"FIVE_MB \u003d 5 * units.Mi"},{"line_number":57,"context_line":"FIVE_GB \u003d 5 * units.Gi"},{"line_number":58,"context_line":"HASH_ALGO \u003d \u0027sha256\u0027"},{"line_number":59,"context_line":"MAX_SWIFT_OBJECT_SIZE \u003d FIVE_GB"}],"source_content_type":"text/x-python","patch_set":1,"id":"71cfc3e0_c72df043","line":56,"range":{"start_line":56,"start_character":0,"end_line":56,"end_character":22},"updated":"2025-05-13 13:00:32.000000000","message":"NOTE: Remove this in new PS!","commit_id":"4b026d960afe3a84240f41d7dbd5230794d37d84"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6e4f4cff0076f90dcf8b468f55584be02a228d84","unresolved":true,"context_lines":[{"line_number":475,"context_line":"                self.store.add(expected_image_id, image_swift,"},{"line_number":476,"context_line":"                               expected_swift_size, HASH_ALGO)"},{"line_number":477,"context_line":"            except exceptions.Invalid as e:"},{"line_number":478,"context_line":"                self.assertIn(\"Size exceeds: expected\", e.msg)"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"        # The position should be equal to total input size"},{"line_number":481,"context_line":"        self.assertEqual(image_swift.tell(), len(expected_swift_contents))"}],"source_content_type":"text/x-python","patch_set":6,"id":"345b972e_9769a69d","line":478,"updated":"2025-06-30 14:46:37.000000000","message":"As with the other, this and all other forms here needs to be `assertRaisesRegex()`","commit_id":"7b5817aed476fe6c79e04782fea129dd487d456a"}]}
