)]}'
{"glance/api/v2/metadef_resource_types.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"84b4e24a223c8ec1c8734989e0a3ec8b676c5a91","unresolved":true,"context_lines":[{"line_number":199,"context_line":"            msg \u003d (_(\"Failed to find resource type %(resourcetype)s to \""},{"line_number":200,"context_line":"                     \"delete\") % {\u0027resourcetype\u0027: resource_type})"},{"line_number":201,"context_line":"            if e.msg:"},{"line_number":202,"context_line":"                msg \u003d e.msg"},{"line_number":203,"context_line":"            LOG.error(msg)"},{"line_number":204,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"1174e1e9_80c96f0b","line":202,"updated":"2021-08-11 17:02:06.000000000","message":"Why do we need this? If we do, I don\u0027t see a test for it.","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"260deb47dc1a31e9ba0607c792670d04f4754345","unresolved":true,"context_lines":[{"line_number":199,"context_line":"            msg \u003d (_(\"Failed to find resource type %(resourcetype)s to \""},{"line_number":200,"context_line":"                     \"delete\") % {\u0027resourcetype\u0027: resource_type})"},{"line_number":201,"context_line":"            if e.msg:"},{"line_number":202,"context_line":"                msg \u003d e.msg"},{"line_number":203,"context_line":"            LOG.error(msg)"},{"line_number":204,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3905e30d_dd848b18","line":202,"in_reply_to":"050ca0b7_fad368a3","updated":"2021-08-11 17:29:40.000000000","message":"Looking at how we are deleting resource_type and raising not found above, I don\u0027t think previously that was the case. I just made it for current change.","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b084cee4bd51b36466b77af492b0e51c0d51d7ed","unresolved":true,"context_lines":[{"line_number":199,"context_line":"            msg \u003d (_(\"Failed to find resource type %(resourcetype)s to \""},{"line_number":200,"context_line":"                     \"delete\") % {\u0027resourcetype\u0027: resource_type})"},{"line_number":201,"context_line":"            if e.msg:"},{"line_number":202,"context_line":"                msg \u003d e.msg"},{"line_number":203,"context_line":"            LOG.error(msg)"},{"line_number":204,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"6b0619bb_468d8bc4","line":202,"in_reply_to":"1174e1e9_80c96f0b","updated":"2021-08-11 17:06:58.000000000","message":"Exception raised with custom message at line #172 will be lost here and user will be mislead with wrong message.\n\nTo avoid this I need to move it out of parent try, catch forbidden and not found both and raise webob.exc.HTTPNotFound","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2427a21913a3f16a7b8078e19f9e230dc28cfedd","unresolved":true,"context_lines":[{"line_number":199,"context_line":"            msg \u003d (_(\"Failed to find resource type %(resourcetype)s to \""},{"line_number":200,"context_line":"                     \"delete\") % {\u0027resourcetype\u0027: resource_type})"},{"line_number":201,"context_line":"            if e.msg:"},{"line_number":202,"context_line":"                msg \u003d e.msg"},{"line_number":203,"context_line":"            LOG.error(msg)"},{"line_number":204,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"45c11cd6_9d5bd389","line":202,"in_reply_to":"3905e30d_dd848b18","updated":"2021-08-11 19:04:03.000000000","message":"Okay, point being this isn\u0027t covered by any test. I downloaded this, added an else statement and a raise and it doesn\u0027t get hit, in any unit or functional test. That means L199 is dead code. Can we either just always take e.msg or figure out some way to get a test case to not run the body of that if? Come to think of it, isn\u0027t e.msg always going to be non-None?\n\nhttps://github.com/openstack/glance/blob/8767489f7b8f8c98d402ab77e8a34a6445e25a04/glance/common/exception.py#L42-L54","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2e7b031c4f9cd321d13f5793d461d16b26f480ca","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            msg \u003d (_(\"Failed to find resource type %(resourcetype)s to \""},{"line_number":200,"context_line":"                     \"delete\") % {\u0027resourcetype\u0027: resource_type})"},{"line_number":201,"context_line":"            if e.msg:"},{"line_number":202,"context_line":"                msg \u003d e.msg"},{"line_number":203,"context_line":"            LOG.error(msg)"},{"line_number":204,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a741a8e_0c19f313","line":202,"in_reply_to":"45c11cd6_9d5bd389","updated":"2021-08-11 19:30:29.000000000","message":"Reverted it!","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bebd62d721aa82c8f7336d6dc63514a93272fdb0","unresolved":true,"context_lines":[{"line_number":199,"context_line":"            msg \u003d (_(\"Failed to find resource type %(resourcetype)s to \""},{"line_number":200,"context_line":"                     \"delete\") % {\u0027resourcetype\u0027: resource_type})"},{"line_number":201,"context_line":"            if e.msg:"},{"line_number":202,"context_line":"                msg \u003d e.msg"},{"line_number":203,"context_line":"            LOG.error(msg)"},{"line_number":204,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"050ca0b7_fad368a3","line":202,"in_reply_to":"6b0619bb_468d8bc4","updated":"2021-08-11 17:16:18.000000000","message":"well, I know, but why add it now? Is the message on L199 sometimes not accurate or is there somewhere that we raise NotFound in the lower layers with more info?","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a8e6ba4bdf0c701644a9d911f12d153341c55969","unresolved":true,"context_lines":[{"line_number":64,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.msg)"},{"line_number":65,"context_line":"        except Exception as e:"},{"line_number":66,"context_line":"            LOG.error(encodeutils.exception_to_unicode(e))"},{"line_number":67,"context_line":"            raise webob.exc.HTTPInternalServerError(e)"},{"line_number":68,"context_line":"        return resource_types"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def show(self, req, namespace):"}],"source_content_type":"text/x-python","patch_set":19,"id":"4a59908f_f1b378ac","side":"PARENT","line":67,"updated":"2021-08-16 21:48:24.000000000","message":"I think I had a similar question on a previous patch, but is there a reason why this isn\u0027t needed anymore?\n\nI\u0027m all for removing incredibly broad exception handling, but more-or-less curious what about this patch makes it possible since it\u0027s not obvious to me (or I\u0027m just dense).","commit_id":"ffe9f1456bbfc50aaa4b8d8b273af307a50f0d68"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"cb3e56e6707872c1673543fd841c582b4ac6e673","unresolved":true,"context_lines":[{"line_number":64,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.msg)"},{"line_number":65,"context_line":"        except Exception as e:"},{"line_number":66,"context_line":"            LOG.error(encodeutils.exception_to_unicode(e))"},{"line_number":67,"context_line":"            raise webob.exc.HTTPInternalServerError(e)"},{"line_number":68,"context_line":"        return resource_types"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def show(self, req, namespace):"}],"source_content_type":"text/x-python","patch_set":19,"id":"51c3e3dc_ea5d7396","side":"PARENT","line":67,"in_reply_to":"4a59908f_f1b378ac","updated":"2021-08-16 22:13:29.000000000","message":"we removed it because our new policy check at line 60 is returning webob.exc.HTTPForbidden which was getting caught here and raising 500 error.","commit_id":"ffe9f1456bbfc50aaa4b8d8b273af307a50f0d68"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"9912157a940bccbe553df8f966442feb67cac891","unresolved":false,"context_lines":[{"line_number":64,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.msg)"},{"line_number":65,"context_line":"        except Exception as e:"},{"line_number":66,"context_line":"            LOG.error(encodeutils.exception_to_unicode(e))"},{"line_number":67,"context_line":"            raise webob.exc.HTTPInternalServerError(e)"},{"line_number":68,"context_line":"        return resource_types"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def show(self, req, namespace):"}],"source_content_type":"text/x-python","patch_set":19,"id":"1fbfab34_72281e8b","side":"PARENT","line":67,"in_reply_to":"51c3e3dc_ea5d7396","updated":"2021-08-17 22:04:43.000000000","message":"Ack","commit_id":"ffe9f1456bbfc50aaa4b8d8b273af307a50f0d68"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8a3501603ae8a75e7dd6640b08e093a13360fce6","unresolved":true,"context_lines":[{"line_number":167,"context_line":"            # NOTE (abhishekk): Returning 404 Not Found as the"},{"line_number":168,"context_line":"            # namespace is outside of this user\u0027s project"},{"line_number":169,"context_line":"            msg \u003d _(\"Namespace %s not found\") % namespace"},{"line_number":170,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            # NOTE(abhishekk): Metadef resource type is created for Metadef"}],"source_content_type":"text/x-python","patch_set":21,"id":"babdaa4a_f6b785a3","line":170,"updated":"2021-08-24 15:38:02.000000000","message":"Technically we should be checking api_pol.get_metadef_namespace() to decide whether or not to raise not found right? I think this does the thing we want today, because everything is admin-only so you can never be allowed to see someone else\u0027s namespace unless you\u0027re admin, at which point you can see all.\n\nAnyway, it\u0027s just inconsistent with the image, etc stuff.","commit_id":"e92c664df1cf0845ea04101c1085149fad324360"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8cd2b8fde3ff00f7a468eafc9ae5af8bbde8d92e","unresolved":true,"context_lines":[{"line_number":167,"context_line":"            # NOTE (abhishekk): Returning 404 Not Found as the"},{"line_number":168,"context_line":"            # namespace is outside of this user\u0027s project"},{"line_number":169,"context_line":"            msg \u003d _(\"Namespace %s not found\") % namespace"},{"line_number":170,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            # NOTE(abhishekk): Metadef resource type is created for Metadef"}],"source_content_type":"text/x-python","patch_set":21,"id":"0d221214_7cf4de87","line":170,"in_reply_to":"babdaa4a_f6b785a3","updated":"2021-08-24 15:55:56.000000000","message":"Added to ToDo list, will work on it this week","commit_id":"e92c664df1cf0845ea04101c1085149fad324360"}],"glance/tests/functional/v2/test_metadef_resourcetype_api_policy.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"84b4e24a223c8ec1c8734989e0a3ec8b676c5a91","unresolved":true,"context_lines":[{"line_number":143,"context_line":"        resp \u003d self.api_get(path)"},{"line_number":144,"context_line":"        md_resource \u003d resp.json"},{"line_number":145,"context_line":"        # NOTE(abhishekk): /v2/metadefs/resource_types returns list which"},{"line_number":146,"context_line":"        # contains all resource_types in a dictionary, so the lenght will"},{"line_number":147,"context_line":"        # always be 1 here."},{"line_number":148,"context_line":"        self.assertEqual(1, len(md_resource))"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ec0ffc56_0fc12c10","line":146,"range":{"start_line":146,"start_character":62,"end_line":146,"end_character":68},"updated":"2021-08-11 17:02:06.000000000","message":"length","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2e7b031c4f9cd321d13f5793d461d16b26f480ca","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        resp \u003d self.api_get(path)"},{"line_number":144,"context_line":"        md_resource \u003d resp.json"},{"line_number":145,"context_line":"        # NOTE(abhishekk): /v2/metadefs/resource_types returns list which"},{"line_number":146,"context_line":"        # contains all resource_types in a dictionary, so the lenght will"},{"line_number":147,"context_line":"        # always be 1 here."},{"line_number":148,"context_line":"        self.assertEqual(1, len(md_resource))"},{"line_number":149,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bf121eb8_384b9dbb","line":146,"range":{"start_line":146,"start_character":62,"end_line":146,"end_character":68},"in_reply_to":"ec0ffc56_0fc12c10","updated":"2021-08-11 19:30:29.000000000","message":"Done","commit_id":"d76dbb38684e12753146389e63a1bcdb66465ffa"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"0fa65027a5c61e5f073f779085555184838ad4ec","unresolved":true,"context_lines":[{"line_number":43,"context_line":"class TestMetadefResourceTypesPolicy(functional.SynchronousAPIBase):"},{"line_number":44,"context_line":"    def setUp(self):"},{"line_number":45,"context_line":"        super(TestMetadefResourceTypesPolicy, self).setUp()"},{"line_number":46,"context_line":"        self.policy \u003d policy.Enforcer()"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def load_data(self, create_resourcetypes\u003dFalse):"},{"line_number":49,"context_line":"        path \u003d \u0027/v2/metadefs/namespaces\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"48e14e54_b7b44ff8","line":46,"range":{"start_line":46,"start_character":9,"end_line":46,"end_character":39},"updated":"2021-08-19 14:38:33.000000000","message":"self.policy \u003d policy.Enforcer(suppress_deprecation_warnings\u003dTrue)","commit_id":"8da6d929cf61164b61648bf9c848d866161128b4"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a8e6ba4bdf0c701644a9d911f12d153341c55969","unresolved":true,"context_lines":[{"line_number":234,"context_line":"        self.set_policy_rules({"},{"line_number":235,"context_line":"            \u0027remove_metadef_resource_type_association\u0027: \u0027!\u0027,"},{"line_number":236,"context_line":"            \u0027get_metadef_namespace\u0027: \u0027!\u0027,"},{"line_number":237,"context_line":"        })"},{"line_number":238,"context_line":"        resp \u003d self.api_delete(path)"},{"line_number":239,"context_line":"        # Note for reviewers, this causes our \"check get if delete fails\""},{"line_number":240,"context_line":"        # logic to return 404 as we expect, but not related to the latest"}],"source_content_type":"text/x-python","patch_set":19,"id":"6abe9cb5_9243f7b4","line":237,"updated":"2021-08-16 21:48:24.000000000","message":"Ok - so this shows that we\u0027re still doing some level of nesting with policy checks in the metadef API?","commit_id":"8da6d929cf61164b61648bf9c848d866161128b4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"cb3e56e6707872c1673543fd841c582b4ac6e673","unresolved":true,"context_lines":[{"line_number":234,"context_line":"        self.set_policy_rules({"},{"line_number":235,"context_line":"            \u0027remove_metadef_resource_type_association\u0027: \u0027!\u0027,"},{"line_number":236,"context_line":"            \u0027get_metadef_namespace\u0027: \u0027!\u0027,"},{"line_number":237,"context_line":"        })"},{"line_number":238,"context_line":"        resp \u003d self.api_delete(path)"},{"line_number":239,"context_line":"        # Note for reviewers, this causes our \"check get if delete fails\""},{"line_number":240,"context_line":"        # logic to return 404 as we expect, but not related to the latest"}],"source_content_type":"text/x-python","patch_set":19,"id":"e805b37b_49963a0b","line":237,"in_reply_to":"6abe9cb5_9243f7b4","updated":"2021-08-16 22:13:29.000000000","message":"We are deciding to return 403 and 404 response to user based on access of get_metadef_namespace policy as everything is in metadef is associated with namespaces.","commit_id":"8da6d929cf61164b61648bf9c848d866161128b4"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"9912157a940bccbe553df8f966442feb67cac891","unresolved":true,"context_lines":[{"line_number":234,"context_line":"        self.set_policy_rules({"},{"line_number":235,"context_line":"            \u0027remove_metadef_resource_type_association\u0027: \u0027!\u0027,"},{"line_number":236,"context_line":"            \u0027get_metadef_namespace\u0027: \u0027!\u0027,"},{"line_number":237,"context_line":"        })"},{"line_number":238,"context_line":"        resp \u003d self.api_delete(path)"},{"line_number":239,"context_line":"        # Note for reviewers, this causes our \"check get if delete fails\""},{"line_number":240,"context_line":"        # logic to return 404 as we expect, but not related to the latest"}],"source_content_type":"text/x-python","patch_set":19,"id":"8062e241_4cc1ed1b","line":237,"in_reply_to":"e805b37b_49963a0b","updated":"2021-08-17 22:04:43.000000000","message":"OK - yeah that makes sense. I took another look at glance/api/v2/policy.py, specifically the _enforce() method of the various subclass implementations and that cleared things up. Thanks!","commit_id":"8da6d929cf61164b61648bf9c848d866161128b4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8a3501603ae8a75e7dd6640b08e093a13360fce6","unresolved":true,"context_lines":[{"line_number":96,"context_line":"        # sure any other attempts fail"},{"line_number":97,"context_line":"        self.set_policy_rules({"},{"line_number":98,"context_line":"            \u0027list_metadef_resource_types\u0027: \u0027!\u0027,"},{"line_number":99,"context_line":"            \u0027get_metadef_namespace\u0027: \u0027@\u0027,"},{"line_number":100,"context_line":"        })"},{"line_number":101,"context_line":"        resp \u003d self.api_get(path)"},{"line_number":102,"context_line":"        self.assertEqual(403, resp.status_code)"}],"source_content_type":"text/x-python","patch_set":21,"id":"b76b40c9_5c2cec28","line":99,"updated":"2021-08-24 15:38:02.000000000","message":"Why the switch to using @ where the other tests we wrote all use \u0027\u0027?","commit_id":"e92c664df1cf0845ea04101c1085149fad324360"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8cd2b8fde3ff00f7a468eafc9ae5af8bbde8d92e","unresolved":true,"context_lines":[{"line_number":96,"context_line":"        # sure any other attempts fail"},{"line_number":97,"context_line":"        self.set_policy_rules({"},{"line_number":98,"context_line":"            \u0027list_metadef_resource_types\u0027: \u0027!\u0027,"},{"line_number":99,"context_line":"            \u0027get_metadef_namespace\u0027: \u0027@\u0027,"},{"line_number":100,"context_line":"        })"},{"line_number":101,"context_line":"        resp \u003d self.api_get(path)"},{"line_number":102,"context_line":"        self.assertEqual(403, resp.status_code)"}],"source_content_type":"text/x-python","patch_set":21,"id":"6845f0ee_32ff4ea2","line":99,"in_reply_to":"b76b40c9_5c2cec28","updated":"2021-08-24 15:55:56.000000000","message":"These were written well before I started to write \u0027\u0027 for open policies,","commit_id":"e92c664df1cf0845ea04101c1085149fad324360"}]}
