)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"292e210e6833830f256d8b0bfd5e5916ed7f0775","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"5ea915a1_a34d0ba1","updated":"2022-01-04 08:18:39.000000000","message":"Still need to work on functional review comments.","commit_id":"cf11f9469948390830655422e24c4411c535db1f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"de361f5718cee64ceeb7d4572de0d297a065bd78","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"fcc6ea3d_4967d1a0","updated":"2022-01-13 17:08:17.000000000","message":"I definitely want to see the tempest stuff before signing off on this fully. A couple policy-related recommendations inline for now.","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2a9eee713ba4288434cff441a20235fe2518d1d6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"addc58fa_87c19562","updated":"2022-01-24 14:41:32.000000000","message":"I feel pretty strongly that we should be validating the image during queue, for a formal API - as mentioned inline.","commit_id":"d4f943ff76d916802474e99fa32c2062414b62ed"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"7f9d8207_35449d02","updated":"2022-01-26 16:29:28.000000000","message":"I think this is much better-behaved and a lot more like a real API, so thanks for making those changes. A couple concerns inline about the delete lifecycle, but I think this is getting close, thanks Abhi!","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b053a822c2b54bcc2aa508b91a96a7489eb66e55","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"76c85ce3_36f21dab","updated":"2022-01-31 16:16:27.000000000","message":"A couple typos (I think) in the tests, but I think this is pretty much good to go","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"a462b4ad_d0ea81f1","updated":"2022-02-01 05:56:16.000000000","message":"Thank you for review, I have added release note as well.","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"45457e22048bd8d74281b64c846dbadfe8b6c22d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"0d7d8f88_f24d9819","updated":"2022-01-31 16:23:44.000000000","message":"Will push a new patch set soon with client side changes.\nTempest test now ensure that we can cache the image on remote node as well.\n\nThank you for all the inputs. ","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"963b23b23718a59d124b7206874a4508d34de3d5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"fed6201c_1bac9f0c","updated":"2022-02-02 16:48:37.000000000","message":"Thank you for review, made corrections.","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a57a5e09f5335a6fe0ad5ee14d2e2a6fea132b32","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"283d7d4a_6409d5a9","updated":"2022-02-02 16:37:27.000000000","message":"Typos in the reno, but I\u0027m good after that!","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55a4a9f40522129b90930319bc1411dd3a8b7c9a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"8e4045da_49825d67","updated":"2022-02-09 17:58:03.000000000","message":"Looks okay to me, except I think the reno removal was probably unintentional...","commit_id":"fa52a1a72bf64f76c2f29eb796d0c6ee416c4ef1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ec51fcd968a349ccf8364f7d597287bc69b16d6e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"93698673_f69929ae","updated":"2022-02-09 18:09:25.000000000","message":"Thank you for closer look, will push a PS in a moment.","commit_id":"fa52a1a72bf64f76c2f29eb796d0c6ee416c4ef1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d517559092bb4b180830d5dbaf569081bea91d80","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"55ec11e0_e8fcb648","updated":"2022-02-08 15:13:35.000000000","message":"recheck cinder issue","commit_id":"fa52a1a72bf64f76c2f29eb796d0c6ee416c4ef1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5fef8146573612f4760dd196fa3314932ffff480","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"20679796_e04b9503","updated":"2022-02-08 08:32:40.000000000","message":"recheck ssh connection timeout","commit_id":"fa52a1a72bf64f76c2f29eb796d0c6ee416c4ef1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e79f4ef022ad3e9a504c8dfdb1f24b92dc8bd03c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"772730fb_6d709edd","updated":"2022-02-09 18:19:16.000000000","message":"Thanks!","commit_id":"f28676ace38cb4e771578e89420843d5e98951d7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a087fdb3540493eea13f232dd58cb4adc86087f6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"02463b52_81963a6c","updated":"2022-02-14 05:21:57.000000000","message":"recheck","commit_id":"f28676ace38cb4e771578e89420843d5e98951d7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c0e9c8979fe1531e8b6356afb0d8ec823c46e2f8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"869a7872_f2ecf248","updated":"2022-02-10 13:17:57.000000000","message":"recheck cinder failure","commit_id":"f28676ace38cb4e771578e89420843d5e98951d7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"82006c323e3ccc088fd8ae2c3c9428471e5df08e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"94ad7324_29a527b8","updated":"2022-02-10 16:38:32.000000000","message":"recheck cinder fips job failure","commit_id":"f28676ace38cb4e771578e89420843d5e98951d7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"52f7964cfaab48565cea01f3bad669e496b91f6b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"d2fd136d_5f5c3900","updated":"2022-02-10 19:11:45.000000000","message":"recheck fips job failure","commit_id":"f28676ace38cb4e771578e89420843d5e98951d7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"14e6366583e928a39a2f3583985267f7a32a4ed5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"964ee8df_4a88a4d9","updated":"2022-02-14 07:04:54.000000000","message":"recheck post failure","commit_id":"f28676ace38cb4e771578e89420843d5e98951d7"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"b717241375267cc48876b05df9a6e9f56d007f09","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":25,"id":"9cfe834f_cc2afa19","updated":"2022-02-14 14:38:03.000000000","message":"Nitpicking a bit, but I\u0027m not against merging this as is.","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a1974f1b024f28d385fce9f9da40ba20355ac5c7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":25,"id":"063a6b11_5936e9eb","updated":"2022-02-14 15:18:23.000000000","message":"Thank you Cyril for inputs, made changes as per your suggestion.\n","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"557b2ac93bb430d25f8bedcb735d6fc498c14186","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":26,"id":"158b3e6e_80eb6bd7","updated":"2022-02-14 19:25:41.000000000","message":"Thanks for addressing my comments.","commit_id":"87eae327bf66a8e6fb7e7b72da9a4e62eee65702"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d629ab771aafbb64707590c566615b58d1317c56","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":26,"id":"506dd77e_5a5dc5d7","updated":"2022-02-14 16:58:38.000000000","message":"recheck cinder failure","commit_id":"87eae327bf66a8e6fb7e7b72da9a4e62eee65702"}],"api-ref/source/v2/cache-manage.inc":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c8aa32aeb0443589bc0c93030891ad8cd1f9c3d3","unresolved":true,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":".. rest_method::  GET /v2/cache/"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Lists al images in cache or queue."},{"line_number":15,"context_line":"*(Since Image API v2.13)*"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Normal response codes: 200"}],"source_content_type":"text/x-c++src","patch_set":7,"id":"c1e75c79_a23ac210","line":14,"range":{"start_line":14,"start_character":6,"end_line":14,"end_character":8},"updated":"2021-08-04 20:36:04.000000000","message":"all","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":".. rest_method::  GET /v2/cache/"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Lists al images in cache or queue."},{"line_number":15,"context_line":"*(Since Image API v2.13)*"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Normal response codes: 200"}],"source_content_type":"text/x-c++src","patch_set":7,"id":"434a73b3_26749255","line":14,"range":{"start_line":14,"start_character":6,"end_line":14,"end_character":8},"in_reply_to":"c1e75c79_a23ac210","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c8aa32aeb0443589bc0c93030891ad8cd1f9c3d3","unresolved":true,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Normal response codes: 204"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Error response codes: 400, 401, 403"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Request"}],"source_content_type":"text/x-c++src","patch_set":7,"id":"c261dfb5_706af026","line":57,"updated":"2021-08-04 20:36:04.000000000","message":"404 ?","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"58346a78a49a0f86a1474606f6495cca5566c468","unresolved":true,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Normal response codes: 204"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Error response codes: 400, 401, 403"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Request"}],"source_content_type":"text/x-c++src","patch_set":7,"id":"efaaa7db_1583baab","line":57,"in_reply_to":"c261dfb5_706af026","updated":"2021-08-05 10:57:07.000000000","message":"I\u0027m pretty sure we will return success regardless if the image was in the cache or not regardless even if it exists.","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Normal response codes: 204"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Error response codes: 400, 401, 403"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Request"}],"source_content_type":"text/x-c++src","patch_set":7,"id":"c17f415d_9b153b68","line":57,"in_reply_to":"efaaa7db_1583baab","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c8aa32aeb0443589bc0c93030891ad8cd1f9c3d3","unresolved":true,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"Request"},{"line_number":80,"context_line":"-------"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"No request parameters."}],"source_content_type":"text/x-c++src","patch_set":7,"id":"1170b84f_ef583f00","line":81,"updated":"2021-08-04 20:36:04.000000000","message":"I think somewhere we are passing header, so that should reflect here.","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"Request"},{"line_number":80,"context_line":"-------"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"No request parameters."}],"source_content_type":"text/x-c++src","patch_set":7,"id":"cce94831_2ef0bbb4","line":81,"in_reply_to":"1170b84f_ef583f00","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"e0b172915a38dbd28d3adb7001864b5e7d456767","unresolved":true,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":".. rest_method::  GET /v2/cache/"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Lists al images in cache or queue."},{"line_number":15,"context_line":"*(Since Image API v2.13)*"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Normal response codes: 200"}],"source_content_type":"text/x-c++src","patch_set":9,"id":"6f039696_6c185b81","line":14,"range":{"start_line":14,"start_character":6,"end_line":14,"end_character":8},"updated":"2021-08-10 13:14:45.000000000","message":"just reminder for which of us posts next iteration that the typo is still here.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":".. rest_method::  GET /v2/cache/"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Lists al images in cache or queue."},{"line_number":15,"context_line":"*(Since Image API v2.13)*"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Normal response codes: 200"}],"source_content_type":"text/x-c++src","patch_set":9,"id":"06b1dfe0_3baa9b4f","line":14,"range":{"start_line":14,"start_character":6,"end_line":14,"end_character":8},"in_reply_to":"42debea4_25b0ccc0","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1bfd82b6ab231beebd67dd514315e05baeef32a4","unresolved":true,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":".. rest_method::  GET /v2/cache/"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Lists al images in cache or queue."},{"line_number":15,"context_line":"*(Since Image API v2.13)*"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Normal response codes: 200"}],"source_content_type":"text/x-c++src","patch_set":9,"id":"42debea4_25b0ccc0","line":14,"range":{"start_line":14,"start_character":6,"end_line":14,"end_character":8},"in_reply_to":"6f039696_6c185b81","updated":"2021-08-10 14:27:25.000000000","message":"Yes, we need to add header information as well.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"48e7ebaff591e31791b850ffe81a3bc77f6ab5a0","unresolved":true,"context_lines":[{"line_number":1,"context_line":".. -*- rst -*-"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Cache Manage"},{"line_number":4,"context_line":"************"},{"line_number":5,"context_line":""}],"source_content_type":"text/x-c++src","patch_set":10,"id":"68ee06d4_de3c70c0","line":2,"updated":"2021-08-25 08:51:23.000000000","message":"I think we are still missing header information here.","commit_id":"649fbfe0f17991239f78d9f59025a0a0b5886c94"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":1,"context_line":".. -*- rst -*-"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Cache Manage"},{"line_number":4,"context_line":"************"},{"line_number":5,"context_line":""}],"source_content_type":"text/x-c++src","patch_set":10,"id":"66eeabff_811e4a85","line":2,"in_reply_to":"68ee06d4_de3c70c0","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"649fbfe0f17991239f78d9f59025a0a0b5886c94"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":1,"context_line":".. -*- rst -*-"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Cache Manage"},{"line_number":4,"context_line":"************"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"List and manage the cache."}],"source_content_type":"text/x-c++src","patch_set":12,"id":"e15c3092_8007b61f","line":3,"updated":"2021-08-26 15:25:18.000000000","message":"I don\u0027t seen that this is actually being included in the api reference as rendered. Do we need to include this file from another?","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":1,"context_line":".. -*- rst -*-"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Cache Manage"},{"line_number":4,"context_line":"************"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"List and manage the cache."}],"source_content_type":"text/x-c++src","patch_set":12,"id":"a91fa67d_061449c8","line":3,"in_reply_to":"170f686e_bd20ba12","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"177583904ffa095f31249845aaa4485f148897c5","unresolved":true,"context_lines":[{"line_number":1,"context_line":".. -*- rst -*-"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Cache Manage"},{"line_number":4,"context_line":"************"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"List and manage the cache."}],"source_content_type":"text/x-c++src","patch_set":12,"id":"e8acb42c_70cbdbb4","line":3,"in_reply_to":"e15c3092_8007b61f","updated":"2021-08-27 13:21:21.000000000","message":"yup, didn\u0027t realize the includes in the v2/index.rst were manual","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":1,"context_line":".. -*- rst -*-"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Cache Manage"},{"line_number":4,"context_line":"************"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"List and manage the cache."}],"source_content_type":"text/x-c++src","patch_set":12,"id":"170f686e_bd20ba12","line":3,"in_reply_to":"e8acb42c_70cbdbb4","updated":"2021-08-27 14:13:04.000000000","message":"Also we are missing header information \u0027x-image-cache-clear-target\u0027\n\nApart from this we need some documentation to explain about passing endpoint to each command if we are running multiple glance services.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"b717241375267cc48876b05df9a6e9f56d007f09","unresolved":true,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":".. rest_method::  DELETE /v2/cache/"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"Clears the cache and it\u0027s queue."},{"line_number":72,"context_line":"*(Since Image API v2.13)*"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Normal response codes: 204"}],"source_content_type":"text/x-c++src","patch_set":25,"id":"17183161_9f36e5b1","line":71,"updated":"2022-02-14 14:38:03.000000000","message":"its*","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a1974f1b024f28d385fce9f9da40ba20355ac5c7","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":".. rest_method::  DELETE /v2/cache/"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"Clears the cache and it\u0027s queue."},{"line_number":72,"context_line":"*(Since Image API v2.13)*"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Normal response codes: 204"}],"source_content_type":"text/x-c++src","patch_set":25,"id":"0edf5fe1_e837f984","line":71,"in_reply_to":"17183161_9f36e5b1","updated":"2022-02-14 15:18:23.000000000","message":"Ack","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"}],"glance/api/v2/cached_images.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"728081892f38f8c953acb1e9e6692292431b8b1e","unresolved":true,"context_lines":[{"line_number":129,"context_line":"        Removes all images from cache and queue."},{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self._enforce(req)"},{"line_number":132,"context_line":"        return dict(cache_deleted\u003dself.cache.delete_all_cached_images,"},{"line_number":133,"context_line":"                    queue_deleted\u003dself.cache.delete_all_queued_images)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_cache_state(self, req):"},{"line_number":136,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"e5157efe_a3195f7d","line":133,"range":{"start_line":132,"start_character":8,"end_line":133,"end_character":70},"updated":"2021-05-20 05:43:11.000000000","message":"Also this call is not working as you are just passing reference and not actually calling the functions here.\n\nThis is what this API call returns /image/v2/cache\n{\"cache_deleted\": \"\u003cbound method ImageCache.delete_all_cached_images of \u003cglance.image_cache.ImageCache object at 0x7f9cd5b9bef0\u003e\u003e\", \"queue_deleted\": \"\u003cbound method ImageCache.delete_all_queued_images of \u003cglance.image_cache.ImageCache object at 0x7f9cd5b9bef0\u003e\u003e\"}","commit_id":"40cdcbc5074b1814c40df23ad1be46ceb2606593"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"73bedc9043c3dd42e61904b01558c0a87112de9a","unresolved":true,"context_lines":[{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self._enforce(req)"},{"line_number":132,"context_line":"        return dict(cache_deleted\u003dself.cache.delete_all_cached_images,"},{"line_number":133,"context_line":"                    queue_deleted\u003dself.cache.delete_all_queued_images)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_cache_state(self, req):"},{"line_number":136,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"2024bdc9_78e27541","line":133,"range":{"start_line":133,"start_character":34,"end_line":133,"end_character":69},"updated":"2021-05-20 05:39:45.000000000","message":"What if this call is hit but at the same time we have operation in progress to prefetch the image into cache?","commit_id":"40cdcbc5074b1814c40df23ad1be46ceb2606593"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"39570fc28f3b180a50a1eccf9bdb4b9f551f897d","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self._enforce(req)"},{"line_number":132,"context_line":"        return dict(cache_deleted\u003dself.cache.delete_all_cached_images,"},{"line_number":133,"context_line":"                    queue_deleted\u003dself.cache.delete_all_queued_images)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_cache_state(self, req):"},{"line_number":136,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"e077238e_f9716b60","line":133,"range":{"start_line":133,"start_character":34,"end_line":133,"end_character":69},"in_reply_to":"2024bdc9_78e27541","updated":"2022-01-27 05:47:24.000000000","message":"Done","commit_id":"40cdcbc5074b1814c40df23ad1be46ceb2606593"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"39570fc28f3b180a50a1eccf9bdb4b9f551f897d","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        Removes all images from cache and queue."},{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self._enforce(req)"},{"line_number":132,"context_line":"        return dict(cache_deleted\u003dself.cache.delete_all_cached_images,"},{"line_number":133,"context_line":"                    queue_deleted\u003dself.cache.delete_all_queued_images)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_cache_state(self, req):"},{"line_number":136,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"06a92feb_f021b920","line":133,"range":{"start_line":132,"start_character":8,"end_line":133,"end_character":70},"in_reply_to":"4c052697_98d0a3fe","updated":"2022-01-27 05:47:24.000000000","message":"Done","commit_id":"40cdcbc5074b1814c40df23ad1be46ceb2606593"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"1ac714460803df90ca20520049951399f9288582","unresolved":true,"context_lines":[{"line_number":129,"context_line":"        Removes all images from cache and queue."},{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self._enforce(req)"},{"line_number":132,"context_line":"        return dict(cache_deleted\u003dself.cache.delete_all_cached_images,"},{"line_number":133,"context_line":"                    queue_deleted\u003dself.cache.delete_all_queued_images)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_cache_state(self, req):"},{"line_number":136,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"4c052697_98d0a3fe","line":133,"range":{"start_line":132,"start_character":8,"end_line":133,"end_character":70},"in_reply_to":"e5157efe_a3195f7d","updated":"2021-07-06 09:46:18.000000000","message":"oops, my bad.","commit_id":"40cdcbc5074b1814c40df23ad1be46ceb2606593"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"891bd7d7d34a484f0f9203131f9b3b00f96c46af","unresolved":true,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def _enforce(self, req, new_policy\u003dNone):"},{"line_number":42,"context_line":"        \"\"\"Authorize request against \u0027manage_image_cache\u0027 policy\"\"\""},{"line_number":43,"context_line":"        if new_policy:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                self.policy.enforce(req.context, new_policy, {})"},{"line_number":46,"context_line":"                return"},{"line_number":47,"context_line":"            except exception.Forbidden:"},{"line_number":48,"context_line":"                LOG.debug(\"User not permitted by \u0027%s\u0027 policy\" % new_policy)"},{"line_number":49,"context_line":"                raise webob.exc.HTTPForbidden()"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            self.policy.enforce(req.context, \u0027manage_image_cache\u0027, {})"},{"line_number":52,"context_line":"        except exception.Forbidden:"},{"line_number":53,"context_line":"            LOG.debug(\"User not permitted to manage the image cache\")"},{"line_number":54,"context_line":"            raise webob.exc.HTTPForbidden()"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def get_cached_images(self, req):"},{"line_number":57,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"b37d9629_82f6dde8","line":54,"range":{"start_line":43,"start_character":8,"end_line":54,"end_character":43},"updated":"2021-07-06 05:11:14.000000000","message":"we can make it simpler, something like;\n\nif not new_policy:\n    new_policy \u003d \u0027manage_image_cache\u0027\ntry:\n    self.policy.enforce(req.context, \u0027manage_image_cache\u0027, {})\nexcept exception.Forbidden:\n    LOG.debug(\"User not permitted by \u0027%s\u0027 policy\" % new_policy)\n    raise webob.exc.HTTPForbidden()","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"39570fc28f3b180a50a1eccf9bdb4b9f551f897d","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def _enforce(self, req, new_policy\u003dNone):"},{"line_number":42,"context_line":"        \"\"\"Authorize request against \u0027manage_image_cache\u0027 policy\"\"\""},{"line_number":43,"context_line":"        if new_policy:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                self.policy.enforce(req.context, new_policy, {})"},{"line_number":46,"context_line":"                return"},{"line_number":47,"context_line":"            except exception.Forbidden:"},{"line_number":48,"context_line":"                LOG.debug(\"User not permitted by \u0027%s\u0027 policy\" % new_policy)"},{"line_number":49,"context_line":"                raise webob.exc.HTTPForbidden()"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            self.policy.enforce(req.context, \u0027manage_image_cache\u0027, {})"},{"line_number":52,"context_line":"        except exception.Forbidden:"},{"line_number":53,"context_line":"            LOG.debug(\"User not permitted to manage the image cache\")"},{"line_number":54,"context_line":"            raise webob.exc.HTTPForbidden()"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def get_cached_images(self, req):"},{"line_number":57,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"d82a1028_74529294","line":54,"range":{"start_line":43,"start_character":8,"end_line":54,"end_character":43},"in_reply_to":"84189e41_efefbccf","updated":"2022-01-27 05:47:24.000000000","message":"Done","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"1ac714460803df90ca20520049951399f9288582","unresolved":true,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def _enforce(self, req, new_policy\u003dNone):"},{"line_number":42,"context_line":"        \"\"\"Authorize request against \u0027manage_image_cache\u0027 policy\"\"\""},{"line_number":43,"context_line":"        if new_policy:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                self.policy.enforce(req.context, new_policy, {})"},{"line_number":46,"context_line":"                return"},{"line_number":47,"context_line":"            except exception.Forbidden:"},{"line_number":48,"context_line":"                LOG.debug(\"User not permitted by \u0027%s\u0027 policy\" % new_policy)"},{"line_number":49,"context_line":"                raise webob.exc.HTTPForbidden()"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            self.policy.enforce(req.context, \u0027manage_image_cache\u0027, {})"},{"line_number":52,"context_line":"        except exception.Forbidden:"},{"line_number":53,"context_line":"            LOG.debug(\"User not permitted to manage the image cache\")"},{"line_number":54,"context_line":"            raise webob.exc.HTTPForbidden()"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def get_cached_images(self, req):"},{"line_number":57,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"84189e41_efefbccf","line":54,"range":{"start_line":43,"start_character":8,"end_line":54,"end_character":43},"in_reply_to":"b37d9629_82f6dde8","updated":"2021-07-06 09:46:18.000000000","message":"\u003e we can make it simpler, something like;\n\nI like it!\n\u003e \n\u003e if not new_policy:\n\u003e     new_policy \u003d \u0027manage_image_cache\u0027\n\u003e try:\n\u003e     self.policy.enforce(req.context, \u0027manage_image_cache\u0027, {})\nI assume self.policy.enforce(req.context, new_policy, {})\n\u003e except exception.Forbidden:\n\u003e     LOG.debug(\"User not permitted by \u0027%s\u0027 policy\" % new_policy)\n\u003e     raise webob.exc.HTTPForbidden()","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"891bd7d7d34a484f0f9203131f9b3b00f96c46af","unresolved":true,"context_lines":[{"line_number":127,"context_line":"        Removes the image from cache or queue."},{"line_number":128,"context_line":"        \"\"\""},{"line_number":129,"context_line":"        self._enforce(req, new_policy\u003d\u0027cache_delete\u0027)"},{"line_number":130,"context_line":"        self.cache.delete_cached_image(image_id)"},{"line_number":131,"context_line":"        self.cache.delete_queued_image(image_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def clear_cache(self, req):"},{"line_number":134,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"584543a7_b9e282ae","line":131,"range":{"start_line":130,"start_character":8,"end_line":131,"end_character":48},"updated":"2021-07-06 05:11:14.000000000","message":"Can we combine this in one call and call these functions internally from self.cache?\n\nlike self.cache.delete_all(image_id)\n\nand then internally from delete_all call these functions?","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        Removes the image from cache or queue."},{"line_number":128,"context_line":"        \"\"\""},{"line_number":129,"context_line":"        self._enforce(req, new_policy\u003d\u0027cache_delete\u0027)"},{"line_number":130,"context_line":"        self.cache.delete_cached_image(image_id)"},{"line_number":131,"context_line":"        self.cache.delete_queued_image(image_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def clear_cache(self, req):"},{"line_number":134,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"e04cb80b_1eed195a","line":131,"range":{"start_line":130,"start_character":8,"end_line":131,"end_character":48},"in_reply_to":"356f2c4d_9cd7fd7f","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"1ac714460803df90ca20520049951399f9288582","unresolved":true,"context_lines":[{"line_number":127,"context_line":"        Removes the image from cache or queue."},{"line_number":128,"context_line":"        \"\"\""},{"line_number":129,"context_line":"        self._enforce(req, new_policy\u003d\u0027cache_delete\u0027)"},{"line_number":130,"context_line":"        self.cache.delete_cached_image(image_id)"},{"line_number":131,"context_line":"        self.cache.delete_queued_image(image_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def clear_cache(self, req):"},{"line_number":134,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"356f2c4d_9cd7fd7f","line":131,"range":{"start_line":130,"start_character":8,"end_line":131,"end_character":48},"in_reply_to":"584543a7_b9e282ae","updated":"2021-07-06 09:46:18.000000000","message":"I\u0027m not sure how that would simplify things. It\u0027s two lines of code and implementing \"delete_from_everywhere()\" in ImageCache is going to be minimum 3 lines and couple of function calls there (say we just create wrapper that calls these two functions within the cache) to save one call here.\n\nIMO this is pretty clear what it does and benefits to move 2 line logic somewhere else are diminishing.","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"891bd7d7d34a484f0f9203131f9b3b00f96c46af","unresolved":true,"context_lines":[{"line_number":146,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":147,"context_line":"            res \u003d self.cache.delete_all_queued_images()"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            reason \u003d _(\"If provided \u0027x-image-cache-clear-target\u0027 must be \","},{"line_number":150,"context_line":"                       \"\u0027cache\u0027, \u0027queue\u0027 or \u0027\u0027.\")"},{"line_number":151,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dreason,"},{"line_number":152,"context_line":"                                           request\u003dreq,"},{"line_number":153,"context_line":"                                           content_type\u003d\u0027text/plain\u0027)"},{"line_number":154,"context_line":"        return res"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def get_cache_state(self, req):"}],"source_content_type":"text/x-python","patch_set":5,"id":"70a88e72_a64cc02e","line":153,"range":{"start_line":149,"start_character":12,"end_line":153,"end_character":69},"updated":"2021-07-06 05:11:14.000000000","message":"Can we silently ignore this with warning log and delete from both?","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"1ac714460803df90ca20520049951399f9288582","unresolved":true,"context_lines":[{"line_number":146,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":147,"context_line":"            res \u003d self.cache.delete_all_queued_images()"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            reason \u003d _(\"If provided \u0027x-image-cache-clear-target\u0027 must be \","},{"line_number":150,"context_line":"                       \"\u0027cache\u0027, \u0027queue\u0027 or \u0027\u0027.\")"},{"line_number":151,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dreason,"},{"line_number":152,"context_line":"                                           request\u003dreq,"},{"line_number":153,"context_line":"                                           content_type\u003d\u0027text/plain\u0027)"},{"line_number":154,"context_line":"        return res"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def get_cache_state(self, req):"}],"source_content_type":"text/x-python","patch_set":5,"id":"8cd8b4b4_7e7d3766","line":153,"range":{"start_line":149,"start_character":12,"end_line":153,"end_character":69},"in_reply_to":"70a88e72_a64cc02e","updated":"2021-07-06 09:46:18.000000000","message":"We could but I\u0027d rather not. Do you have example in mind we do somewhere else that we ignore bad request content and just proceed anyways? Specially on delete where we would just whack everything?","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"39570fc28f3b180a50a1eccf9bdb4b9f551f897d","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":147,"context_line":"            res \u003d self.cache.delete_all_queued_images()"},{"line_number":148,"context_line":"        else:"},{"line_number":149,"context_line":"            reason \u003d _(\"If provided \u0027x-image-cache-clear-target\u0027 must be \","},{"line_number":150,"context_line":"                       \"\u0027cache\u0027, \u0027queue\u0027 or \u0027\u0027.\")"},{"line_number":151,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dreason,"},{"line_number":152,"context_line":"                                           request\u003dreq,"},{"line_number":153,"context_line":"                                           content_type\u003d\u0027text/plain\u0027)"},{"line_number":154,"context_line":"        return res"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def get_cache_state(self, req):"}],"source_content_type":"text/x-python","patch_set":5,"id":"120297a8_56f1c899","line":153,"range":{"start_line":149,"start_character":12,"end_line":153,"end_character":69},"in_reply_to":"8cd8b4b4_7e7d3766","updated":"2022-01-27 05:47:24.000000000","message":"Done","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"891bd7d7d34a484f0f9203131f9b3b00f96c46af","unresolved":true,"context_lines":[{"line_number":160,"context_line":"        Returns dict of cached and queued images"},{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        self._enforce(req, new_policy\u003d\u0027cache_list\u0027)"},{"line_number":163,"context_line":"        return dict(cached_images\u003dself.cache.get_cached_images(),"},{"line_number":164,"context_line":"                    queued_images\u003dself.cache.get_queued_images())"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def queue_image_from_api(self, req, image_id):"},{"line_number":167,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a5c7df5_bb208a9f","line":164,"range":{"start_line":163,"start_character":8,"end_line":164,"end_character":65},"updated":"2021-07-06 05:11:14.000000000","message":"ditto, can be combined in one call here.","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        Returns dict of cached and queued images"},{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        self._enforce(req, new_policy\u003d\u0027cache_list\u0027)"},{"line_number":163,"context_line":"        return dict(cached_images\u003dself.cache.get_cached_images(),"},{"line_number":164,"context_line":"                    queued_images\u003dself.cache.get_queued_images())"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def queue_image_from_api(self, req, image_id):"},{"line_number":167,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"49f87d30_6007c09a","line":164,"range":{"start_line":163,"start_character":8,"end_line":164,"end_character":65},"in_reply_to":"3a5c7df5_bb208a9f","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b27218e4881863ccbcb9be424bc8c240ae5203ec","unresolved":true,"context_lines":[{"line_number":141,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":142,"context_line":"            res \u003d self.cache.delete_all_queued_images()"},{"line_number":143,"context_line":"        else:"},{"line_number":144,"context_line":"            reason \u003d _(\"If provided \u0027x-image-cache-clear-target\u0027 must be \","},{"line_number":145,"context_line":"                       \"\u0027cache\u0027, \u0027queue\u0027 or \u0027\u0027.\")"},{"line_number":146,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dreason,"},{"line_number":147,"context_line":"                                           request\u003dreq,"},{"line_number":148,"context_line":"                                           content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"114526bf_8ea4f982","line":145,"range":{"start_line":144,"start_character":11,"end_line":145,"end_character":49},"updated":"2021-08-09 19:43:53.000000000","message":"Failing here if header is passed other than cache,queue or \u0027\u0027\n\nreason \u003d _(\"If provided \u0027x-image-cache-clear-target\u0027 must be \",\nAug 09 19:39:20 akekane-xena-dev devstack@g-api.service[8134]: ERROR glance.common.wsgi TypeError: f() takes 1 positional argument but 2 were given\nAug 09 19:39:20 akekane-xena-dev devstack@g-api.service[8134]: ERROR glance.common.wsgi","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"39570fc28f3b180a50a1eccf9bdb4b9f551f897d","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":142,"context_line":"            res \u003d self.cache.delete_all_queued_images()"},{"line_number":143,"context_line":"        else:"},{"line_number":144,"context_line":"            reason \u003d _(\"If provided \u0027x-image-cache-clear-target\u0027 must be \","},{"line_number":145,"context_line":"                       \"\u0027cache\u0027, \u0027queue\u0027 or \u0027\u0027.\")"},{"line_number":146,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dreason,"},{"line_number":147,"context_line":"                                           request\u003dreq,"},{"line_number":148,"context_line":"                                           content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"59088351_54c1b869","line":145,"range":{"start_line":144,"start_character":11,"end_line":145,"end_character":49},"in_reply_to":"114526bf_8ea4f982","updated":"2022-01-27 05:47:24.000000000","message":"Done","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":146,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dreason,"},{"line_number":147,"context_line":"                                           request\u003dreq,"},{"line_number":148,"context_line":"                                           content_type\u003d\u0027text/plain\u0027)"},{"line_number":149,"context_line":"        return res"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def get_cache_state(self, req):"},{"line_number":152,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"1c674e61_d6f34630","line":149,"range":{"start_line":149,"start_character":15,"end_line":149,"end_character":18},"updated":"2021-08-25 14:35:04.000000000","message":"The result from this call is either a dict or not a dict based on whether both things were run or not? That\u0027s annoying for clients, why not make this consistent? I think these calls return an integer, which typically isn\u0027t used as a result value anyway, so always returning a dict seems cleaner to me.","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dreason,"},{"line_number":147,"context_line":"                                           request\u003dreq,"},{"line_number":148,"context_line":"                                           content_type\u003d\u0027text/plain\u0027)"},{"line_number":149,"context_line":"        return res"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def get_cache_state(self, req):"},{"line_number":152,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"abd4d971_044e0223","line":149,"range":{"start_line":149,"start_character":15,"end_line":149,"end_character":18},"in_reply_to":"1c674e61_d6f34630","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":43,"context_line":"        if not new_policy:"},{"line_number":44,"context_line":"            new_policy \u003d \u0027manage_image_cache\u0027"},{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            self.policy.enforce(req.context, new_policy, {})"},{"line_number":47,"context_line":"        except exception.Forbidden:"},{"line_number":48,"context_line":"            LOG.debug(\"User not permitted by \u0027%s\u0027 policy\" % new_policy)"},{"line_number":49,"context_line":"            raise webob.exc.HTTPForbidden()"}],"source_content_type":"text/x-python","patch_set":12,"id":"c29c2b75_7b044e8b","line":46,"range":{"start_line":46,"start_character":12,"end_line":46,"end_character":60},"updated":"2021-08-27 14:13:04.000000000","message":"This needs to be converted as per new policy enforcement!!!","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"292e210e6833830f256d8b0bfd5e5916ed7f0775","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if not new_policy:"},{"line_number":44,"context_line":"            new_policy \u003d \u0027manage_image_cache\u0027"},{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            self.policy.enforce(req.context, new_policy, {})"},{"line_number":47,"context_line":"        except exception.Forbidden:"},{"line_number":48,"context_line":"            LOG.debug(\"User not permitted by \u0027%s\u0027 policy\" % new_policy)"},{"line_number":49,"context_line":"            raise webob.exc.HTTPForbidden()"}],"source_content_type":"text/x-python","patch_set":12,"id":"a0207121_1f2128c1","line":46,"range":{"start_line":46,"start_character":12,"end_line":46,"end_character":60},"in_reply_to":"c29c2b75_7b044e8b","updated":"2022-01-04 08:18:39.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":139,"context_line":"        elif target \u003d\u003d \u0027cache\u0027:"},{"line_number":140,"context_line":"            res \u003d dict(cache_deleted\u003dself.cache.delete_all_cached_images())"},{"line_number":141,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":142,"context_line":"            res \u003d dict(queue_deleted\u003dself.cache.delete_all_queued_images())"},{"line_number":143,"context_line":"        else:"},{"line_number":144,"context_line":"            reason \u003d (_(\"If provided \u0027x-image-cache-clear-target\u0027 must be \""},{"line_number":145,"context_line":"                        \"\u0027cache\u0027, \u0027queue\u0027 or empty string.\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"55d5a647_1e0f37f2","line":142,"updated":"2021-08-26 15:25:18.000000000","message":"This is better than it was, but it seems like just always returning a stable dict of the same two keys would be better. Confirmation that zero cached images were deleted when you just asked for the queue to be deleted, etc.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":139,"context_line":"        elif target \u003d\u003d \u0027cache\u0027:"},{"line_number":140,"context_line":"            res \u003d dict(cache_deleted\u003dself.cache.delete_all_cached_images())"},{"line_number":141,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":142,"context_line":"            res \u003d dict(queue_deleted\u003dself.cache.delete_all_queued_images())"},{"line_number":143,"context_line":"        else:"},{"line_number":144,"context_line":"            reason \u003d (_(\"If provided \u0027x-image-cache-clear-target\u0027 must be \""},{"line_number":145,"context_line":"                        \"\u0027cache\u0027, \u0027queue\u0027 or empty string.\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"3af7c657_18b540d8","line":142,"in_reply_to":"34af72a9_f5096883","updated":"2021-08-27 14:13:04.000000000","message":"I don\u0027t have any strong opinion here rather than just saying if we return dict with two keys there will be less conditions at client side.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        elif target \u003d\u003d \u0027cache\u0027:"},{"line_number":140,"context_line":"            res \u003d dict(cache_deleted\u003dself.cache.delete_all_cached_images())"},{"line_number":141,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":142,"context_line":"            res \u003d dict(queue_deleted\u003dself.cache.delete_all_queued_images())"},{"line_number":143,"context_line":"        else:"},{"line_number":144,"context_line":"            reason \u003d (_(\"If provided \u0027x-image-cache-clear-target\u0027 must be \""},{"line_number":145,"context_line":"                        \"\u0027cache\u0027, \u0027queue\u0027 or empty string.\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"97ddba88_17b1c7a8","line":142,"in_reply_to":"3af7c657_18b540d8","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"be49ba5dbaf0ef05d454597c9f574a0ff7c9ebe5","unresolved":true,"context_lines":[{"line_number":139,"context_line":"        elif target \u003d\u003d \u0027cache\u0027:"},{"line_number":140,"context_line":"            res \u003d dict(cache_deleted\u003dself.cache.delete_all_cached_images())"},{"line_number":141,"context_line":"        elif target \u003d\u003d \u0027queue\u0027:"},{"line_number":142,"context_line":"            res \u003d dict(queue_deleted\u003dself.cache.delete_all_queued_images())"},{"line_number":143,"context_line":"        else:"},{"line_number":144,"context_line":"            reason \u003d (_(\"If provided \u0027x-image-cache-clear-target\u0027 must be \""},{"line_number":145,"context_line":"                        \"\u0027cache\u0027, \u0027queue\u0027 or empty string.\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"34af72a9_f5096883","line":142,"in_reply_to":"55d5a647_1e0f37f2","updated":"2021-08-27 13:17:43.000000000","message":"I\u0027d like to disagree. I think if really the keys are wanted to flag it None/-1 or really anything rather than non-negative integer value. The non-negative integer value indicates that the delete command was executed agaist target and how many entries were deleted. defaulting to 0 when the delete was indeed not executed against said target would just cause confusion \"Did it issue the clear on both instead of just queue and didn\u0027t we have anything in cache to clear or did it execute in only on cache as I thought I requested.\"\n\nHaving both keys there, sure, would make the client logic 1% simpler to deal with but both keys having a value indicating successful execution would be just really bad. On the same time when you are generating request and targeting it to one or the other, you would know exactly which key to expect the response to have.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"de361f5718cee64ceeb7d4572de0d297a065bd78","unresolved":true,"context_lines":[{"line_number":50,"context_line":"        cache_enabled \u003d CONF.image_cache_dir"},{"line_number":51,"context_line":"        if not cache_enabled:"},{"line_number":52,"context_line":"            msg \u003d _(\"Caching via API is not supported at this site.\")"},{"line_number":53,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if not new_policy:"},{"line_number":56,"context_line":"            new_policy \u003d \u0027manage_image_cache\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"4700271d_2f703464","line":53,"updated":"2022-01-13 17:08:17.000000000","message":"I wonder if it would be better to put this after the enforce check below? The way this is, an unprivileged user can determine if caching is enabled by probing to see if they get a 404 or 403. If we do this check after, then we will only return 404 to admins.","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b9e67d7aaf9355e849be101aaecd7d0bce1e4093","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        cache_enabled \u003d CONF.image_cache_dir"},{"line_number":51,"context_line":"        if not cache_enabled:"},{"line_number":52,"context_line":"            msg \u003d _(\"Caching via API is not supported at this site.\")"},{"line_number":53,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if not new_policy:"},{"line_number":56,"context_line":"            new_policy \u003d \u0027manage_image_cache\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"57b169a6_955450a4","line":53,"in_reply_to":"4700271d_2f703464","updated":"2022-01-24 06:55:25.000000000","message":"Ack","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2a9eee713ba4288434cff441a20235fe2518d1d6","unresolved":true,"context_lines":[{"line_number":181,"context_line":"        prefetcher..."},{"line_number":182,"context_line":"        \"\"\""},{"line_number":183,"context_line":"        self._enforce(req, new_policy\u003d\u0027cache_image\u0027)"},{"line_number":184,"context_line":"        self.cache.queue_image(image_id)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"class CachedImageDeserializer(wsgi.JSONRequestDeserializer):"}],"source_content_type":"text/x-python","patch_set":14,"id":"503151c5_0d992cbe","line":184,"updated":"2022-01-24 14:41:32.000000000","message":"The policy discussion brings up something I missed about this... we won\u0027t validate that image_id even exists here. We\u0027ll be happy to queue any uuid you want, but we won\u0027t signal if you typo\u0027d it or if it has been deleted. Moving this API from the weird middleware world to being a formal API was intended to make it more well-behaved and more normal right? Doing the same \"that\u0027s not even an image\" check as the rest of the API should be table stakes.\n\nWhat happens if the cache runner encounters a queued uuid that isn\u0027t a valid image? Will it remove it from both lists? Leave it queued forever? Neither of those will be very operator-friendly.","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"39570fc28f3b180a50a1eccf9bdb4b9f551f897d","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        prefetcher..."},{"line_number":182,"context_line":"        \"\"\""},{"line_number":183,"context_line":"        self._enforce(req, new_policy\u003d\u0027cache_image\u0027)"},{"line_number":184,"context_line":"        self.cache.queue_image(image_id)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"class CachedImageDeserializer(wsgi.JSONRequestDeserializer):"}],"source_content_type":"text/x-python","patch_set":14,"id":"ab526e11_419f0f92","line":184,"in_reply_to":"503151c5_0d992cbe","updated":"2022-01-27 05:47:24.000000000","message":"Done","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        except exception.NotFound:"},{"line_number":96,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":101,"context_line":"        self.cache.delete_cached_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"2b20a994_7ae920f2","line":98,"updated":"2022-01-26 16:29:28.000000000","message":"Shouldn\u0027t we only return NotFound if the image isn\u0027t in the cached set?\n\nThe reason I ask is.. what happens if I cache an image, then delete the image? I guess I\u0027d hope the image delete path cleans up the cache record (does it? I don\u0027t see where...), so maybe a non-issue.\n\nHowever, this delete is \"delete from the list of cached images\" so I would think we should return NotFound if and only if the image is not in that list. The queue case below is different. You\u0027re adding an image to that list, and that image must exist before it can be in the list, so we should do that check for sure.","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except exception.NotFound:"},{"line_number":96,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":101,"context_line":"        self.cache.delete_cached_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"08c71492_1c8ba243","line":98,"in_reply_to":"0da5fa3b_69ebdd33","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6f8bd51bb424ab3b224d254a5f6879c5301faa80","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        except exception.NotFound:"},{"line_number":96,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":101,"context_line":"        self.cache.delete_cached_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"87d85e9c_639244ae","line":98,"in_reply_to":"2b20a994_7ae920f2","updated":"2022-01-27 06:11:35.000000000","message":"I guess this is what exactly it is doing now;\n\nfor example cache-list will contain only valid images for deletion (i.e. active images which are cached) any other image (non-existing or recently deleted) will not be present in cache.\n\nAm I missing something here or could you please explain the scenario which you have in mind?","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        except exception.NotFound:"},{"line_number":96,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":101,"context_line":"        self.cache.delete_cached_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"0da5fa3b_69ebdd33","line":98,"in_reply_to":"87d85e9c_639244ae","updated":"2022-01-27 08:39:43.000000000","message":"Also, I was modifying here existing middleware calls as well, so I reverted this back to existing and modified only recently added new v2 API calls (at the bottom of this file).","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":true,"context_lines":[{"line_number":153,"context_line":"        except exception.NotFound:"},{"line_number":154,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":155,"context_line":"            LOG.warning(msg)"},{"line_number":156,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":159,"context_line":"        self.cache.delete_queued_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"08b550a1_4aa0cd89","line":156,"updated":"2022-01-26 16:29:28.000000000","message":"Same question/concern here about deleting from the list of queued images.","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":true,"context_lines":[{"line_number":153,"context_line":"        except exception.NotFound:"},{"line_number":154,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":155,"context_line":"            LOG.warning(msg)"},{"line_number":156,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":159,"context_line":"        self.cache.delete_queued_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"f7634411_f045c6d7","line":156,"in_reply_to":"07b2cf6e_060ddb26","updated":"2022-01-27 08:39:43.000000000","message":"Also, I was modifying here existing middleware calls as well, so I reverted this back to existing and modified only recently added new v2 API calls (at the bottom of this file).","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"39570fc28f3b180a50a1eccf9bdb4b9f551f897d","unresolved":true,"context_lines":[{"line_number":153,"context_line":"        except exception.NotFound:"},{"line_number":154,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":155,"context_line":"            LOG.warning(msg)"},{"line_number":156,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":159,"context_line":"        self.cache.delete_queued_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"07b2cf6e_060ddb26","line":156,"in_reply_to":"08b550a1_4aa0cd89","updated":"2022-01-27 05:47:24.000000000","message":"Deleting image will delete that image if it is present in cache but it doesn\u0027t check if the image is queued for caching, the image will present in the queueing list but cache prefetcher job will ignore it.\n\nInstead of raising this NotFound I think I will simply log a warning message and proceed further to perform deleting operation.","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        except exception.NotFound:"},{"line_number":154,"context_line":"            msg \u003d _(\"Image %s not found.\") % image_id"},{"line_number":155,"context_line":"            LOG.warning(msg)"},{"line_number":156,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        self._enforce(req, image\u003dimage)"},{"line_number":159,"context_line":"        self.cache.delete_queued_image(image_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"07736d7c_a58cf634","line":156,"in_reply_to":"f7634411_f045c6d7","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":true,"context_lines":[{"line_number":241,"context_line":"        self.cache.queue_image(image_id)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def _verify_image_status(self, image):"},{"line_number":244,"context_line":"        if image.status !\u003d \u0027active\u0027:"},{"line_number":245,"context_line":"            msg \u003d _(\"Only images with status active can be targeted for \""},{"line_number":246,"context_line":"                    \"queueing\")"},{"line_number":247,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":16,"id":"18643743_0a3c6f92","line":244,"updated":"2022-01-26 16:29:28.000000000","message":"Ah, good extra check :)","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        self.cache.queue_image(image_id)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def _verify_image_status(self, image):"},{"line_number":244,"context_line":"        if image.status !\u003d \u0027active\u0027:"},{"line_number":245,"context_line":"            msg \u003d _(\"Only images with status active can be targeted for \""},{"line_number":246,"context_line":"                    \"queueing\")"},{"line_number":247,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7d0096ea_d8940d75","line":244,"in_reply_to":"18643743_0a3c6f92","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"b717241375267cc48876b05df9a6e9f56d007f09","unresolved":true,"context_lines":[{"line_number":172,"context_line":"        for image in cached_images:"},{"line_number":173,"context_line":"            cached_list.append(image[\u0027image_id\u0027])"},{"line_number":174,"context_line":"        if image_id in cached_list:"},{"line_number":175,"context_line":"            return True"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        return False"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"2707f27c_277dc749","line":175,"updated":"2022-02-14 14:38:03.000000000","message":"Building a whole list by hand is a bit confusing. Why not do this instead:\n\nif image_id in [image[\u0027image_id\u0027] for image in cached_images]:\n    return True\n\nreturn False\n\n\nThis would also make the code for queued images and cached images look similar, and therefore more readable.","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a1974f1b024f28d385fce9f9da40ba20355ac5c7","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        for image in cached_images:"},{"line_number":173,"context_line":"            cached_list.append(image[\u0027image_id\u0027])"},{"line_number":174,"context_line":"        if image_id in cached_list:"},{"line_number":175,"context_line":"            return True"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        return False"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1f67cf64_e82e5bbc","line":175,"in_reply_to":"2707f27c_277dc749","updated":"2022-02-14 15:18:23.000000000","message":"Ack","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"}],"glance/api/v2/policy.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"de361f5718cee64ceeb7d4572de0d297a065bd78","unresolved":true,"context_lines":[{"line_number":107,"context_line":"class CacheImageAPIPolicy(APIPolicyBase):"},{"line_number":108,"context_line":"    def __init__(self, context, policy_str\u003dNone, target\u003dNone, enforcer\u003dNone):"},{"line_number":109,"context_line":"        self._context \u003d context"},{"line_number":110,"context_line":"        self._target \u003d target or {}"},{"line_number":111,"context_line":"        self.enforcer \u003d enforcer or policy.Enforcer()"},{"line_number":112,"context_line":"        self.policy_str \u003d policy_str"},{"line_number":113,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"}],"source_content_type":"text/x-python","patch_set":14,"id":"076f1c0f_c555802e","line":110,"updated":"2022-01-13 17:08:17.000000000","message":"This will mean that there\u0027s basically never any way to delegate this out to anyone other than a specific role. I wonder if we should pass the image in here like the rest of our policies so that it would be possible to grant \"can cache your own images\" permission. You\u0027d likely still want some \"can cache own images\" role as well, but if you want to limit it to specific ones, the target needs to be here.","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b9e67d7aaf9355e849be101aaecd7d0bce1e4093","unresolved":true,"context_lines":[{"line_number":107,"context_line":"class CacheImageAPIPolicy(APIPolicyBase):"},{"line_number":108,"context_line":"    def __init__(self, context, policy_str\u003dNone, target\u003dNone, enforcer\u003dNone):"},{"line_number":109,"context_line":"        self._context \u003d context"},{"line_number":110,"context_line":"        self._target \u003d target or {}"},{"line_number":111,"context_line":"        self.enforcer \u003d enforcer or policy.Enforcer()"},{"line_number":112,"context_line":"        self.policy_str \u003d policy_str"},{"line_number":113,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"}],"source_content_type":"text/x-python","patch_set":14,"id":"84a80835_ae40dcf1","line":110,"in_reply_to":"076f1c0f_c555802e","updated":"2022-01-24 06:55:25.000000000","message":"We never fetch actual image for cache operations except while actually caching the image (which is done by periodic job), so we will never have actual image object with us to pass here.\n\nBut If we want to enhance this then that will require refactoring of periodic job as well and should be track as different work (IMO).","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2a9eee713ba4288434cff441a20235fe2518d1d6","unresolved":true,"context_lines":[{"line_number":107,"context_line":"class CacheImageAPIPolicy(APIPolicyBase):"},{"line_number":108,"context_line":"    def __init__(self, context, policy_str\u003dNone, target\u003dNone, enforcer\u003dNone):"},{"line_number":109,"context_line":"        self._context \u003d context"},{"line_number":110,"context_line":"        self._target \u003d target or {}"},{"line_number":111,"context_line":"        self.enforcer \u003d enforcer or policy.Enforcer()"},{"line_number":112,"context_line":"        self.policy_str \u003d policy_str"},{"line_number":113,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"}],"source_content_type":"text/x-python","patch_set":14,"id":"b1d87c29_d1eaf946","line":110,"in_reply_to":"84a80835_ae40dcf1","updated":"2022-01-24 14:41:32.000000000","message":"Yep, but I assume the fact that we haven\u0027t pulled the image here is a consequence of the fact that this used to be middleware and not a formal API right? I\u0027m just saying, in all the personal role work we did, a lot of the effort was getting the target objects to be consistent and useful enough to describe a real policy rule for the action. Leaving this empty means we can\u0027t ever let, say, the new project admin role cache its own images.","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":107,"context_line":"class CacheImageAPIPolicy(APIPolicyBase):"},{"line_number":108,"context_line":"    def __init__(self, context, policy_str\u003dNone, target\u003dNone, enforcer\u003dNone):"},{"line_number":109,"context_line":"        self._context \u003d context"},{"line_number":110,"context_line":"        self._target \u003d target or {}"},{"line_number":111,"context_line":"        self.enforcer \u003d enforcer or policy.Enforcer()"},{"line_number":112,"context_line":"        self.policy_str \u003d policy_str"},{"line_number":113,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"}],"source_content_type":"text/x-python","patch_set":14,"id":"8be11f5b_2897c79e","line":110,"in_reply_to":"b1d87c29_d1eaf946","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"7d25b4b20922b2b14fbb54ab36018bd5f7987c07"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":true,"context_lines":[{"line_number":113,"context_line":"        if self._image:"},{"line_number":114,"context_line":"            target \u003d policy.ImageTarget(self._image)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        self._target \u003d target"},{"line_number":117,"context_line":"        self.enforcer \u003d enforcer or policy.Enforcer()"},{"line_number":118,"context_line":"        self.policy_str \u003d policy_str"},{"line_number":119,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"}],"source_content_type":"text/x-python","patch_set":16,"id":"e155d52a_dde8e6ea","line":116,"updated":"2022-01-26 16:29:28.000000000","message":"++, this lets the operator write more fine-grained rules about who can cache an image.","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        if self._image:"},{"line_number":114,"context_line":"            target \u003d policy.ImageTarget(self._image)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        self._target \u003d target"},{"line_number":117,"context_line":"        self.enforcer \u003d enforcer or policy.Enforcer()"},{"line_number":118,"context_line":"        self.policy_str \u003d policy_str"},{"line_number":119,"context_line":"        super(CacheImageAPIPolicy, self).__init__(context, target, enforcer)"}],"source_content_type":"text/x-python","patch_set":16,"id":"cc137c4f_91df75a0","line":116,"in_reply_to":"e155d52a_dde8e6ea","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"b717241375267cc48876b05df9a6e9f56d007f09","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    def __init__(self, context, image\u003dNone, policy_str\u003dNone,"},{"line_number":109,"context_line":"                 target\u003dNone, enforcer\u003dNone):"},{"line_number":110,"context_line":"        self._context \u003d context"},{"line_number":111,"context_line":"        target \u003d {}"},{"line_number":112,"context_line":"        self._image \u003d image"},{"line_number":113,"context_line":"        if self._image:"},{"line_number":114,"context_line":"            target \u003d policy.ImageTarget(self._image)"}],"source_content_type":"text/x-python","patch_set":25,"id":"312ed066_dc724afa","line":111,"updated":"2022-02-14 14:38:03.000000000","message":"So we never use the \"target\" parameter? Why not just remove it then?","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c230f5560185c2e7d321188e6ae85ca6eb4a661a","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def __init__(self, context, image\u003dNone, policy_str\u003dNone,"},{"line_number":109,"context_line":"                 target\u003dNone, enforcer\u003dNone):"},{"line_number":110,"context_line":"        self._context \u003d context"},{"line_number":111,"context_line":"        target \u003d {}"},{"line_number":112,"context_line":"        self._image \u003d image"},{"line_number":113,"context_line":"        if self._image:"},{"line_number":114,"context_line":"            target \u003d policy.ImageTarget(self._image)"}],"source_content_type":"text/x-python","patch_set":25,"id":"ee630d19_6a0527b4","line":111,"in_reply_to":"0d4ef203_2f5dba51","updated":"2022-02-15 14:40:26.000000000","message":"It also mirrors our other policy object patterns.","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a1974f1b024f28d385fce9f9da40ba20355ac5c7","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def __init__(self, context, image\u003dNone, policy_str\u003dNone,"},{"line_number":109,"context_line":"                 target\u003dNone, enforcer\u003dNone):"},{"line_number":110,"context_line":"        self._context \u003d context"},{"line_number":111,"context_line":"        target \u003d {}"},{"line_number":112,"context_line":"        self._image \u003d image"},{"line_number":113,"context_line":"        if self._image:"},{"line_number":114,"context_line":"            target \u003d policy.ImageTarget(self._image)"}],"source_content_type":"text/x-python","patch_set":25,"id":"0d4ef203_2f5dba51","line":111,"in_reply_to":"312ed066_dc724afa","updated":"2022-02-14 15:18:23.000000000","message":"This is here for future work, if we decided to change the policy for caching from admin only to user specific based on image ownership.","commit_id":"01654d424b8bebc02be92a9d99d27da1664daa2a"}],"glance/api/v2/router.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":606,"context_line":"                           controller\u003dcache_manage_resource,"},{"line_number":607,"context_line":"                           action\u003d\u0027clear_cache\u0027,"},{"line_number":608,"context_line":"                           conditions\u003d{\u0027method\u0027: [\u0027DELETE\u0027]})"},{"line_number":609,"context_line":"            mapper.connect(\u0027/cache\u0027,"},{"line_number":610,"context_line":"                           controller\u003dreject_method_resource,"},{"line_number":611,"context_line":"                           action\u003d\u0027reject\u0027,"},{"line_number":612,"context_line":"                           allowed_methods\u003d\u0027GET, DELETE\u0027)"},{"line_number":613,"context_line":"            mapper.connect(\u0027/cache/{image_id}\u0027,"},{"line_number":614,"context_line":"                           controller\u003dcache_manage_resource,"},{"line_number":615,"context_line":"                           action\u003d\u0027delete_cache_entry\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"73537580_e6de5236","line":612,"range":{"start_line":609,"start_character":0,"end_line":612,"end_character":57},"updated":"2021-08-25 14:35:04.000000000","message":"I\u0027m confused about this. Is this dead code? Won\u0027t the above two rules match both things that would have been rejected here?","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"d4b088a708246dab8e7603265cfead310b6bca55","unresolved":false,"context_lines":[{"line_number":606,"context_line":"                           controller\u003dcache_manage_resource,"},{"line_number":607,"context_line":"                           action\u003d\u0027clear_cache\u0027,"},{"line_number":608,"context_line":"                           conditions\u003d{\u0027method\u0027: [\u0027DELETE\u0027]})"},{"line_number":609,"context_line":"            mapper.connect(\u0027/cache\u0027,"},{"line_number":610,"context_line":"                           controller\u003dreject_method_resource,"},{"line_number":611,"context_line":"                           action\u003d\u0027reject\u0027,"},{"line_number":612,"context_line":"                           allowed_methods\u003d\u0027GET, DELETE\u0027)"},{"line_number":613,"context_line":"            mapper.connect(\u0027/cache/{image_id}\u0027,"},{"line_number":614,"context_line":"                           controller\u003dcache_manage_resource,"},{"line_number":615,"context_line":"                           action\u003d\u0027delete_cache_entry\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5d8a6263_a8d8c394","line":612,"range":{"start_line":609,"start_character":0,"end_line":612,"end_character":57},"in_reply_to":"73537580_e6de5236","updated":"2021-08-25 18:54:50.000000000","message":"It\u0027s \"allowed_methods\" as in ignore list rather than catch list, it picks up everything else. Any other method, like POST or PUT will be mapped to reject. Just like the \u0027/info/\u0027 endpoints above has only \u0027GET\u0027 methods allowed and anything else gets mapped to the reject.\n\nIf you look through the API mapper, all endpoints are filtered like that to reject anything that is not defined. There was some good reson in the wsgi router implementation why this was the way to go.","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":618,"context_line":"                           controller\u003dcache_manage_resource,"},{"line_number":619,"context_line":"                           action\u003d\u0027queue_image_from_api\u0027,"},{"line_number":620,"context_line":"                           conditions\u003d{\u0027method\u0027: [\u0027PUT\u0027]})"},{"line_number":621,"context_line":"            mapper.connect(\u0027/cache/{image_id}\u0027,"},{"line_number":622,"context_line":"                           controller\u003dreject_method_resource,"},{"line_number":623,"context_line":"                           action\u003d\u0027reject\u0027,"},{"line_number":624,"context_line":"                           allowed_methods\u003d\u0027DELETE, PUT\u0027)"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"        super(API, self).__init__(mapper)"}],"source_content_type":"text/x-python","patch_set":11,"id":"878ba8d1_ded1da51","line":624,"range":{"start_line":621,"start_character":0,"end_line":624,"end_character":57},"updated":"2021-08-25 14:35:04.000000000","message":"Same here, so I\u0027m assuming it\u0027s expected. Can you explain why we need this, just so I know?","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                           controller\u003dcache_manage_resource,"},{"line_number":619,"context_line":"                           action\u003d\u0027queue_image_from_api\u0027,"},{"line_number":620,"context_line":"                           conditions\u003d{\u0027method\u0027: [\u0027PUT\u0027]})"},{"line_number":621,"context_line":"            mapper.connect(\u0027/cache/{image_id}\u0027,"},{"line_number":622,"context_line":"                           controller\u003dreject_method_resource,"},{"line_number":623,"context_line":"                           action\u003d\u0027reject\u0027,"},{"line_number":624,"context_line":"                           allowed_methods\u003d\u0027DELETE, PUT\u0027)"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"        super(API, self).__init__(mapper)"}],"source_content_type":"text/x-python","patch_set":11,"id":"a1149465_fbf2ee8b","line":624,"range":{"start_line":621,"start_character":0,"end_line":624,"end_character":57},"in_reply_to":"878ba8d1_ded1da51","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":594,"context_line":"                       action\u003d\u0027reject\u0027,"},{"line_number":595,"context_line":"                       allowed_methods\u003d\u0027GET\u0027)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"        if CONF.image_cache_dir:"},{"line_number":598,"context_line":"            # Cache Management API"},{"line_number":599,"context_line":"            cache_manage_resource \u003d cached_images.create_resource()"},{"line_number":600,"context_line":"            mapper.connect(\u0027/cache\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"4caad297_2629a8fe","line":597,"updated":"2021-08-26 15:25:18.000000000","message":"Why do this? IMHO, this is really bad behavior for an API to have whole URLs that appear and disappear based on the configuration. Why would we not make the endpoints just return a proper 4xx code for \"caching not enabled\" like 405 (Method Not Allowed) or 409 (Conflict)?\n\nIt would simplify this code, make this all better behaved, IMHO and be in line with what we do elsewhere. For example, delete from store always exists, but refuses politely if not enabled_backends:\n\nhttps://github.com/openstack/glance/blob/master/glance/api/v2/images.py#L726\n\nNow, that\u0027s a little different because it\u0027s returning a 404, but that is because it\u0027s a named resource handler, and that really doesn\u0027t exist if backends is disabled, but the API itself is still there.\n\nHere\u0027s another example. The operator can disable all their import methods (and they do), yet the import call doesn\u0027t become a 404, it just always returns \"sorry I\u0027m not configured to do that thing\":\n\nhttps://github.com/openstack/glance/blob/master/glance/api/v2/images.py#L1527\n\nMore data in the openstack api guidelines around API extensions:\n\nhttps://specs.openstack.org/openstack/api-wg/guidelines/extensions.html\n\nThis says \"Having different URLs in a service, based on different drivers, breaks interoperability\" and I think that generally applies here to a thing being present or absent if the \"cache driver\" is enabled. It does say that URL differences must be discoverable, but only if those differences are not avoidable. This is quite avoidable I think.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":594,"context_line":"                       action\u003d\u0027reject\u0027,"},{"line_number":595,"context_line":"                       allowed_methods\u003d\u0027GET\u0027)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"        if CONF.image_cache_dir:"},{"line_number":598,"context_line":"            # Cache Management API"},{"line_number":599,"context_line":"            cache_manage_resource \u003d cached_images.create_resource()"},{"line_number":600,"context_line":"            mapper.connect(\u0027/cache\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"55b3f487_676edc8c","line":597,"in_reply_to":"477546c7_b903c8d3","updated":"2021-08-27 14:13:04.000000000","message":"It\u0027s not about holding the patch hostage or anything else, I think what he is suggesting here is why should we mark this as EXPERIMENTAL is there any strong reason for doing it, or its just a practice we use to follow?\n\nIf it is straightforward and simple change then why we should flag it experimental then next release revisit it and make it supportive?","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"be49ba5dbaf0ef05d454597c9f574a0ff7c9ebe5","unresolved":true,"context_lines":[{"line_number":594,"context_line":"                       action\u003d\u0027reject\u0027,"},{"line_number":595,"context_line":"                       allowed_methods\u003d\u0027GET\u0027)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"        if CONF.image_cache_dir:"},{"line_number":598,"context_line":"            # Cache Management API"},{"line_number":599,"context_line":"            cache_manage_resource \u003d cached_images.create_resource()"},{"line_number":600,"context_line":"            mapper.connect(\u0027/cache\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"477546c7_b903c8d3","line":597,"in_reply_to":"4caad297_2629a8fe","updated":"2021-08-27 13:17:43.000000000","message":"\u003e Why do this? \n\nI think you answered your own question in your comment in the router. Consistency. Every \u0027EXPERIMENTAL\u0027 API version we have introduced into the Images API v2 has had to have a way to turn it off. Should we start the conversation of how good or bad practise it is now, is fine by me, but holding this patch hostage during that conversation will just mean that the feature will not be included in the Xena release.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"292e210e6833830f256d8b0bfd5e5916ed7f0775","unresolved":false,"context_lines":[{"line_number":594,"context_line":"                       action\u003d\u0027reject\u0027,"},{"line_number":595,"context_line":"                       allowed_methods\u003d\u0027GET\u0027)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"        if CONF.image_cache_dir:"},{"line_number":598,"context_line":"            # Cache Management API"},{"line_number":599,"context_line":"            cache_manage_resource \u003d cached_images.create_resource()"},{"line_number":600,"context_line":"            mapper.connect(\u0027/cache\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"590981c3_66bffbb8","line":597,"in_reply_to":"55b3f487_676edc8c","updated":"2022-01-04 08:18:39.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"}],"glance/api/versions.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":78,"context_line":"        version_objs \u003d []"},{"line_number":79,"context_line":"        if CONF.image_cache_dir:"},{"line_number":80,"context_line":"            version_objs.extend(["},{"line_number":81,"context_line":"                build_version_object(2.13, \u0027v2\u0027, \u0027EXPERIMENTAL\u0027)])"},{"line_number":82,"context_line":"        if CONF.enabled_backends:"},{"line_number":83,"context_line":"            version_objs.extend(["},{"line_number":84,"context_line":"                build_version_object(2.12, \u0027v2\u0027, \u0027CURRENT\u0027),"}],"source_content_type":"text/x-python","patch_set":12,"id":"a0673598_11d4ed9b","line":81,"updated":"2021-08-26 15:25:18.000000000","message":"I see that this is a pattern for glance, but I think it\u0027s a bad one. Making the API change so much based on the config is confusing for clients and users, IMHO (see comment on the previous file). Further, if I\u0027ve got caching enabled and backends disabled, I\u0027ve got a weird gap in the exposed versions that would be confusing, even though all of the behaviors that those versions represent are in the actual code.\n\nI found that 2.10 is apparently the delete from store api, but I had a hard time finding docs for what the other ones in the conditional below even mean. I didn\u0027t see a lot of stuff being swapped out of the router based on config there, so I\u0027m guessing that those too are basically enabled all the time, which makes the conditional below also inconsistent.\n\nAlso, why is this experimental? It\u0027s extremely simple, we\u0027re proposing putting it into the glance client, which means people are going to start using it and we\u0027ll just break them if we have to change it. If we\u0027ve got it in the client, it works and is tested, why not just roll forward and iterate if we need to?","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"be49ba5dbaf0ef05d454597c9f574a0ff7c9ebe5","unresolved":true,"context_lines":[{"line_number":78,"context_line":"        version_objs \u003d []"},{"line_number":79,"context_line":"        if CONF.image_cache_dir:"},{"line_number":80,"context_line":"            version_objs.extend(["},{"line_number":81,"context_line":"                build_version_object(2.13, \u0027v2\u0027, \u0027EXPERIMENTAL\u0027)])"},{"line_number":82,"context_line":"        if CONF.enabled_backends:"},{"line_number":83,"context_line":"            version_objs.extend(["},{"line_number":84,"context_line":"                build_version_object(2.12, \u0027v2\u0027, \u0027CURRENT\u0027),"}],"source_content_type":"text/x-python","patch_set":12,"id":"b2ac3bd4_b3e99bf0","line":81,"in_reply_to":"a0673598_11d4ed9b","updated":"2021-08-27 13:17:43.000000000","message":"\u003e Also, why is this experimental?\n\nJust like we have specs for silly small things we have the tradition to roll in new API endpoints in as \u0027EXPERIMENTAL\u0027 for the initial release as specified in the spec. \n\n\u003eIt\u0027s extremely simple, we\u0027re proposing putting it into the glance client, which means people are going to start using it and we\u0027ll just break them if we have to change it. If we\u0027ve got it in the client, it works and is tested, why not just roll forward and iterate if we need to?\n\nLike you pointed out in the comments on the functional tests, the fact that the test happens to pass while it\u0027s ran does not mean that the feature works as intended and will keep operating such way. We might have missed something critical that gets noticed only in actual use. Thus having the buffer to be able to change the bahaviour without breaking the stable API promise (any user using it and breaking because it changed is aware for the possibility as they were using experimental feature). Inconvenient, for sure, yet still better option than being stuck with bad behaviour just because we were over confident to announce it stable from the get go.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":78,"context_line":"        version_objs \u003d []"},{"line_number":79,"context_line":"        if CONF.image_cache_dir:"},{"line_number":80,"context_line":"            version_objs.extend(["},{"line_number":81,"context_line":"                build_version_object(2.13, \u0027v2\u0027, \u0027EXPERIMENTAL\u0027)])"},{"line_number":82,"context_line":"        if CONF.enabled_backends:"},{"line_number":83,"context_line":"            version_objs.extend(["},{"line_number":84,"context_line":"                build_version_object(2.12, \u0027v2\u0027, \u0027CURRENT\u0027),"}],"source_content_type":"text/x-python","patch_set":12,"id":"c3557613_640adafd","line":81,"in_reply_to":"b2ac3bd4_b3e99bf0","updated":"2021-08-27 14:13:04.000000000","message":"And I think here exactly tempest comes into picture to make sure that without mocking anything our feature is actually working as per expectation.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"292e210e6833830f256d8b0bfd5e5916ed7f0775","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        version_objs \u003d []"},{"line_number":79,"context_line":"        if CONF.image_cache_dir:"},{"line_number":80,"context_line":"            version_objs.extend(["},{"line_number":81,"context_line":"                build_version_object(2.13, \u0027v2\u0027, \u0027EXPERIMENTAL\u0027)])"},{"line_number":82,"context_line":"        if CONF.enabled_backends:"},{"line_number":83,"context_line":"            version_objs.extend(["},{"line_number":84,"context_line":"                build_version_object(2.12, \u0027v2\u0027, \u0027CURRENT\u0027),"}],"source_content_type":"text/x-python","patch_set":12,"id":"15e0ba87_ae38c045","line":81,"in_reply_to":"c3557613_640adafd","updated":"2022-01-04 08:18:39.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55a4a9f40522129b90930319bc1411dd3a8b7c9a","unresolved":true,"context_lines":[{"line_number":85,"context_line":"        else:"},{"line_number":86,"context_line":"            version_objs.extend(["},{"line_number":87,"context_line":"                build_version_object(2.13, \u0027v2\u0027, \u0027CURRENT\u0027),"},{"line_number":88,"context_line":"            ])"},{"line_number":89,"context_line":"        if CONF.enabled_backends:"},{"line_number":90,"context_line":"            version_objs.extend(["},{"line_number":91,"context_line":"                build_version_object(2.12, \u0027v2\u0027, \u0027SUPPORTED\u0027),"}],"source_content_type":"text/x-python","patch_set":20,"id":"5de776f4_44caa948","line":88,"updated":"2022-02-09 17:58:03.000000000","message":"I really don\u0027t understand the motivation behind this logic of only saying the latest thing is current if it\u0027s enabled by config. A thing can be supported and disabled - the latter really has nothing to do with the former.","commit_id":"fa52a1a72bf64f76c2f29eb796d0c6ee416c4ef1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ec51fcd968a349ccf8364f7d597287bc69b16d6e","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        else:"},{"line_number":86,"context_line":"            version_objs.extend(["},{"line_number":87,"context_line":"                build_version_object(2.13, \u0027v2\u0027, \u0027CURRENT\u0027),"},{"line_number":88,"context_line":"            ])"},{"line_number":89,"context_line":"        if CONF.enabled_backends:"},{"line_number":90,"context_line":"            version_objs.extend(["},{"line_number":91,"context_line":"                build_version_object(2.12, \u0027v2\u0027, \u0027SUPPORTED\u0027),"}],"source_content_type":"text/x-python","patch_set":20,"id":"17e2ad3e_d2d5cbcc","line":88,"in_reply_to":"5de776f4_44caa948","updated":"2022-02-09 18:09:25.000000000","message":"Probably we should revisit this in upcoming PTG.","commit_id":"fa52a1a72bf64f76c2f29eb796d0c6ee416c4ef1"}],"glance/policies/cache.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"891bd7d7d34a484f0f9203131f9b3b00f96c46af","unresolved":true,"context_lines":[{"line_number":33,"context_line":"        deprecated_rule\u003dpolicy.DeprecatedRule("},{"line_number":34,"context_line":"            name\u003d\"cache_image\", check_str\u003d\"rule:manage_image_cache\""},{"line_number":35,"context_line":"        ),"},{"line_number":36,"context_line":"        deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":37,"context_line":"        deprecated_since\u003dversionutils.deprecated.XENA"},{"line_number":38,"context_line":"    ),"},{"line_number":39,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":40,"context_line":"        name\u003d\"cache_list\","}],"source_content_type":"text/x-python","patch_set":5,"id":"788664be_436e080e","line":37,"range":{"start_line":36,"start_character":8,"end_line":37,"end_character":53},"updated":"2021-07-06 05:11:14.000000000","message":"This should be part of policy.DeprecatedRule","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"1ac714460803df90ca20520049951399f9288582","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        deprecated_rule\u003dpolicy.DeprecatedRule("},{"line_number":34,"context_line":"            name\u003d\"cache_image\", check_str\u003d\"rule:manage_image_cache\""},{"line_number":35,"context_line":"        ),"},{"line_number":36,"context_line":"        deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":37,"context_line":"        deprecated_since\u003dversionutils.deprecated.XENA"},{"line_number":38,"context_line":"    ),"},{"line_number":39,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":40,"context_line":"        name\u003d\"cache_list\","}],"source_content_type":"text/x-python","patch_set":5,"id":"317bab79_eeb8fccc","line":37,"range":{"start_line":36,"start_character":8,"end_line":37,"end_character":53},"in_reply_to":"788664be_436e080e","updated":"2021-07-06 09:46:18.000000000","message":"Ack","commit_id":"7021ae33590a9580d83d07298b3f71c9337d04e4"}],"glance/tests/functional/v2/test_cache_api.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"e0b172915a38dbd28d3adb7001864b5e7d456767","unresolved":true,"context_lines":[{"line_number":18,"context_line":"from glance.tests import functional"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestImageCache(functional.SynchronousAPIBase):"},{"line_number":22,"context_line":"    # ToDo(abhishekk): Once system scope is enabled and RBAC is fully"},{"line_number":23,"context_line":"    # supported, enable these tests for RBAC as well"},{"line_number":24,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"c9b967f6_69ebece3","line":21,"range":{"start_line":21,"start_character":32,"end_line":21,"end_character":50},"updated":"2021-08-10 13:14:45.000000000","message":"Is there a specific reason why to use SynchronousAPIBase, which states it should not be used unless there is need to mock \"the state of the world\", which I don\u0027t see us doing here?","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1bfd82b6ab231beebd67dd514315e05baeef32a4","unresolved":true,"context_lines":[{"line_number":18,"context_line":"from glance.tests import functional"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestImageCache(functional.SynchronousAPIBase):"},{"line_number":22,"context_line":"    # ToDo(abhishekk): Once system scope is enabled and RBAC is fully"},{"line_number":23,"context_line":"    # supported, enable these tests for RBAC as well"},{"line_number":24,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"d91ee066_bb0cfb0d","line":21,"range":{"start_line":21,"start_character":32,"end_line":21,"end_character":50},"in_reply_to":"c9b967f6_69ebece3","updated":"2021-08-10 14:27:25.000000000","message":"One additional benefit of using this is when test fails it does not attach 1000+ lines of logs to the error trace. Also this is easier to use and understand.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from glance.tests import functional"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestImageCache(functional.SynchronousAPIBase):"},{"line_number":22,"context_line":"    # ToDo(abhishekk): Once system scope is enabled and RBAC is fully"},{"line_number":23,"context_line":"    # supported, enable these tests for RBAC as well"},{"line_number":24,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"36b55e3d_e1672708","line":21,"range":{"start_line":21,"start_character":32,"end_line":21,"end_character":50},"in_reply_to":"d91ee066_bb0cfb0d","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"e0b172915a38dbd28d3adb7001864b5e7d456767","unresolved":true,"context_lines":[{"line_number":27,"context_line":"    def start_server(self):"},{"line_number":28,"context_line":"        config.set_config_defaults()"},{"line_number":29,"context_line":"        self.config(image_cache_dir\u003dself._store_dir(\u0027cache\u0027))"},{"line_number":30,"context_line":"        self.api \u003d config.load_paste_app(\u0027glance-api-caching\u0027,"},{"line_number":31,"context_line":"                                         conf_file\u003dself.paste_config)"},{"line_number":32,"context_line":"        super(TestImageCache, self).start_server()"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def load_data(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"505fc2d4_80e13a12","line":31,"range":{"start_line":30,"start_character":1,"end_line":31,"end_character":69},"updated":"2021-08-10 13:14:45.000000000","message":"This gets overwritten by the super call next line with app-name \u0027glance-api\u0027 so if ever rely for the specific app to be loaded from the config, it would get very confusing. Either remove or make this call after the super call.\n\nThe reason these tests works is that the cache middleware is not exercised at any point.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1bfd82b6ab231beebd67dd514315e05baeef32a4","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    def start_server(self):"},{"line_number":28,"context_line":"        config.set_config_defaults()"},{"line_number":29,"context_line":"        self.config(image_cache_dir\u003dself._store_dir(\u0027cache\u0027))"},{"line_number":30,"context_line":"        self.api \u003d config.load_paste_app(\u0027glance-api-caching\u0027,"},{"line_number":31,"context_line":"                                         conf_file\u003dself.paste_config)"},{"line_number":32,"context_line":"        super(TestImageCache, self).start_server()"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def load_data(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"53e0973e_a7e80111","line":31,"range":{"start_line":30,"start_character":1,"end_line":31,"end_character":69},"in_reply_to":"505fc2d4_80e13a12","updated":"2021-08-10 14:27:25.000000000","message":"Ack","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"e0b172915a38dbd28d3adb7001864b5e7d456767","unresolved":true,"context_lines":[{"line_number":82,"context_line":"        else:"},{"line_number":83,"context_line":"            self.assertEqual(200, response.status_code)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def cache_image(self):"},{"line_number":86,"context_line":"        # NOTE(abhishekk): Here we are not running periodic job which caches"},{"line_number":87,"context_line":"        # queued images as precaching is not part of this patch, so to test"},{"line_number":88,"context_line":"        # all caching operations we are using this way to cache images for us"},{"line_number":89,"context_line":"        cache_prefetcher \u003d prefetcher.Prefetcher()"},{"line_number":90,"context_line":"        cache_prefetcher.run()"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_cache_api_lifecycle(self):"},{"line_number":93,"context_line":"        self.start_server()"}],"source_content_type":"text/x-python","patch_set":9,"id":"62a9e2c5_51146390","line":90,"range":{"start_line":85,"start_character":1,"end_line":90,"end_character":30},"updated":"2021-08-10 13:14:45.000000000","message":"This is super neat! Was one of my major concerns of running these excercises under functional tests rather than under tempest as aiting for the prefetcher or having it running on very short intervals would have been long/heavy.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1bfd82b6ab231beebd67dd514315e05baeef32a4","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        else:"},{"line_number":83,"context_line":"            self.assertEqual(200, response.status_code)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def cache_image(self):"},{"line_number":86,"context_line":"        # NOTE(abhishekk): Here we are not running periodic job which caches"},{"line_number":87,"context_line":"        # queued images as precaching is not part of this patch, so to test"},{"line_number":88,"context_line":"        # all caching operations we are using this way to cache images for us"},{"line_number":89,"context_line":"        cache_prefetcher \u003d prefetcher.Prefetcher()"},{"line_number":90,"context_line":"        cache_prefetcher.run()"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_cache_api_lifecycle(self):"},{"line_number":93,"context_line":"        self.start_server()"}],"source_content_type":"text/x-python","patch_set":9,"id":"66bb5369_b11689e2","line":90,"range":{"start_line":85,"start_character":1,"end_line":90,"end_character":30},"in_reply_to":"62a9e2c5_51146390","updated":"2021-08-10 14:27:25.000000000","message":"Ack","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b22d23a5dfe620918db105f07275f798fdc1661b","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        else:"},{"line_number":83,"context_line":"            self.assertEqual(200, response.status_code)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def cache_image(self):"},{"line_number":86,"context_line":"        # NOTE(abhishekk): Here we are not running periodic job which caches"},{"line_number":87,"context_line":"        # queued images as precaching is not part of this patch, so to test"},{"line_number":88,"context_line":"        # all caching operations we are using this way to cache images for us"},{"line_number":89,"context_line":"        cache_prefetcher \u003d prefetcher.Prefetcher()"},{"line_number":90,"context_line":"        cache_prefetcher.run()"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_cache_api_lifecycle(self):"},{"line_number":93,"context_line":"        self.start_server()"}],"source_content_type":"text/x-python","patch_set":9,"id":"8643ec89_16c19e3e","line":90,"range":{"start_line":85,"start_character":1,"end_line":90,"end_character":30},"in_reply_to":"66bb5369_b11689e2","updated":"2021-08-10 15:22:11.000000000","message":"This is the answer to your question above about why we should use SynchronousAPIBase. While it is a little less isolated, it\u0027s much easier to make sure we\u0027re actually triggering the thing we need. For anything like a periodic job, it\u0027s much better to do it this way and be sure that it ran, than doing tricks with time, hoping that it ran, and delaying further test execution.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"e0b172915a38dbd28d3adb7001864b5e7d456767","unresolved":true,"context_lines":[{"line_number":128,"context_line":"        self.assertIn(images[\u0027community\u0027], output[\u0027queued_images\u0027])"},{"line_number":129,"context_line":"        self.assertIn(images[\u0027public\u0027], output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        # Try to queue non-existing image"},{"line_number":132,"context_line":"        self.cache_queue(\u0027non-existing-image\u0027)"},{"line_number":133,"context_line":"        # Ensure that non existing image is added in queued images"},{"line_number":134,"context_line":"        output \u003d self.list_cache()"},{"line_number":135,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"},{"line_number":136,"context_line":"        self.assertIn(\u0027non-existing-image\u0027, output[\u0027queued_images\u0027])"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Now cached images, to make sure non existing image is not cached"},{"line_number":139,"context_line":"        self.cache_image()"}],"source_content_type":"text/x-python","patch_set":9,"id":"e98dfac3_1db922b8","line":136,"range":{"start_line":131,"start_character":0,"end_line":136,"end_character":68},"updated":"2021-08-10 13:14:45.000000000","message":"Oops, this shouldn\u0027t be happening.\n\nWhile I can see nieche usecases for this, I really think the image should exists and as expecting the policy at latest catching it.\n\nPerhaps we should also look into 2 other scenarios: queueing image that is already in the 1) queue 2) cache","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"3073d84099182181c377060c6d18073f4bf60072","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        self.assertIn(images[\u0027community\u0027], output[\u0027queued_images\u0027])"},{"line_number":129,"context_line":"        self.assertIn(images[\u0027public\u0027], output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        # Try to queue non-existing image"},{"line_number":132,"context_line":"        self.cache_queue(\u0027non-existing-image\u0027)"},{"line_number":133,"context_line":"        # Ensure that non existing image is added in queued images"},{"line_number":134,"context_line":"        output \u003d self.list_cache()"},{"line_number":135,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"},{"line_number":136,"context_line":"        self.assertIn(\u0027non-existing-image\u0027, output[\u0027queued_images\u0027])"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Now cached images, to make sure non existing image is not cached"},{"line_number":139,"context_line":"        self.cache_image()"}],"source_content_type":"text/x-python","patch_set":9,"id":"01507570_54891d8b","line":136,"range":{"start_line":131,"start_character":0,"end_line":136,"end_character":68},"in_reply_to":"18c57f5c_b3560953","updated":"2021-08-11 11:07:08.000000000","message":"These will be addressed as follow up as the work is out of the scope of this specific change.\n\nBug: #1939555","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cdb3bfe2eca1f41b758f505570f6e72dfa03d46a","unresolved":true,"context_lines":[{"line_number":128,"context_line":"        self.assertIn(images[\u0027community\u0027], output[\u0027queued_images\u0027])"},{"line_number":129,"context_line":"        self.assertIn(images[\u0027public\u0027], output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        # Try to queue non-existing image"},{"line_number":132,"context_line":"        self.cache_queue(\u0027non-existing-image\u0027)"},{"line_number":133,"context_line":"        # Ensure that non existing image is added in queued images"},{"line_number":134,"context_line":"        output \u003d self.list_cache()"},{"line_number":135,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"},{"line_number":136,"context_line":"        self.assertIn(\u0027non-existing-image\u0027, output[\u0027queued_images\u0027])"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Now cached images, to make sure non existing image is not cached"},{"line_number":139,"context_line":"        self.cache_image()"}],"source_content_type":"text/x-python","patch_set":9,"id":"18c57f5c_b3560953","line":136,"range":{"start_line":131,"start_character":0,"end_line":136,"end_character":68},"in_reply_to":"c3ce650d_dfc57e0c","updated":"2021-08-10 16:20:58.000000000","message":"What I mean by those two scenarios is we\u0027re not testing them and I assume we will be queueing the same image again for prefetcher (not sure \u0027though). Thus mentioning them.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1bfd82b6ab231beebd67dd514315e05baeef32a4","unresolved":true,"context_lines":[{"line_number":128,"context_line":"        self.assertIn(images[\u0027community\u0027], output[\u0027queued_images\u0027])"},{"line_number":129,"context_line":"        self.assertIn(images[\u0027public\u0027], output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        # Try to queue non-existing image"},{"line_number":132,"context_line":"        self.cache_queue(\u0027non-existing-image\u0027)"},{"line_number":133,"context_line":"        # Ensure that non existing image is added in queued images"},{"line_number":134,"context_line":"        output \u003d self.list_cache()"},{"line_number":135,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"},{"line_number":136,"context_line":"        self.assertIn(\u0027non-existing-image\u0027, output[\u0027queued_images\u0027])"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Now cached images, to make sure non existing image is not cached"},{"line_number":139,"context_line":"        self.cache_image()"}],"source_content_type":"text/x-python","patch_set":9,"id":"c3ce650d_dfc57e0c","line":136,"range":{"start_line":131,"start_character":0,"end_line":136,"end_character":68},"in_reply_to":"e98dfac3_1db922b8","updated":"2021-08-10 14:27:25.000000000","message":"This is consistent with old (glance-cache-manage queue-image) behavior as well. So if we are going to enhance it then we need to identify other scenarios along with the two you have pointed here out.\n\nAlso IMO as we are close to release I think we should continue with this old behavior and enhance it in next cycle.","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"e0b172915a38dbd28d3adb7001864b5e7d456767","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        self.assertNotIn(images[\u0027public\u0027],"},{"line_number":177,"context_line":"                         output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        # Verify clearing cache fails with 404 if invalid header is passed"},{"line_number":180,"context_line":"        self.cache_clear(target\u003d\u0027both\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        # Delete all queued images"}],"source_content_type":"text/x-python","patch_set":9,"id":"b68a2b79_19c9b9c8","line":179,"range":{"start_line":179,"start_character":43,"end_line":179,"end_character":46},"updated":"2021-08-10 13:14:45.000000000","message":"\"400\"","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1bfd82b6ab231beebd67dd514315e05baeef32a4","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        self.assertNotIn(images[\u0027public\u0027],"},{"line_number":177,"context_line":"                         output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        # Verify clearing cache fails with 404 if invalid header is passed"},{"line_number":180,"context_line":"        self.cache_clear(target\u003d\u0027both\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        # Delete all queued images"}],"source_content_type":"text/x-python","patch_set":9,"id":"4f687968_b423343a","line":179,"range":{"start_line":179,"start_character":43,"end_line":179,"end_character":46},"in_reply_to":"b68a2b79_19c9b9c8","updated":"2021-08-10 14:27:25.000000000","message":"Ack","commit_id":"c660b3bfc5f82f165288b7374de52892574461ff"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"48e7ebaff591e31791b850ffe81a3bc77f6ab5a0","unresolved":true,"context_lines":[{"line_number":89,"context_line":"        cache_prefetcher \u003d prefetcher.Prefetcher()"},{"line_number":90,"context_line":"        cache_prefetcher.run()"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_cache_api_lifecycle(self):"},{"line_number":93,"context_line":"        self.start_server()"},{"line_number":94,"context_line":"        images \u003d self.load_data()"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"4fa7945a_4250039d","line":92,"range":{"start_line":92,"start_character":4,"end_line":92,"end_character":39},"updated":"2021-08-25 08:51:23.000000000","message":"by default these tests runs with admin role, we need to cover that running these operations/APIs with non-admin role should raise Forbidden.","commit_id":"649fbfe0f17991239f78d9f59025a0a0b5886c94"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        cache_prefetcher \u003d prefetcher.Prefetcher()"},{"line_number":90,"context_line":"        cache_prefetcher.run()"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_cache_api_lifecycle(self):"},{"line_number":93,"context_line":"        self.start_server()"},{"line_number":94,"context_line":"        images \u003d self.load_data()"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1a185cd1_90fe7849","line":92,"range":{"start_line":92,"start_character":4,"end_line":92,"end_character":39},"in_reply_to":"4fa7945a_4250039d","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"649fbfe0f17991239f78d9f59025a0a0b5886c94"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"48e7ebaff591e31791b850ffe81a3bc77f6ab5a0","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        self.assertNotIn(images[\u0027public\u0027],"},{"line_number":177,"context_line":"                         output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        # Verify clearing cache fails with 404 if invalid header is passed"},{"line_number":180,"context_line":"        self.cache_clear(target\u003d\u0027both\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        # Delete all queued images"}],"source_content_type":"text/x-python","patch_set":10,"id":"914df9e5_be917046","line":179,"range":{"start_line":179,"start_character":43,"end_line":179,"end_character":46},"updated":"2021-08-25 08:51:23.000000000","message":"400","commit_id":"649fbfe0f17991239f78d9f59025a0a0b5886c94"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        self.assertNotIn(images[\u0027public\u0027],"},{"line_number":177,"context_line":"                         output[\u0027cached_images\u0027][0][\u0027image_id\u0027])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        # Verify clearing cache fails with 404 if invalid header is passed"},{"line_number":180,"context_line":"        self.cache_clear(target\u003d\u0027both\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        # Delete all queued images"}],"source_content_type":"text/x-python","patch_set":10,"id":"c017eda4_e06de9a5","line":179,"range":{"start_line":179,"start_character":43,"end_line":179,"end_character":46},"in_reply_to":"914df9e5_be917046","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"649fbfe0f17991239f78d9f59025a0a0b5886c94"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":75,"context_line":"        headers \u003d {}"},{"line_number":76,"context_line":"        if target:"},{"line_number":77,"context_line":"            headers[\u0027x-image-cache-clear-target\u0027] \u003d target"},{"line_number":78,"context_line":"        response \u003d self.api_delete(path, headers\u003dheaders)"},{"line_number":79,"context_line":"        if target not in (\u0027\u0027, \u0027cache\u0027, \u0027queue\u0027):"},{"line_number":80,"context_line":"            self.assertEqual(400, response.status_code)"},{"line_number":81,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"c6128660_af7bedcd","line":78,"updated":"2021-08-25 14:35:04.000000000","message":"Looks like you never validate the result here, which is my int-or-dict comment from the api patch.","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        headers \u003d {}"},{"line_number":76,"context_line":"        if target:"},{"line_number":77,"context_line":"            headers[\u0027x-image-cache-clear-target\u0027] \u003d target"},{"line_number":78,"context_line":"        response \u003d self.api_delete(path, headers\u003dheaders)"},{"line_number":79,"context_line":"        if target not in (\u0027\u0027, \u0027cache\u0027, \u0027queue\u0027):"},{"line_number":80,"context_line":"            self.assertEqual(400, response.status_code)"},{"line_number":81,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"c0ae1e7a_284d6d80","line":78,"in_reply_to":"c6128660_af7bedcd","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        # Queue 3rd image for caching"},{"line_number":131,"context_line":"        self.cache_queue(images[\u0027private\u0027])"},{"line_number":132,"context_line":"        # Now verify that we have 2 images queued for caching and 2"},{"line_number":133,"context_line":"        # cached images"},{"line_number":134,"context_line":"        output \u003d self.list_cache()"},{"line_number":135,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"6172e15a_dca2e89c","line":132,"range":{"start_line":132,"start_character":66,"end_line":132,"end_character":67},"updated":"2021-08-25 14:35:04.000000000","message":"1","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        # Queue 3rd image for caching"},{"line_number":131,"context_line":"        self.cache_queue(images[\u0027private\u0027])"},{"line_number":132,"context_line":"        # Now verify that we have 2 images queued for caching and 2"},{"line_number":133,"context_line":"        # cached images"},{"line_number":134,"context_line":"        output \u003d self.list_cache()"},{"line_number":135,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"8cbbd17b_e42703b7","line":132,"range":{"start_line":132,"start_character":66,"end_line":132,"end_character":67},"in_reply_to":"6172e15a_dca2e89c","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        # Delete public image from cache"},{"line_number":141,"context_line":"        self.cache_delete(images[\u0027public\u0027])"},{"line_number":142,"context_line":"        # Now verify that we have 1 image queued for caching and no"},{"line_number":143,"context_line":"        # cached images"},{"line_number":144,"context_line":"        output \u003d self.list_cache()"},{"line_number":145,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"bb985707_9f6021c6","line":142,"range":{"start_line":142,"start_character":34,"end_line":142,"end_character":35},"updated":"2021-08-25 14:35:04.000000000","message":"2","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        # Delete public image from cache"},{"line_number":141,"context_line":"        self.cache_delete(images[\u0027public\u0027])"},{"line_number":142,"context_line":"        # Now verify that we have 1 image queued for caching and no"},{"line_number":143,"context_line":"        # cached images"},{"line_number":144,"context_line":"        output \u003d self.list_cache()"},{"line_number":145,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3e099007_c3cb126c","line":142,"range":{"start_line":142,"start_character":34,"end_line":142,"end_character":35},"in_reply_to":"bb985707_9f6021c6","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        # Delete all queued images"},{"line_number":152,"context_line":"        self.cache_clear(target\u003d\u0027queue\u0027)"},{"line_number":153,"context_line":"        # Now verify that we have 0 image queued for caching and 1"},{"line_number":154,"context_line":"        # cached images"},{"line_number":155,"context_line":"        output \u003d self.list_cache()"},{"line_number":156,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"8d03d987_b247a785","line":153,"range":{"start_line":153,"start_character":65,"end_line":153,"end_character":66},"updated":"2021-08-25 14:35:04.000000000","message":"0","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        # Delete all queued images"},{"line_number":152,"context_line":"        self.cache_clear(target\u003d\u0027queue\u0027)"},{"line_number":153,"context_line":"        # Now verify that we have 0 image queued for caching and 1"},{"line_number":154,"context_line":"        # cached images"},{"line_number":155,"context_line":"        output \u003d self.list_cache()"},{"line_number":156,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"773d0a87_11f75141","line":153,"range":{"start_line":153,"start_character":65,"end_line":153,"end_character":66},"in_reply_to":"8d03d987_b247a785","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":160,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":161,"context_line":"        self.cache_image()"},{"line_number":162,"context_line":"        # Delete all cached images"},{"line_number":163,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":164,"context_line":"        # Now verify that we have 0 image queued for caching and 0"},{"line_number":165,"context_line":"        # cached images"},{"line_number":166,"context_line":"        output \u003d self.list_cache()"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba509f4a_7b1b057e","line":163,"updated":"2021-08-25 14:35:04.000000000","message":"Shouldn\u0027t you validate that it\u0027s cached before you clear it and assert it\u0027s gone?","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3f6cefc6f36462c0aad907248cfa91efb5f0bba8","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":161,"context_line":"        self.cache_image()"},{"line_number":162,"context_line":"        # Delete all cached images"},{"line_number":163,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":164,"context_line":"        # Now verify that we have 0 image queued for caching and 0"},{"line_number":165,"context_line":"        # cached images"},{"line_number":166,"context_line":"        output \u003d self.list_cache()"}],"source_content_type":"text/x-python","patch_set":11,"id":"dd682bbd_36eba958","line":163,"in_reply_to":"a248b48a_f508065f","updated":"2021-08-25 21:31:43.000000000","message":"Sure, but what you\u0027re testing here is that L163 removes images that are queued by L160 and cached by L161. Especially since L161 does no validation, if there was some bug that caused that to fail such that there was nothing actually queued in the first place, or cached after that ran, the following assertion that all the lists are empty would fail to detect that something had gone wrong. Sure, you can assume that because we tested it once above that it will work forever, but it\u0027s easy to imagine cases where it could fail subsequently. It\u0027s just a couple lines to make this fully airtight.","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"d4b088a708246dab8e7603265cfead310b6bca55","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":161,"context_line":"        self.cache_image()"},{"line_number":162,"context_line":"        # Delete all cached images"},{"line_number":163,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":164,"context_line":"        # Now verify that we have 0 image queued for caching and 0"},{"line_number":165,"context_line":"        # cached images"},{"line_number":166,"context_line":"        output \u003d self.list_cache()"}],"source_content_type":"text/x-python","patch_set":11,"id":"a248b48a_f508065f","line":163,"in_reply_to":"ba509f4a_7b1b057e","updated":"2021-08-25 18:54:50.000000000","message":"Why? We do already verify on L115 \u0026 L117 that it works, now we just put something into the cache to make sure it\u0027s cleared after the cache_clear call.","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":185,"context_line":"        # cached images"},{"line_number":186,"context_line":"        output \u003d self.list_cache()"},{"line_number":187,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":188,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"f8b5c5a9_963dd465","line":188,"updated":"2021-08-25 14:35:04.000000000","message":"This is just an API operation -- I assume that the prefetcher would actually clean up those images after the next run? Can we do any asserting about the behavior of that before and after it runs for any of these cases?","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # cached images"},{"line_number":186,"context_line":"        output \u003d self.list_cache()"},{"line_number":187,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":188,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"5b509d70_ab8e8082","line":188,"in_reply_to":"5582ff65_5ee96fd4","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3f6cefc6f36462c0aad907248cfa91efb5f0bba8","unresolved":true,"context_lines":[{"line_number":185,"context_line":"        # cached images"},{"line_number":186,"context_line":"        output \u003d self.list_cache()"},{"line_number":187,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":188,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"5582ff65_5ee96fd4","line":188,"in_reply_to":"cb3715f9_40419109","updated":"2021-08-25 21:31:43.000000000","message":"This is a functional test, not just a unit test. We\u0027re calling the prefetcher and depending on its behavior. I\u0027m asking if it\u0027s possible to make sure that that after we say that an image should no longer be cached, that a subsequent run of the prefetcher notices that and does the right thing. Just because the api marks something as \"no longer needs to be cached\" and is internally consistent doesn\u0027t mean that the prefetcher agrees, does as its told, etc. Above we\u0027re asserting that it moves things from queued to cached, but then when we clear the cached or queued lists, we\u0027re not asserting that it similarly does what we expect.","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"d4b088a708246dab8e7603265cfead310b6bca55","unresolved":true,"context_lines":[{"line_number":185,"context_line":"        # cached images"},{"line_number":186,"context_line":"        output \u003d self.list_cache()"},{"line_number":187,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":188,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"cb3715f9_40419109","line":188,"in_reply_to":"f8b5c5a9_963dd465","updated":"2021-08-25 18:54:50.000000000","message":"Yes these are the management API tests so they will indeed test the API operations. I totally lost you after that. The prefetcher would indeed clean the queue and cache would have 4 images after the next run, but this part of the test is specifically checking that the cache_clear without target does clear both queue and cache. So what API behaviour we\u0027re missing here?","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestImageCache(functional.SynchronousAPIBase):"},{"line_number":22,"context_line":"    # ToDo(abhishekk): Once system scope is enabled and RBAC is fully"},{"line_number":23,"context_line":"    # supported, enable these tests for RBAC as well"},{"line_number":24,"context_line":"    def setUp(self):"},{"line_number":25,"context_line":"        super(TestImageCache, self).setUp()"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"21621fb6_5f69983a","line":23,"updated":"2021-08-27 14:13:04.000000000","message":"In addition to these scenarios we need to validate than non-admin role will be forbidden to perform these actions.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestImageCache(functional.SynchronousAPIBase):"},{"line_number":22,"context_line":"    # ToDo(abhishekk): Once system scope is enabled and RBAC is fully"},{"line_number":23,"context_line":"    # supported, enable these tests for RBAC as well"},{"line_number":24,"context_line":"    def setUp(self):"},{"line_number":25,"context_line":"        super(TestImageCache, self).setUp()"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"0a3e0f3e_d361b4f4","line":23,"in_reply_to":"21621fb6_5f69983a","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":75,"context_line":"        headers \u003d {}"},{"line_number":76,"context_line":"        if target:"},{"line_number":77,"context_line":"            headers[\u0027x-image-cache-clear-target\u0027] \u003d target"},{"line_number":78,"context_line":"        response \u003d self.api_delete(path, headers\u003dheaders)"},{"line_number":79,"context_line":"        if target not in (\u0027\u0027, \u0027cache\u0027, \u0027queue\u0027):"},{"line_number":80,"context_line":"            self.assertEqual(400, response.status_code)"},{"line_number":81,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"74e0161c_b3318068","line":78,"updated":"2021-08-26 15:25:18.000000000","message":"Again, response is not validated.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"12b23405a7b102596d5e79dfee8958d0d49c6845","unresolved":true,"context_lines":[{"line_number":75,"context_line":"        headers \u003d {}"},{"line_number":76,"context_line":"        if target:"},{"line_number":77,"context_line":"            headers[\u0027x-image-cache-clear-target\u0027] \u003d target"},{"line_number":78,"context_line":"        response \u003d self.api_delete(path, headers\u003dheaders)"},{"line_number":79,"context_line":"        if target not in (\u0027\u0027, \u0027cache\u0027, \u0027queue\u0027):"},{"line_number":80,"context_line":"            self.assertEqual(400, response.status_code)"},{"line_number":81,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"8d4c51ee_601eacf7","line":78,"in_reply_to":"4a10398a_510229ce","updated":"2021-08-27 14:51:57.000000000","message":"It\u0027s validating the return code, but not the data structure (as mentioned in my review on the previous set).","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":75,"context_line":"        headers \u003d {}"},{"line_number":76,"context_line":"        if target:"},{"line_number":77,"context_line":"            headers[\u0027x-image-cache-clear-target\u0027] \u003d target"},{"line_number":78,"context_line":"        response \u003d self.api_delete(path, headers\u003dheaders)"},{"line_number":79,"context_line":"        if target not in (\u0027\u0027, \u0027cache\u0027, \u0027queue\u0027):"},{"line_number":80,"context_line":"            self.assertEqual(400, response.status_code)"},{"line_number":81,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"4a10398a_510229ce","line":78,"in_reply_to":"74e0161c_b3318068","updated":"2021-08-27 14:13:04.000000000","message":"line #80 and #82 ?\nor you expecting something else?","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        headers \u003d {}"},{"line_number":76,"context_line":"        if target:"},{"line_number":77,"context_line":"            headers[\u0027x-image-cache-clear-target\u0027] \u003d target"},{"line_number":78,"context_line":"        response \u003d self.api_delete(path, headers\u003dheaders)"},{"line_number":79,"context_line":"        if target not in (\u0027\u0027, \u0027cache\u0027, \u0027queue\u0027):"},{"line_number":80,"context_line":"            self.assertEqual(400, response.status_code)"},{"line_number":81,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1caa0608_dbb7e02e","line":78,"in_reply_to":"8d4c51ee_601eacf7","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":106,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"},{"line_number":107,"context_line":"        # Verify same image is queued for caching"},{"line_number":108,"context_line":"        self.assertIn(images[\u0027public\u0027], output[\u0027queued_images\u0027])"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        # Cache the image"},{"line_number":111,"context_line":"        self.cache_image()"},{"line_number":112,"context_line":"        # Now verify that we have 0 queued image and 1 cached image"}],"source_content_type":"text/x-python","patch_set":12,"id":"e45ccc4b_0f1613b8","line":109,"updated":"2021-08-27 14:13:04.000000000","message":"I don\u0027t know why you removed the behavior which I was asserting that passing non existing image to queue doesn\u0027t validate it and puts it in the queue.\n\nI know that you have reported the bug for the same, but I think instead of removing it now we should change the result when we fix the bug.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"},{"line_number":107,"context_line":"        # Verify same image is queued for caching"},{"line_number":108,"context_line":"        self.assertIn(images[\u0027public\u0027], output[\u0027queued_images\u0027])"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        # Cache the image"},{"line_number":111,"context_line":"        self.cache_image()"},{"line_number":112,"context_line":"        # Now verify that we have 0 queued image and 1 cached image"}],"source_content_type":"text/x-python","patch_set":12,"id":"77a42636_bc11e910","line":109,"in_reply_to":"e45ccc4b_0f1613b8","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        # Queue and cache image so we have something to clear"},{"line_number":160,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":161,"context_line":"        self.cache_image()"},{"line_number":162,"context_line":"        # Delete all cached images"},{"line_number":163,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":164,"context_line":"        # Now verify that we have 0 image queued for caching and 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"80f3492b_c6ef8c76","line":161,"updated":"2021-08-26 15:25:18.000000000","message":"As before, missing validation that the system is actually in the state we want:\n\n output \u003d self.list_cache()\n self.assertEqual(0, len(output[\u0027queued_images\u0027]))\n self.assertEqual(1, len(output[\u0027cached_images\u0027]))","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        # Queue and cache image so we have something to clear"},{"line_number":160,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":161,"context_line":"        self.cache_image()"},{"line_number":162,"context_line":"        # Delete all cached images"},{"line_number":163,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":164,"context_line":"        # Now verify that we have 0 image queued for caching and 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"119eb61d_c4046259","line":161,"in_reply_to":"04c710e9_e691a32e","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        # Queue and cache image so we have something to clear"},{"line_number":160,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":161,"context_line":"        self.cache_image()"},{"line_number":162,"context_line":"        # Delete all cached images"},{"line_number":163,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":164,"context_line":"        # Now verify that we have 0 image queued for caching and 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"04c710e9_e691a32e","line":161,"in_reply_to":"80f3492b_c6ef8c76","updated":"2021-08-27 14:13:04.000000000","message":"++","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":185,"context_line":"        # cached images"},{"line_number":186,"context_line":"        output \u003d self.list_cache()"},{"line_number":187,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":188,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":12,"id":"af4d8a2a_68023157","line":188,"updated":"2021-08-26 15:25:18.000000000","message":"Needs: \n\n self.cache_image()\n # some sort of validation?","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # cached images"},{"line_number":186,"context_line":"        output \u003d self.list_cache()"},{"line_number":187,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":188,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":12,"id":"69d44b6b_9dd50825","line":188,"in_reply_to":"157fc572_4929a7c6","updated":"2022-01-27 08:39:43.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":185,"context_line":"        # cached images"},{"line_number":186,"context_line":"        output \u003d self.list_cache()"},{"line_number":187,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":188,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":12,"id":"157fc572_4929a7c6","line":188,"in_reply_to":"af4d8a2a_68023157","updated":"2021-08-27 14:13:04.000000000","message":"++","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":true,"context_lines":[{"line_number":237,"context_line":"        self.cache_image()"},{"line_number":238,"context_line":"        output \u003d self.list_cache()"},{"line_number":239,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":240,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test_cache_api_cache_disabled(self):"},{"line_number":243,"context_line":"        self.start_server(enable_cache\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7bc3965a_02b2c9a6","line":240,"updated":"2022-01-26 16:29:28.000000000","message":"I might be missing it in this very long image lifecycle test, but.. I don\u0027t think there\u0027s a case here of \"create image, cache image, delete image\" and then either \"verify image is gone from cache list\" or \"remove image from cache list\".","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5e67fd0d41044a53a23204199dce93c19eb5331e","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        self.cache_image()"},{"line_number":238,"context_line":"        output \u003d self.list_cache()"},{"line_number":239,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":240,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test_cache_api_cache_disabled(self):"},{"line_number":243,"context_line":"        self.start_server(enable_cache\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":16,"id":"0f7aa374_95cb136e","line":240,"in_reply_to":"7bc3965a_02b2c9a6","updated":"2022-01-27 08:39:43.000000000","message":"I have added two new tests to verify these scenarios","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b053a822c2b54bcc2aa508b91a96a7489eb66e55","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    def test_cache_image_queue_delete(self):"},{"line_number":243,"context_line":"        # This test verifies that if image is queued for caching"},{"line_number":244,"context_line":"        # and user deletes the original image, but it is still"},{"line_number":245,"context_line":"        # present in queued list and deleted with cache-delete ap"},{"line_number":246,"context_line":"        self.start_server(enable_cache\u003dTrue)"},{"line_number":247,"context_line":"        images \u003d self.load_data()"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9489d616_f010a650","line":245,"range":{"start_line":245,"start_character":63,"end_line":245,"end_character":65},"updated":"2022-01-31 16:16:27.000000000","message":"op?","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":242,"context_line":"    def test_cache_image_queue_delete(self):"},{"line_number":243,"context_line":"        # This test verifies that if image is queued for caching"},{"line_number":244,"context_line":"        # and user deletes the original image, but it is still"},{"line_number":245,"context_line":"        # present in queued list and deleted with cache-delete ap"},{"line_number":246,"context_line":"        self.start_server(enable_cache\u003dTrue)"},{"line_number":247,"context_line":"        images \u003d self.load_data()"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"4eaf95cc_cb328aa7","line":245,"range":{"start_line":245,"start_character":63,"end_line":245,"end_character":65},"in_reply_to":"019cc22a_5810111c","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"45457e22048bd8d74281b64c846dbadfe8b6c22d","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    def test_cache_image_queue_delete(self):"},{"line_number":243,"context_line":"        # This test verifies that if image is queued for caching"},{"line_number":244,"context_line":"        # and user deletes the original image, but it is still"},{"line_number":245,"context_line":"        # present in queued list and deleted with cache-delete ap"},{"line_number":246,"context_line":"        self.start_server(enable_cache\u003dTrue)"},{"line_number":247,"context_line":"        images \u003d self.load_data()"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"019cc22a_5810111c","line":245,"range":{"start_line":245,"start_character":63,"end_line":245,"end_character":65},"in_reply_to":"9489d616_f010a650","updated":"2022-01-31 16:23:44.000000000","message":"API :D","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b053a822c2b54bcc2aa508b91a96a7489eb66e55","unresolved":true,"context_lines":[{"line_number":280,"context_line":"    def test_cache_image_cache_delete(self):"},{"line_number":281,"context_line":"        # This test verifies that if image is queued for caching"},{"line_number":282,"context_line":"        # and user deletes the original image, but it is still"},{"line_number":283,"context_line":"        # present in queued list and deleted with cache-delete ap"},{"line_number":284,"context_line":"        self.start_server(enable_cache\u003dTrue)"},{"line_number":285,"context_line":"        images \u003d self.load_data()"},{"line_number":286,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"2084963b_b45dd09c","line":283,"range":{"start_line":283,"start_character":63,"end_line":283,"end_character":65},"updated":"2022-01-31 16:16:27.000000000","message":"op?","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"45457e22048bd8d74281b64c846dbadfe8b6c22d","unresolved":true,"context_lines":[{"line_number":280,"context_line":"    def test_cache_image_cache_delete(self):"},{"line_number":281,"context_line":"        # This test verifies that if image is queued for caching"},{"line_number":282,"context_line":"        # and user deletes the original image, but it is still"},{"line_number":283,"context_line":"        # present in queued list and deleted with cache-delete ap"},{"line_number":284,"context_line":"        self.start_server(enable_cache\u003dTrue)"},{"line_number":285,"context_line":"        images \u003d self.load_data()"},{"line_number":286,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"e37cc69f_5955ffac","line":283,"range":{"start_line":283,"start_character":63,"end_line":283,"end_character":65},"in_reply_to":"2084963b_b45dd09c","updated":"2022-01-31 16:23:44.000000000","message":"API","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":280,"context_line":"    def test_cache_image_cache_delete(self):"},{"line_number":281,"context_line":"        # This test verifies that if image is queued for caching"},{"line_number":282,"context_line":"        # and user deletes the original image, but it is still"},{"line_number":283,"context_line":"        # present in queued list and deleted with cache-delete ap"},{"line_number":284,"context_line":"        self.start_server(enable_cache\u003dTrue)"},{"line_number":285,"context_line":"        images \u003d self.load_data()"},{"line_number":286,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"8b218eb0_b9b218ca","line":283,"range":{"start_line":283,"start_character":63,"end_line":283,"end_character":65},"in_reply_to":"e37cc69f_5955ffac","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"eb7abafba7f364a7d0922171d7134ed28a7b8939"}],"glance/tests/unit/test_cached_images.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":true,"context_lines":[{"line_number":288,"context_line":"                mock_get.return_value \u003d FakeImage(status\u003dstatus)"},{"line_number":289,"context_line":"                self.assertRaises(webob.exc.HTTPBadRequest,"},{"line_number":290,"context_line":"                                  self.controller.queue_image,"},{"line_number":291,"context_line":"                                  req, image_id\u003dUUID4)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def test_queue_non_existing_image(self):"},{"line_number":294,"context_line":"        self.config(image_cache_dir\u003d\u0027fake_cache_directory\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"c6099bd0_37bee930","line":291,"updated":"2022-01-26 16:29:28.000000000","message":"++","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":288,"context_line":"                mock_get.return_value \u003d FakeImage(status\u003dstatus)"},{"line_number":289,"context_line":"                self.assertRaises(webob.exc.HTTPBadRequest,"},{"line_number":290,"context_line":"                                  self.controller.queue_image,"},{"line_number":291,"context_line":"                                  req, image_id\u003dUUID4)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def test_queue_non_existing_image(self):"},{"line_number":294,"context_line":"        self.config(image_cache_dir\u003d\u0027fake_cache_directory\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"8e95a7c9_761b7b0b","line":291,"in_reply_to":"c6099bd0_37bee930","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40687818f1e155d68345dcfc9f0501ae9103ef5d","unresolved":true,"context_lines":[{"line_number":295,"context_line":"        req \u003d unit_test_utils.get_fake_request()"},{"line_number":296,"context_line":"        self.assertRaises(webob.exc.HTTPNotFound,"},{"line_number":297,"context_line":"                          self.controller.queue_image,"},{"line_number":298,"context_line":"                          req, image_id\u003d\u0027non-existing-image-id\u0027)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def test_delete_queued_image_disabled(self):"},{"line_number":301,"context_line":"        req \u003d webob.Request.blank(\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"687922dc_eb677caf","line":298,"updated":"2022-01-26 16:29:28.000000000","message":"++","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        req \u003d unit_test_utils.get_fake_request()"},{"line_number":296,"context_line":"        self.assertRaises(webob.exc.HTTPNotFound,"},{"line_number":297,"context_line":"                          self.controller.queue_image,"},{"line_number":298,"context_line":"                          req, image_id\u003d\u0027non-existing-image-id\u0027)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def test_delete_queued_image_disabled(self):"},{"line_number":301,"context_line":"        req \u003d webob.Request.blank(\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"258e21cb_ceacaea8","line":298,"in_reply_to":"687922dc_eb677caf","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"2151c052b10ca3f4cda9d420ba84f4946bbd4a6f"}],"glance/tests/unit/v2/test_cache_management_api.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"37c155153b505946d481ae43b39db11ad55a0e14","unresolved":true,"context_lines":[{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"},{"line_number":60,"context_line":"                                \u0027delete_cache_entry\u0027,"},{"line_number":61,"context_line":"                                \u0027cache_delete\u0027,"},{"line_number":62,"context_line":"                                UUID1])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_clear_cache(self):"},{"line_number":65,"context_line":"        self._main_test_helper("}],"source_content_type":"text/x-python","patch_set":7,"id":"683c1c67_d8cc03c0","line":62,"range":{"start_line":59,"start_character":8,"end_line":62,"end_character":39},"updated":"2021-08-06 05:45:49.000000000","message":"looks like, you are testing old + new behaviour at same time.\nSome commenting in _main_test_helper will help to understand what exactly is happening there.\nAlso I think this is positive coverage, we need to cover for negative scenarios as well.","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"e7d5b708954a10d092d3d4f52106146f8e88cbfd","unresolved":true,"context_lines":[{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"},{"line_number":60,"context_line":"                                \u0027delete_cache_entry\u0027,"},{"line_number":61,"context_line":"                                \u0027cache_delete\u0027,"},{"line_number":62,"context_line":"                                UUID1])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_clear_cache(self):"},{"line_number":65,"context_line":"        self._main_test_helper("}],"source_content_type":"text/x-python","patch_set":7,"id":"f5059c4c_5bcfa9ee","line":62,"range":{"start_line":59,"start_character":8,"end_line":62,"end_character":39},"in_reply_to":"683c1c67_d8cc03c0","updated":"2021-08-06 10:31:51.000000000","message":"Nope, this tests all and only the new functions of CacheController.\nImageCache is mocked on L33 and overriden to be used in L35. L37-39 creates the ImageCache mocked functions named on the first element of the input list, CSV of the ImageCache function names we expect the cache controller to call. These functions are not altered, so testing them as part of this change would just introduce redundancy.\nThe second element is the function to be tested picked from the actual controller object (L40) which has only the cache and _enforce mocked, so all of it\u0027s controller functions executed are the actual code we are testing.\nThird element is the new policy rule which we ensure gets passed to (L46) the mocked (L32) _enforce after the tested function is called (L45). args being a list passed as positional arguments to the test call makes sure the needed arguments are passed (extra or missing elements in this list would cause syntax fault as all input parameters are defined).\nL47-55 ensures that we called those ImageCache functions with correct parameters when applicable (the UUID1 which is the last element of this list as well as the queue test L75-79).\nFinally on L56 we make sure we did not miss any calls to the ImageCache, or in other words all the calls to it were accounted for in the verification above.","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"},{"line_number":60,"context_line":"                                \u0027delete_cache_entry\u0027,"},{"line_number":61,"context_line":"                                \u0027cache_delete\u0027,"},{"line_number":62,"context_line":"                                UUID1])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def test_clear_cache(self):"},{"line_number":65,"context_line":"        self._main_test_helper("}],"source_content_type":"text/x-python","patch_set":7,"id":"5dbe500c_465b8334","line":62,"range":{"start_line":59,"start_character":8,"end_line":62,"end_character":39},"in_reply_to":"f5059c4c_5bcfa9ee","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"2174017f9ea4af4a88c1b6e0443395a4bcdf5b5f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def _main_test_helper(self, argv):"},{"line_number":32,"context_line":"        with mock.patch.object(cached_images.CacheController, \u0027_enforce\u0027) as e:"},{"line_number":33,"context_line":"            with mock.patch(\u0027glance.image_cache.ImageCache\u0027) as ic:"},{"line_number":34,"context_line":"                cc \u003d cached_images.CacheController()"},{"line_number":35,"context_line":"                cc.cache \u003d ic"},{"line_number":36,"context_line":"                c_calls \u003d []"}],"source_content_type":"text/x-python","patch_set":11,"id":"da6ce624_d589c14b","line":33,"updated":"2021-08-25 14:35:04.000000000","message":"I would put these as decorators on this method, or move the body into a second-level helper just to keep the indenting down.","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def _main_test_helper(self, argv):"},{"line_number":32,"context_line":"        with mock.patch.object(cached_images.CacheController, \u0027_enforce\u0027) as e:"},{"line_number":33,"context_line":"            with mock.patch(\u0027glance.image_cache.ImageCache\u0027) as ic:"},{"line_number":34,"context_line":"                cc \u003d cached_images.CacheController()"},{"line_number":35,"context_line":"                cc.cache \u003d ic"},{"line_number":36,"context_line":"                c_calls \u003d []"}],"source_content_type":"text/x-python","patch_set":11,"id":"2b48dbed_e5bc3e1e","line":33,"in_reply_to":"da6ce624_d589c14b","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d0f0ea84f8fa7bf5af5bde24bed360c8ecb45b96","unresolved":true,"context_lines":[{"line_number":53,"context_line":"                    elif args[0] and not args[0].endswith(\"\u0027\"):"},{"line_number":54,"context_line":"                        args[0] \u003d \"\u0027\" + args[0] + \"\u0027\""},{"line_number":55,"context_line":"                    self.assertIn(\"call.\" + call + \"(\" + args[0] + \")\", mcs)"},{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"568b6d6d_f01a9824","line":56,"updated":"2021-08-25 14:35:04.000000000","message":"This is all pretty hard to follow and fairly obscure. I\u0027m not sure it\u0027s really saving much in terms of code to have this all squashed together and it\u0027s definitely not making it easier to read. Can\u0027t this be unwound a bit, even if it means largely just duplicating some work in the actual tests?","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                    elif args[0] and not args[0].endswith(\"\u0027\"):"},{"line_number":54,"context_line":"                        args[0] \u003d \"\u0027\" + args[0] + \"\u0027\""},{"line_number":55,"context_line":"                    self.assertIn(\"call.\" + call + \"(\" + args[0] + \")\", mcs)"},{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"15006ea6_9801dd15","line":56,"in_reply_to":"568b6d6d_f01a9824","updated":"2022-02-01 05:56:16.000000000","message":"Ack","commit_id":"8b7d7048f793d650d21a946247d78c95e7fb2064"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"69864baa04b7fc31ba9cea1cf77642991b719167","unresolved":true,"context_lines":[{"line_number":53,"context_line":"                    elif args[0] and not args[0].endswith(\"\u0027\"):"},{"line_number":54,"context_line":"                        args[0] \u003d \"\u0027\" + args[0] + \"\u0027\""},{"line_number":55,"context_line":"                    self.assertIn(\"call.\" + call + \"(\" + args[0] + \")\", mcs)"},{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"04055335_96250be6","line":56,"updated":"2021-08-26 15:25:18.000000000","message":"I didn\u0027t see any response to my prior comment about this, so I\u0027ll just say again: I think this is convoluted and hard to follow and should be cleaned up.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"be49ba5dbaf0ef05d454597c9f574a0ff7c9ebe5","unresolved":true,"context_lines":[{"line_number":53,"context_line":"                    elif args[0] and not args[0].endswith(\"\u0027\"):"},{"line_number":54,"context_line":"                        args[0] \u003d \"\u0027\" + args[0] + \"\u0027\""},{"line_number":55,"context_line":"                    self.assertIn(\"call.\" + call + \"(\" + args[0] + \")\", mcs)"},{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"164ccf67_2e2bb057","line":56,"in_reply_to":"04055335_96250be6","updated":"2021-08-27 13:17:43.000000000","message":"Sorry, I think I referred to this during the weekly meeting. IMO debating of the merits to duplicate unittest code is great opportunity for the followup patch if we want this feature in the release.\n\nI would welcome you to take over and write the unittests how ever you want, but we\u0027re running out of cores to review the feature this being already co-author between myself and Abhishek and I think Abhishek has more important things to do before FF in rbac and policy refactoring. Feel free to coordinate between yourselves what you want to do about this.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4f6599358f40507f9085782db8836694e6c5b00d","unresolved":true,"context_lines":[{"line_number":53,"context_line":"                    elif args[0] and not args[0].endswith(\"\u0027\"):"},{"line_number":54,"context_line":"                        args[0] \u003d \"\u0027\" + args[0] + \"\u0027\""},{"line_number":55,"context_line":"                    self.assertIn(\"call.\" + call + \"(\" + args[0] + \")\", mcs)"},{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"45d9bad6_7cce3db4","line":56,"in_reply_to":"164ccf67_2e2bb057","updated":"2021-08-27 14:13:04.000000000","message":"We need some negative validation tests as well.\nAnd as erno pointed out how busy we are in policy and rbac stuff, I will see if I get some time to work on this and decide accordingly.","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"20c4cbccdcfb6f2535b3976c988e8ef825853932","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                    elif args[0] and not args[0].endswith(\"\u0027\"):"},{"line_number":54,"context_line":"                        args[0] \u003d \"\u0027\" + args[0] + \"\u0027\""},{"line_number":55,"context_line":"                    self.assertIn(\"call.\" + call + \"(\" + args[0] + \")\", mcs)"},{"line_number":56,"context_line":"                self.assertEqual(len(c_calls), len(mcs))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_delete_cache_entry(self):"},{"line_number":59,"context_line":"        self._main_test_helper([\u0027delete_cached_image,delete_queued_image\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"5c05ad5d_12556b1d","line":56,"in_reply_to":"45d9bad6_7cce3db4","updated":"2022-02-01 05:56:16.000000000","message":"Done","commit_id":"b329da3f30edd658ee362baa87078eef7787760f"}],"releasenotes/notes/cache-api-b806ccfb8c5d9bb6.yaml":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a57a5e09f5335a6fe0ad5ee14d2e2a6fea132b32","unresolved":true,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"21c0d46a_fdfb2101","line":5,"range":{"start_line":5,"start_character":35,"end_line":5,"end_character":48},"updated":"2022-02-02 16:37:27.000000000","message":"\"administrators\"","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a57a5e09f5335a6fe0ad5ee14d2e2a6fea132b32","unresolved":true,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"50b63cc2_79856dcd","line":5,"range":{"start_line":5,"start_character":58,"end_line":5,"end_character":64},"updated":"2022-02-02 16:37:27.000000000","message":"\"images\"","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a57a5e09f5335a6fe0ad5ee14d2e2a6fea132b32","unresolved":true,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"c099f30e_1f58d246","line":5,"range":{"start_line":5,"start_character":12,"end_line":5,"end_character":14},"updated":"2022-02-02 16:37:27.000000000","message":"\"of the\"","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"963b23b23718a59d124b7206874a4508d34de3d5","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"fe162767_ef1c8392","line":5,"range":{"start_line":5,"start_character":35,"end_line":5,"end_character":48},"in_reply_to":"21c0d46a_fdfb2101","updated":"2022-02-02 16:48:37.000000000","message":"Done","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"963b23b23718a59d124b7206874a4508d34de3d5","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"55fd8b49_cf37bc00","line":5,"range":{"start_line":5,"start_character":58,"end_line":5,"end_character":64},"in_reply_to":"50b63cc2_79856dcd","updated":"2022-02-02 16:48:37.000000000","message":"Done","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"963b23b23718a59d124b7206874a4508d34de3d5","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"6a16c3f0_0b7a24de","line":5,"range":{"start_line":5,"start_character":12,"end_line":5,"end_character":14},"in_reply_to":"c099f30e_1f58d246","updated":"2022-02-02 16:48:37.000000000","message":"Done","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a57a5e09f5335a6fe0ad5ee14d2e2a6fea132b32","unresolved":true,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"aeeca3cd_52713c04","line":6,"range":{"start_line":6,"start_character":11,"end_line":6,"end_character":15},"updated":"2022-02-02 16:37:27.000000000","message":"\"nodes\"","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a57a5e09f5335a6fe0ad5ee14d2e2a6fea132b32","unresolved":true,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"00183d38_1be4ad33","line":6,"range":{"start_line":6,"start_character":72,"end_line":6,"end_character":78},"updated":"2022-02-02 16:37:27.000000000","message":"\"section\"","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"963b23b23718a59d124b7206874a4508d34de3d5","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"0c1c4894_787a9645","line":6,"range":{"start_line":6,"start_character":72,"end_line":6,"end_character":78},"in_reply_to":"00183d38_1be4ad33","updated":"2022-02-02 16:48:37.000000000","message":"Done","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"963b23b23718a59d124b7206874a4508d34de3d5","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of cache API will help administrator to cache imgaes on dedicated"},{"line_number":6,"context_line":"    glance node as well. For more information, see the ``Cache Manage`` setion"},{"line_number":7,"context_line":"    in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":18,"id":"e7f7295f_2148fd24","line":6,"range":{"start_line":6,"start_character":11,"end_line":6,"end_character":15},"in_reply_to":"aeeca3cd_52713c04","updated":"2022-02-02 16:48:37.000000000","message":"Done","commit_id":"97d7f767f65a9a6227e41ae92ed172da9f348f47"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55a4a9f40522129b90930319bc1411dd3a8b7c9a","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":19,"id":"1cb87bad_ae1ef986","line":9,"updated":"2022-02-09 17:58:03.000000000","message":"Did you mean to remove this from the latest version?","commit_id":"66663ba08122dbf79143b4ffb05bc7ac70a40b7c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ec51fcd968a349ccf8364f7d597287bc69b16d6e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"85cead99_2193e7e5","line":9,"in_reply_to":"1cb87bad_ae1ef986","updated":"2022-02-09 18:09:25.000000000","message":"Nope, removed by mistake.","commit_id":"66663ba08122dbf79143b4ffb05bc7ac70a40b7c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"273f6b9e2a3f3cac5ea145f3f90290bbbaa599f6","unresolved":true,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of th cache API will help administrators to cache images on"},{"line_number":6,"context_line":"    dedicated glance nodes as well. For more information, see the"},{"line_number":7,"context_line":"    ``Cache Manage`` section in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":21,"id":"38fa2c36_a1344892","line":5,"range":{"start_line":5,"start_character":15,"end_line":5,"end_character":17},"updated":"2022-02-09 18:15:31.000000000","message":"\"the\"","commit_id":"8548ee9117bc5306e1e97c6afb7d82051e3c282b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"42943def02ef887368e0b20ba16b3f34dfd3cbac","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This release introduces new APIs for cache related operations. This new"},{"line_number":5,"context_line":"    version of th cache API will help administrators to cache images on"},{"line_number":6,"context_line":"    dedicated glance nodes as well. For more information, see the"},{"line_number":7,"context_line":"    ``Cache Manage`` section in the `api-ref"},{"line_number":8,"context_line":"    \u003chttps://developer.openstack.org/api-ref/image/v2/index.html#cache-manage\u003e`_."}],"source_content_type":"text/x-yaml","patch_set":21,"id":"519352ee_c2101cd1","line":5,"range":{"start_line":5,"start_character":15,"end_line":5,"end_character":17},"in_reply_to":"38fa2c36_a1344892","updated":"2022-02-09 18:17:25.000000000","message":"Done","commit_id":"8548ee9117bc5306e1e97c6afb7d82051e3c282b"}]}
