)]}'
{"glance/api/v2/policy.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"7bad422dcd3c11e111f7373fd976ed15649dbe86","unresolved":true,"context_lines":[{"line_number":112,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def manage_image_cache(self):"},{"line_number":115,"context_line":"        self._enforce(\u0027manage_image_cache\u0027)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"class ImageAPIPolicy(APIPolicyBase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"e462303c_382a4e83","line":115,"range":{"start_line":115,"start_character":23,"end_line":115,"end_character":41},"updated":"2021-08-24 14:15:12.000000000","message":"Do we ever anticipate breaking this into separate policies to allow for more granularity?\n\n  get_cached_images\n  delete_cached_images","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ba289f8e6996109441a500da0d7e885b8cd6804f","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def manage_image_cache(self):"},{"line_number":115,"context_line":"        self._enforce(\u0027manage_image_cache\u0027)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"class ImageAPIPolicy(APIPolicyBase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1ec190_69c9208b","line":115,"range":{"start_line":115,"start_character":23,"end_line":115,"end_character":41},"in_reply_to":"8224001d_496608c2","updated":"2021-08-24 15:41:24.000000000","message":"Ack","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"cdab2477a5e50bcb1cf588b3d36052e557498d56","unresolved":true,"context_lines":[{"line_number":112,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def manage_image_cache(self):"},{"line_number":115,"context_line":"        self._enforce(\u0027manage_image_cache\u0027)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"class ImageAPIPolicy(APIPolicyBase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"8224001d_496608c2","line":115,"range":{"start_line":115,"start_character":23,"end_line":115,"end_character":41},"in_reply_to":"e462303c_382a4e83","updated":"2021-08-24 14:53:01.000000000","message":"We are moving cache API under glance api and at that time we are going to introduce some new policies for the same.\n\nCurrently work is under progress but I doubt we will be able to complete it in this cycle.\nhttps://review.opendev.org/c/openstack/glance-specs/+/665258\nhttps://review.opendev.org/c/openstack/glance/+/792022","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"}],"glance/image_cache/prefetcher.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b17c9fbee0a3c701164758bd31f72056ce38b20b","unresolved":true,"context_lines":[{"line_number":43,"context_line":"        ctx \u003d context.RequestContext(is_admin\u003dTrue, show_deleted\u003dTrue)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            image_repo \u003d self.gateway.get_repo(ctx, authorization_layer\u003dFalse)"},{"line_number":47,"context_line":"            image \u003d image_repo.get(image_id)"},{"line_number":48,"context_line":"        except exception.NotFound:"},{"line_number":49,"context_line":"            LOG.warning(_LW(\"Image \u0027%s\u0027 not found\"), image_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"150f55c1_4e7ba7c2","line":46,"updated":"2021-08-25 18:55:57.000000000","message":"I don\u0027t doubt that this is the right thing to do, but to be clear: it doesn\u0027t matter right? We\u0027re always running with a hard-coded admin context, so this is just for consistency right? It doesn\u0027t look like there\u0027s any test in this patch to make sure this is happening...","commit_id":"a679a4e7d93d11cad3305f1910eb434bd653da3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"01450263d42dc12f2870c9a183df6971c8246ecc","unresolved":true,"context_lines":[{"line_number":43,"context_line":"        ctx \u003d context.RequestContext(is_admin\u003dTrue, show_deleted\u003dTrue)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            image_repo \u003d self.gateway.get_repo(ctx, authorization_layer\u003dFalse)"},{"line_number":47,"context_line":"            image \u003d image_repo.get(image_id)"},{"line_number":48,"context_line":"        except exception.NotFound:"},{"line_number":49,"context_line":"            LOG.warning(_LW(\"Image \u0027%s\u0027 not found\"), image_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7ecbdf7b_1ae6f60e","line":46,"in_reply_to":"0002a12b_765a147b","updated":"2021-08-25 19:08:04.000000000","message":"Is it hard to write a test to validate it at least?","commit_id":"a679a4e7d93d11cad3305f1910eb434bd653da3d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"f6ebd57edc899dd30ce942839733fc3ab173c63e","unresolved":true,"context_lines":[{"line_number":43,"context_line":"        ctx \u003d context.RequestContext(is_admin\u003dTrue, show_deleted\u003dTrue)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            image_repo \u003d self.gateway.get_repo(ctx, authorization_layer\u003dFalse)"},{"line_number":47,"context_line":"            image \u003d image_repo.get(image_id)"},{"line_number":48,"context_line":"        except exception.NotFound:"},{"line_number":49,"context_line":"            LOG.warning(_LW(\"Image \u0027%s\u0027 not found\"), image_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"0002a12b_765a147b","line":46,"in_reply_to":"150f55c1_4e7ba7c2","updated":"2021-08-25 19:04:18.000000000","message":"Right, its just for consistency purpose .","commit_id":"a679a4e7d93d11cad3305f1910eb434bd653da3d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b5e0e009c0bb30897e57782d390d11909e8537e4","unresolved":true,"context_lines":[{"line_number":43,"context_line":"        ctx \u003d context.RequestContext(is_admin\u003dTrue, show_deleted\u003dTrue)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            image_repo \u003d self.gateway.get_repo(ctx, authorization_layer\u003dFalse)"},{"line_number":47,"context_line":"            image \u003d image_repo.get(image_id)"},{"line_number":48,"context_line":"        except exception.NotFound:"},{"line_number":49,"context_line":"            LOG.warning(_LW(\"Image \u0027%s\u0027 not found\"), image_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7c2f6a2c_32f4db83","line":46,"in_reply_to":"7ecbdf7b_1ae6f60e","updated":"2021-08-25 19:20:09.000000000","message":"Let me try to write one.\nI will post a new PS tomorrow with the test.","commit_id":"a679a4e7d93d11cad3305f1910eb434bd653da3d"}],"glance/tests/functional/v2/test_cache_api_policy.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"7bad422dcd3c11e111f7373fd976ed15649dbe86","unresolved":true,"context_lines":[{"line_number":37,"context_line":"            mock_enf.return_value \u003d self.policy"},{"line_number":38,"context_line":"            super(TestCacheImagesPolicy, self).start_server(enable_cache\u003dTrue)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _create_upload_and_cahce(self, cache_image\u003dFalse,"},{"line_number":41,"context_line":"                                 expected_code\u003d200):"},{"line_number":42,"context_line":"        image_id \u003d self._create_and_upload()"},{"line_number":43,"context_line":"        # Queue image for caching"}],"source_content_type":"text/x-python","patch_set":2,"id":"03a357a4_edfc4b12","line":40,"range":{"start_line":40,"start_character":27,"end_line":40,"end_character":32},"updated":"2021-08-24 14:15:12.000000000","message":"cache*","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"cdab2477a5e50bcb1cf588b3d36052e557498d56","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            mock_enf.return_value \u003d self.policy"},{"line_number":38,"context_line":"            super(TestCacheImagesPolicy, self).start_server(enable_cache\u003dTrue)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _create_upload_and_cahce(self, cache_image\u003dFalse,"},{"line_number":41,"context_line":"                                 expected_code\u003d200):"},{"line_number":42,"context_line":"        image_id \u003d self._create_and_upload()"},{"line_number":43,"context_line":"        # Queue image for caching"}],"source_content_type":"text/x-python","patch_set":2,"id":"fbf80758_526114ba","line":40,"range":{"start_line":40,"start_character":27,"end_line":40,"end_character":32},"in_reply_to":"03a357a4_edfc4b12","updated":"2021-08-24 14:53:01.000000000","message":"Ack","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"7bad422dcd3c11e111f7373fd976ed15649dbe86","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        # Create another image while you can"},{"line_number":124,"context_line":"        self._create_upload_and_cahce()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # make sure you are able to delete queued image"},{"line_number":127,"context_line":"        path \u003d \u0027/v2/queued_images\u0027"},{"line_number":128,"context_line":"        response \u003d self.api_delete(path)"},{"line_number":129,"context_line":"        self.assertEqual(200, response.status_code)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a8d80b7_ba5b76a3","line":126,"updated":"2021-08-24 14:15:12.000000000","message":"This is a naive question, but is there a timing relationship between a queued image and when we delete it from the queue?\n\nFor example, when an image goes into the queue is it automatically removed from the queue after it\u0027s cached?\n\nMy concern here (if it\u0027s even possible) is that this could introduce transient issues in the tests if the queued image is gone by the time we hit line 126. Again, I have no idea if that\u0027s even possible, but I wanted to ask for my own knowledge anyway.","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"cdab2477a5e50bcb1cf588b3d36052e557498d56","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        # Create another image while you can"},{"line_number":124,"context_line":"        self._create_upload_and_cahce()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # make sure you are able to delete queued image"},{"line_number":127,"context_line":"        path \u003d \u0027/v2/queued_images\u0027"},{"line_number":128,"context_line":"        response \u003d self.api_delete(path)"},{"line_number":129,"context_line":"        self.assertEqual(200, response.status_code)"}],"source_content_type":"text/x-python","patch_set":2,"id":"c513e68f_614fc1cb","line":126,"in_reply_to":"7a8d80b7_ba5b76a3","updated":"2021-08-24 14:53:01.000000000","message":"In this test we are not caching the image, so it will remain in queued area until we delete it.\n\nOur prefetcher periodic job periodically traverse through this queued folder and picks the image for caching and caches it. As soon as image is picked it is removed from the queued area.\n\nThere are some operations in cache middleware which first checks if image is already cached or is it is in process of caching etc.,\n\n[1] https://github.com/openstack/glance/blob/master/glance/image_cache/drivers/sqlite.py#L211","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ba289f8e6996109441a500da0d7e885b8cd6804f","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        # Create another image while you can"},{"line_number":124,"context_line":"        self._create_upload_and_cahce()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # make sure you are able to delete queued image"},{"line_number":127,"context_line":"        path \u003d \u0027/v2/queued_images\u0027"},{"line_number":128,"context_line":"        response \u003d self.api_delete(path)"},{"line_number":129,"context_line":"        self.assertEqual(200, response.status_code)"}],"source_content_type":"text/x-python","patch_set":2,"id":"8a1c83e8_edbc6323","line":126,"in_reply_to":"c513e68f_614fc1cb","updated":"2021-08-24 15:41:24.000000000","message":"Ok - so it doesn\u0027t sound like there is an opportunity for transient issues. Thanks.","commit_id":"e4797d46cda8fd6864782a00d109d8903b1356ed"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"17e767d546c84147c014c1794fd359cb00242db5","unresolved":true,"context_lines":[{"line_number":185,"context_line":"        # make sure you are able to delete cached image"},{"line_number":186,"context_line":"        path \u003d \u0027/v2/cached_images/%s\u0027 % image_id"},{"line_number":187,"context_line":"        response \u003d self.api_delete(path)"},{"line_number":188,"context_line":"        self.assertEqual(200, response.status_code)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # verify image is deleted from cached list"},{"line_number":191,"context_line":"        path \u003d \u0027/v2/cached_images\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"7163a9db_8c5dd923","line":188,"range":{"start_line":188,"start_character":25,"end_line":188,"end_character":28},"updated":"2021-08-30 15:16:47.000000000","message":"Probably unrelated to this patch, but this returns a 200 not a 204?","commit_id":"ea13046919988c0bf2a016f70b4d0d249728c342"}]}
