)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"695b8322ab565594ef55af1e9c55ae30165a12b5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"f67685ee_0d7e7306","updated":"2025-05-08 14:37:18.000000000","message":"Missing coverage also applies to the multistore version of the test.","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"f7bf58812b49385d049308ae9365ed0d1c15ca7e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"ff3f8c19_4b99432e","updated":"2025-05-14 17:22:44.000000000","message":"recheck","commit_id":"dd0684400f8b6ebae81a24172d41c9bd8efd43a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"995503d184c245c39008d4b2dbc66ce83e279966","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"4eecea1f_145c00d4","updated":"2025-05-15 06:05:17.000000000","message":"recheck incremental backup failure, not related","commit_id":"dd0684400f8b6ebae81a24172d41c9bd8efd43a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e1fc4b020584cbca84691fc9b876c78053f1683a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"6f7c497c_baa2c517","updated":"2025-05-16 14:02:40.000000000","message":"recheck scrubber restore functional test failure","commit_id":"8183366b8175afe45de11acae0609aa1453f12d9"}],"glance_store/_drivers/filesystem.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5ab6ca49916478da0d2f01fc781a34511b1536c6","unresolved":true,"context_lines":[{"line_number":746,"context_line":"                for buf in utils.chunkreadable(image_file,"},{"line_number":747,"context_line":"                                               self.WRITE_CHUNKSIZE):"},{"line_number":748,"context_line":"                    actual_to_write \u003d bytes_written + len(buf)"},{"line_number":749,"context_line":"                    if image_size !\u003d 0 and actual_to_write \u003e image_size:"},{"line_number":750,"context_line":"                        # Cleanup and raise exception after partial write"},{"line_number":751,"context_line":"                        self._delete_partial(filepath, image_id)"},{"line_number":752,"context_line":"                        raise exceptions.Invalid("}],"source_content_type":"text/x-python","patch_set":2,"id":"d0d33cbc_74834df4","line":749,"updated":"2025-05-08 13:44:20.000000000","message":"I don\u0027t think this does what your commit message says. This says we didn\u0027t exceed the stated image size, but it\u0027s not sufficient to check that we wrote exactly the amount claimed, right. If I claim 1G and write 1M, this will all pass, AFAICT.","commit_id":"c817cedf961a3ca1e53f71305b58ed8a4837da99"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5c91991ed6a42fd15aaf03b69054d95998b6a529","unresolved":true,"context_lines":[{"line_number":746,"context_line":"                for buf in utils.chunkreadable(image_file,"},{"line_number":747,"context_line":"                                               self.WRITE_CHUNKSIZE):"},{"line_number":748,"context_line":"                    actual_to_write \u003d bytes_written + len(buf)"},{"line_number":749,"context_line":"                    if image_size !\u003d 0 and actual_to_write \u003e image_size:"},{"line_number":750,"context_line":"                        # Cleanup and raise exception after partial write"},{"line_number":751,"context_line":"                        self._delete_partial(filepath, image_id)"},{"line_number":752,"context_line":"                        raise exceptions.Invalid("}],"source_content_type":"text/x-python","patch_set":2,"id":"49f60ce1_222bf974","line":749,"in_reply_to":"3e8eb587_1ce8d560","updated":"2025-05-08 14:26:18.000000000","message":"Yeah, checking in the loop makes sense, I think you just need to *also* check after that it matches exactly.","commit_id":"c817cedf961a3ca1e53f71305b58ed8a4837da99"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"695b8322ab565594ef55af1e9c55ae30165a12b5","unresolved":false,"context_lines":[{"line_number":746,"context_line":"                for buf in utils.chunkreadable(image_file,"},{"line_number":747,"context_line":"                                               self.WRITE_CHUNKSIZE):"},{"line_number":748,"context_line":"                    actual_to_write \u003d bytes_written + len(buf)"},{"line_number":749,"context_line":"                    if image_size !\u003d 0 and actual_to_write \u003e image_size:"},{"line_number":750,"context_line":"                        # Cleanup and raise exception after partial write"},{"line_number":751,"context_line":"                        self._delete_partial(filepath, image_id)"},{"line_number":752,"context_line":"                        raise exceptions.Invalid("}],"source_content_type":"text/x-python","patch_set":2,"id":"8761da32_6cf0868b","line":749,"in_reply_to":"49f60ce1_222bf974","updated":"2025-05-08 14:37:18.000000000","message":"Done","commit_id":"c817cedf961a3ca1e53f71305b58ed8a4837da99"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4069700ff57342f4ebf5031654b7c57528dc4a83","unresolved":true,"context_lines":[{"line_number":746,"context_line":"                for buf in utils.chunkreadable(image_file,"},{"line_number":747,"context_line":"                                               self.WRITE_CHUNKSIZE):"},{"line_number":748,"context_line":"                    actual_to_write \u003d bytes_written + len(buf)"},{"line_number":749,"context_line":"                    if image_size !\u003d 0 and actual_to_write \u003e image_size:"},{"line_number":750,"context_line":"                        # Cleanup and raise exception after partial write"},{"line_number":751,"context_line":"                        self._delete_partial(filepath, image_id)"},{"line_number":752,"context_line":"                        raise exceptions.Invalid("}],"source_content_type":"text/x-python","patch_set":2,"id":"3e8eb587_1ce8d560","line":749,"in_reply_to":"ac1ae8fb_f747c994","updated":"2025-05-08 14:18:18.000000000","message":"OR similar to check here,\n\nhttps://review.opendev.org/c/openstack/glance_store/+/949129/1/glance_store/_drivers/s3.py#704","commit_id":"c817cedf961a3ca1e53f71305b58ed8a4837da99"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b1b4007319f4e631dfb2db5c64ff1f255868125","unresolved":true,"context_lines":[{"line_number":746,"context_line":"                for buf in utils.chunkreadable(image_file,"},{"line_number":747,"context_line":"                                               self.WRITE_CHUNKSIZE):"},{"line_number":748,"context_line":"                    actual_to_write \u003d bytes_written + len(buf)"},{"line_number":749,"context_line":"                    if image_size !\u003d 0 and actual_to_write \u003e image_size:"},{"line_number":750,"context_line":"                        # Cleanup and raise exception after partial write"},{"line_number":751,"context_line":"                        self._delete_partial(filepath, image_id)"},{"line_number":752,"context_line":"                        raise exceptions.Invalid("}],"source_content_type":"text/x-python","patch_set":2,"id":"ac1ae8fb_f747c994","line":749,"in_reply_to":"d0d33cbc_74834df4","updated":"2025-05-08 14:16:37.000000000","message":"ACK, so I will move this check outside loop (may be after line 765) and then check if we wrote exactly as claimed.","commit_id":"c817cedf961a3ca1e53f71305b58ed8a4837da99"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5ab6ca49916478da0d2f01fc781a34511b1536c6","unresolved":true,"context_lines":[{"line_number":748,"context_line":"                    actual_to_write \u003d bytes_written + len(buf)"},{"line_number":749,"context_line":"                    if image_size !\u003d 0 and actual_to_write \u003e image_size:"},{"line_number":750,"context_line":"                        # Cleanup and raise exception after partial write"},{"line_number":751,"context_line":"                        self._delete_partial(filepath, image_id)"},{"line_number":752,"context_line":"                        raise exceptions.Invalid("},{"line_number":753,"context_line":"                            message\u003d\"Attempted to write beyond the expected \""},{"line_number":754,"context_line":"                                    \"image size of %s bytes.\" % image_size"}],"source_content_type":"text/x-python","patch_set":2,"id":"46ba16c8_28fdc7f0","line":751,"updated":"2025-05-08 13:44:20.000000000","message":"Won\u0027t this be run by L775 such that you don\u0027t need it here?","commit_id":"c817cedf961a3ca1e53f71305b58ed8a4837da99"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b1b4007319f4e631dfb2db5c64ff1f255868125","unresolved":false,"context_lines":[{"line_number":748,"context_line":"                    actual_to_write \u003d bytes_written + len(buf)"},{"line_number":749,"context_line":"                    if image_size !\u003d 0 and actual_to_write \u003e image_size:"},{"line_number":750,"context_line":"                        # Cleanup and raise exception after partial write"},{"line_number":751,"context_line":"                        self._delete_partial(filepath, image_id)"},{"line_number":752,"context_line":"                        raise exceptions.Invalid("},{"line_number":753,"context_line":"                            message\u003d\"Attempted to write beyond the expected \""},{"line_number":754,"context_line":"                                    \"image size of %s bytes.\" % image_size"}],"source_content_type":"text/x-python","patch_set":2,"id":"4620227d_ae014138","line":751,"in_reply_to":"46ba16c8_28fdc7f0","updated":"2025-05-08 14:16:37.000000000","message":"Acknowledged","commit_id":"c817cedf961a3ca1e53f71305b58ed8a4837da99"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"695b8322ab565594ef55af1e9c55ae30165a12b5","unresolved":true,"context_lines":[{"line_number":750,"context_line":"                        raise exceptions.Invalid("},{"line_number":751,"context_line":"                            message\u003d\"Attempted to write beyond the expected \""},{"line_number":752,"context_line":"                                    \"image size of %s bytes.\" % image_size"},{"line_number":753,"context_line":"                        )"},{"line_number":754,"context_line":"                    bytes_written +\u003d len(buf)"},{"line_number":755,"context_line":"                    os_hash_value.update(buf)"},{"line_number":756,"context_line":"                    checksum.update(buf)"}],"source_content_type":"text/x-python","patch_set":3,"id":"077f2fed_a5447c51","line":753,"updated":"2025-05-08 14:37:18.000000000","message":"I hate this new black-inspired pattern of leaving dangling close parens.. Just wastes a vertical line for no reason and looks terrible to me.\n\nJust FYI :D","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b5cf815baf1fc56970fed533e75bc83d134b5ba3","unresolved":false,"context_lines":[{"line_number":750,"context_line":"                        raise exceptions.Invalid("},{"line_number":751,"context_line":"                            message\u003d\"Attempted to write beyond the expected \""},{"line_number":752,"context_line":"                                    \"image size of %s bytes.\" % image_size"},{"line_number":753,"context_line":"                        )"},{"line_number":754,"context_line":"                    bytes_written +\u003d len(buf)"},{"line_number":755,"context_line":"                    os_hash_value.update(buf)"},{"line_number":756,"context_line":"                    checksum.update(buf)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ff5c1886_b3782239","line":753,"in_reply_to":"077f2fed_a5447c51","updated":"2025-05-08 14:55:44.000000000","message":"Acknowledged","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"}],"glance_store/tests/unit/test_filesystem_store.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"695b8322ab565594ef55af1e9c55ae30165a12b5","unresolved":true,"context_lines":[{"line_number":152,"context_line":"        # expected total size"},{"line_number":153,"context_line":"        expected_file_size \u003d 1024"},{"line_number":154,"context_line":"        # simulate input with extra data"},{"line_number":155,"context_line":"        image_file \u003d io.BytesIO(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Call method and assert exception"},{"line_number":158,"context_line":"        self.assertRaises(exceptions.Invalid, self.store.add,"}],"source_content_type":"text/x-python","patch_set":3,"id":"73b5c010_0e3d0902","line":155,"updated":"2025-05-08 14:37:18.000000000","message":"Can you rearrange this to not have the size fall right on a chunk boundary? Also, this doesn\u0027t confirm that we stop in the middle of reading if we run over. If you use a buffer larger than the chunk size, you can use `.tell()` after the exception is raised to make sure it wasn\u0027t fully read.","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b0833101d6619484e1840f97791e48e2a4f2a85b","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        # expected total size"},{"line_number":153,"context_line":"        expected_file_size \u003d 1024"},{"line_number":154,"context_line":"        # simulate input with extra data"},{"line_number":155,"context_line":"        image_file \u003d io.BytesIO(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Call method and assert exception"},{"line_number":158,"context_line":"        self.assertRaises(exceptions.Invalid, self.store.add,"}],"source_content_type":"text/x-python","patch_set":3,"id":"00917c00_6d748767","line":155,"in_reply_to":"06ec7767_2427a517","updated":"2025-05-09 06:12:19.000000000","message":"Acknowledged","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b5cf815baf1fc56970fed533e75bc83d134b5ba3","unresolved":true,"context_lines":[{"line_number":152,"context_line":"        # expected total size"},{"line_number":153,"context_line":"        expected_file_size \u003d 1024"},{"line_number":154,"context_line":"        # simulate input with extra data"},{"line_number":155,"context_line":"        image_file \u003d io.BytesIO(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Call method and assert exception"},{"line_number":158,"context_line":"        self.assertRaises(exceptions.Invalid, self.store.add,"}],"source_content_type":"text/x-python","patch_set":3,"id":"f0690a5c_5dab8403","line":155,"in_reply_to":"73b5c010_0e3d0902","updated":"2025-05-08 14:55:44.000000000","message":"The chunk size here is 10, so I think this should be OK, wdyt?","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b25dd47529fa10f5d1a11312a000a5a6103ba634","unresolved":true,"context_lines":[{"line_number":152,"context_line":"        # expected total size"},{"line_number":153,"context_line":"        expected_file_size \u003d 1024"},{"line_number":154,"context_line":"        # simulate input with extra data"},{"line_number":155,"context_line":"        image_file \u003d io.BytesIO(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Call method and assert exception"},{"line_number":158,"context_line":"        self.assertRaises(exceptions.Invalid, self.store.add,"}],"source_content_type":"text/x-python","patch_set":3,"id":"06ec7767_2427a517","line":155,"in_reply_to":"f0690a5c_5dab8403","updated":"2025-05-08 16:34:10.000000000","message":"Isn\u0027t chunk size 1024, from L146?","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"695b8322ab565594ef55af1e9c55ae30165a12b5","unresolved":true,"context_lines":[{"line_number":160,"context_line":"                          expected_file_size, self.hash_algo)"},{"line_number":161,"context_line":"        # Verify partial data is deleted from backend"},{"line_number":162,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _do_test_add(self, enable_thin_provisoning):"},{"line_number":165,"context_line":"        \"\"\"Test that we can add an image via the filesystem backend.\"\"\""},{"line_number":166,"context_line":"        self.config(filesystem_store_chunk_size\u003dunits.Ki,"}],"source_content_type":"text/x-python","patch_set":3,"id":"820375f3_63413549","line":163,"updated":"2025-05-08 14:37:18.000000000","message":"Also need a test to confirm that if we write less it fails, right?","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b5cf815baf1fc56970fed533e75bc83d134b5ba3","unresolved":true,"context_lines":[{"line_number":160,"context_line":"                          expected_file_size, self.hash_algo)"},{"line_number":161,"context_line":"        # Verify partial data is deleted from backend"},{"line_number":162,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _do_test_add(self, enable_thin_provisoning):"},{"line_number":165,"context_line":"        \"\"\"Test that we can add an image via the filesystem backend.\"\"\""},{"line_number":166,"context_line":"        self.config(filesystem_store_chunk_size\u003dunits.Ki,"}],"source_content_type":"text/x-python","patch_set":3,"id":"e8b2905e_0088a2ba","line":163,"in_reply_to":"820375f3_63413549","updated":"2025-05-08 14:55:44.000000000","message":":D Yeah, I saw this comment coming.","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d53368a84859c1011414111655c0080398cfe345","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                          expected_file_size, self.hash_algo)"},{"line_number":161,"context_line":"        # Verify partial data is deleted from backend"},{"line_number":162,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _do_test_add(self, enable_thin_provisoning):"},{"line_number":165,"context_line":"        \"\"\"Test that we can add an image via the filesystem backend.\"\"\""},{"line_number":166,"context_line":"        self.config(filesystem_store_chunk_size\u003dunits.Ki,"}],"source_content_type":"text/x-python","patch_set":3,"id":"70bed9e6_12ab077b","line":163,"in_reply_to":"e8b2905e_0088a2ba","updated":"2025-05-09 06:12:44.000000000","message":"Done","commit_id":"6d08a74288f2a3e9e6854494c9f58c821bf9ecc5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dd0e8d2752f20f12bc5ca656fee47f29e3496142","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":159,"context_line":"        # The position should be less than total input size"},{"line_number":160,"context_line":"        total_input_size \u003d len(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":161,"context_line":"        assert image_file.tell() \u003c total_input_size, (\"Input stream was fully \""},{"line_number":162,"context_line":"                                                      \"read, but should not \""},{"line_number":163,"context_line":"                                                      \"have been.\")"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"d9e1f691_76c5cdba","line":161,"updated":"2025-05-12 14:13:29.000000000","message":"...\n\n`self.assertLess()` ?\n\nhttps://docs.python.org/3/library/unittest.html#unittest.TestCase.assertLess\n\nUsing a bare `assert` here is not a good idea. Was there some reason for that?\n\nBut also, can\u0027t you assert the actual result of `tell()` in this case (i.e. `assertEqual()`? If it was zero it would pass this test, but not be what we expect.","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2bd0038152be9e0346eea6b30fbf09c0d7477e65","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":159,"context_line":"        # The position should be less than total input size"},{"line_number":160,"context_line":"        total_input_size \u003d len(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":161,"context_line":"        assert image_file.tell() \u003c total_input_size, (\"Input stream was fully \""},{"line_number":162,"context_line":"                                                      \"read, but should not \""},{"line_number":163,"context_line":"                                                      \"have been.\")"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"a01d4556_792718c7","line":161,"in_reply_to":"402af077_8e14be02","updated":"2025-05-12 15:31:27.000000000","message":"Yeah, so .. you can `assertEqual()` right?","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6154df50ddda3bd9c8b37a4c502295c25c191956","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":159,"context_line":"        # The position should be less than total input size"},{"line_number":160,"context_line":"        total_input_size \u003d len(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":161,"context_line":"        assert image_file.tell() \u003c total_input_size, (\"Input stream was fully \""},{"line_number":162,"context_line":"                                                      \"read, but should not \""},{"line_number":163,"context_line":"                                                      \"have been.\")"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"53fa547a_b9c33d9f","line":161,"in_reply_to":"a01d4556_792718c7","updated":"2025-05-12 15:51:14.000000000","message":"Acknowledged","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e3d0abe9bb5e39ad3bb3a582e72474020c2a9dc2","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":159,"context_line":"        # The position should be less than total input size"},{"line_number":160,"context_line":"        total_input_size \u003d len(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":161,"context_line":"        assert image_file.tell() \u003c total_input_size, (\"Input stream was fully \""},{"line_number":162,"context_line":"                                                      \"read, but should not \""},{"line_number":163,"context_line":"                                                      \"have been.\")"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"402af077_8e14be02","line":161,"in_reply_to":"d9e1f691_76c5cdba","updated":"2025-05-12 15:17:11.000000000","message":"At this point image_file.tell() prints the size of data read which is 1040 here in this case, and that is why I am asserting that the data read here is less that what we are passing as input which is 1123 bytes.","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dd0e8d2752f20f12bc5ca656fee47f29e3496142","unresolved":true,"context_lines":[{"line_number":162,"context_line":"                                                      \"read, but should not \""},{"line_number":163,"context_line":"                                                      \"have been.\")"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def test_write_beyond_image_down_size_raises_exception(self):"},{"line_number":166,"context_line":"        # Setup"},{"line_number":167,"context_line":"        expected_image_id \u003d str(uuid.uuid4())"},{"line_number":168,"context_line":"        path \u003d os.path.join(self.test_dir, expected_image_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"eb234b6b_445f1adb","line":165,"range":{"start_line":165,"start_character":19,"end_line":165,"end_character":26},"updated":"2025-05-12 14:13:29.000000000","message":"\"beyond\" doesn\u0027t make sense here I don\u0027t think, and I\u0027m not sure \"down size\" does either. Perhaps `test_write_less_than_declared()` or something?","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6154df50ddda3bd9c8b37a4c502295c25c191956","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                                                      \"read, but should not \""},{"line_number":163,"context_line":"                                                      \"have been.\")"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def test_write_beyond_image_down_size_raises_exception(self):"},{"line_number":166,"context_line":"        # Setup"},{"line_number":167,"context_line":"        expected_image_id \u003d str(uuid.uuid4())"},{"line_number":168,"context_line":"        path \u003d os.path.join(self.test_dir, expected_image_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"596b40de_34a14966","line":165,"range":{"start_line":165,"start_character":19,"end_line":165,"end_character":26},"in_reply_to":"eb234b6b_445f1adb","updated":"2025-05-12 15:51:14.000000000","message":"Done","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dd0e8d2752f20f12bc5ca656fee47f29e3496142","unresolved":true,"context_lines":[{"line_number":180,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":181,"context_line":"        # The input buffer should be fully read or partially read"},{"line_number":182,"context_line":"        # depending on implementation"},{"line_number":183,"context_line":"        assert image_file.tell() \u003c\u003d actual_data_size, (\"Input stream was not \""},{"line_number":184,"context_line":"                                                       \"fully read as \""},{"line_number":185,"context_line":"                                                       \"expected.\")"},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"b3a9de9e_c194ffbf","line":183,"updated":"2025-05-12 14:13:29.000000000","message":"This also seems wrong. It should *not* be less than `actual_data_size` or something else is broken...","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6154df50ddda3bd9c8b37a4c502295c25c191956","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":181,"context_line":"        # The input buffer should be fully read or partially read"},{"line_number":182,"context_line":"        # depending on implementation"},{"line_number":183,"context_line":"        assert image_file.tell() \u003c\u003d actual_data_size, (\"Input stream was not \""},{"line_number":184,"context_line":"                                                       \"fully read as \""},{"line_number":185,"context_line":"                                                       \"expected.\")"},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ff4c7f19_902279e0","line":183,"in_reply_to":"0d560a4f_b0ebf14e","updated":"2025-05-12 15:51:14.000000000","message":"Done","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e3d0abe9bb5e39ad3bb3a582e72474020c2a9dc2","unresolved":true,"context_lines":[{"line_number":180,"context_line":"        self.assertFalse(os.path.exists(path))"},{"line_number":181,"context_line":"        # The input buffer should be fully read or partially read"},{"line_number":182,"context_line":"        # depending on implementation"},{"line_number":183,"context_line":"        assert image_file.tell() \u003c\u003d actual_data_size, (\"Input stream was not \""},{"line_number":184,"context_line":"                                                       \"fully read as \""},{"line_number":185,"context_line":"                                                       \"expected.\")"},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"0d560a4f_b0ebf14e","line":183,"in_reply_to":"b3a9de9e_c194ffbf","updated":"2025-05-12 15:17:11.000000000","message":"Here I can check with assertEqual rather that LessThanEqual which will be correct imo.","commit_id":"9267eeab94a29848c4a21c2a4f7b237f2af62f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c824cd1be95050a9dca4a4f95f786cff8f91cf04","unresolved":true,"context_lines":[{"line_number":149,"context_line":"        expected_file_size \u003d 1020"},{"line_number":150,"context_line":"        # simulate input with extra data"},{"line_number":151,"context_line":"        image_file \u003d io.BytesIO(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":152,"context_line":"        print(image_file.tell())"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # Call method and assert exception"},{"line_number":155,"context_line":"        self.assertRaises(exceptions.Invalid, self.store.add,"}],"source_content_type":"text/x-python","patch_set":6,"id":"f4dc7314_e2542d00","line":152,"updated":"2025-05-13 13:58:58.000000000","message":"Leftover debug `print`?","commit_id":"b676897c1324c60211d63be05ebe438674848721"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a419f084990f34abcf41e86ba4a4ce38bfdc7001","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        expected_file_size \u003d 1020"},{"line_number":150,"context_line":"        # simulate input with extra data"},{"line_number":151,"context_line":"        image_file \u003d io.BytesIO(b\u0027a\u0027 * (expected_file_size + 100))"},{"line_number":152,"context_line":"        print(image_file.tell())"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # Call method and assert exception"},{"line_number":155,"context_line":"        self.assertRaises(exceptions.Invalid, self.store.add,"}],"source_content_type":"text/x-python","patch_set":6,"id":"549272c9_d70954dc","line":152,"in_reply_to":"f4dc7314_e2542d00","updated":"2025-05-13 14:09:33.000000000","message":":/, yeah","commit_id":"b676897c1324c60211d63be05ebe438674848721"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c824cd1be95050a9dca4a4f95f786cff8f91cf04","unresolved":true,"context_lines":[{"line_number":163,"context_line":"        # size read."},{"line_number":164,"context_line":"        actual_read_size \u003d image_file.tell()"},{"line_number":165,"context_line":"        expected_read \u003d expected_file_size + self.store.WRITE_CHUNKSIZE"},{"line_number":166,"context_line":"        self.assertEqual(actual_read_size, expected_read,"},{"line_number":167,"context_line":"                         \"The stream was not read only up to the expected \""},{"line_number":168,"context_line":"                         \"size.\")"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"71bf56a8_54b40554","line":166,"updated":"2025-05-13 13:58:58.000000000","message":"I think this is backwards. In testtools\u0027 `assertEqual`, the expected value comes before the tested value, otherwise the fail message is confusing:\n\nhttps://testtools.readthedocs.io/en/latest/api.html#testtools.TestCase.assertEqual\n\nAnyway, that\u0027s just a nit, but checking a few others in this file on either side of this change confirms they follow the same convention.","commit_id":"b676897c1324c60211d63be05ebe438674848721"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a419f084990f34abcf41e86ba4a4ce38bfdc7001","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        # size read."},{"line_number":164,"context_line":"        actual_read_size \u003d image_file.tell()"},{"line_number":165,"context_line":"        expected_read \u003d expected_file_size + self.store.WRITE_CHUNKSIZE"},{"line_number":166,"context_line":"        self.assertEqual(actual_read_size, expected_read,"},{"line_number":167,"context_line":"                         \"The stream was not read only up to the expected \""},{"line_number":168,"context_line":"                         \"size.\")"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"32e6c6e5_f25b8357","line":166,"in_reply_to":"71bf56a8_54b40554","updated":"2025-05-13 14:09:33.000000000","message":"Ack, will correct it here!","commit_id":"b676897c1324c60211d63be05ebe438674848721"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"92cee5819ef94dc7393ebd1571fcd9a911da6b2c","unresolved":true,"context_lines":[{"line_number":155,"context_line":"            self.store.add(expected_image_id, image_file,"},{"line_number":156,"context_line":"                           expected_file_size, self.hash_algo)"},{"line_number":157,"context_line":"        except exceptions.Invalid as e:"},{"line_number":158,"context_line":"            self.assertIn(\"Size exceeds: expected\", str(e))"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        # Verify partial data is deleted from backend"},{"line_number":161,"context_line":"        self.assertFalse(os.path.exists(path))"}],"source_content_type":"text/x-python","patch_set":11,"id":"969797f5_a1ab8f80","line":158,"updated":"2025-06-30 14:43:47.000000000","message":"This needs to be fixed to `assertRaisesRegex()`, in all its forms in this file and the others.","commit_id":"08b47fed9af6d99ff7936bb39b98d1be22e322ed"}]}
