)]}'
{"glance/api/policy.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7a2b7def0294aee1f7913ea6e59bce133a1744fc","unresolved":true,"context_lines":[{"line_number":663,"context_line":"                             object_proxy_kwargs\u003dproxy_kwargs)"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def get(self, namespace, object_name):"},{"line_number":666,"context_line":"        if namespace:"},{"line_number":667,"context_line":"            target \u003d _build_namespace_target(namespace)"},{"line_number":668,"context_line":"        else:"},{"line_number":669,"context_line":"            # noop the tenancy check and filter the response instead"},{"line_number":670,"context_line":"            target \u003d {\u0027project_id\u0027: self.context.project_id}"},{"line_number":671,"context_line":""},{"line_number":672,"context_line":"        self.policy.enforce(self.context, \u0027get_metadef_object\u0027, target)"},{"line_number":673,"context_line":"        return super(MetadefObjectRepoProxy, self).get("}],"source_content_type":"text/x-python","patch_set":2,"id":"255e2d49_a0608546","line":670,"range":{"start_line":666,"start_character":8,"end_line":670,"end_character":60},"updated":"2021-07-23 17:41:13.000000000","message":"This check is confusing, means namespace is positional argument which means it is always going to have some value.\n\nAlso I noticed you are passing namespace object to update/delete calls which are actually admin only APIs and not needed any changes.\n\nSo how about change below to avoid those changes and make this else part reachable;\n\ntarget \u003d {}\nif not isinstance(namespace, str):\n    target \u003d _build_namespace_target(namespace)","commit_id":"7a605b07c95919fe7936c2dad9b608f39248dd33"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"f116d6c55ab11a6b153db086309ac363a3c90fee","unresolved":true,"context_lines":[{"line_number":663,"context_line":"                             object_proxy_kwargs\u003dproxy_kwargs)"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def get(self, namespace, object_name):"},{"line_number":666,"context_line":"        if not isinstance(namespace, str):"},{"line_number":667,"context_line":"            target \u003d _build_namespace_target(namespace)"},{"line_number":668,"context_line":"            namespace \u003d namespace.namespace"},{"line_number":669,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"e7405191_dd9933d8","line":666,"range":{"start_line":666,"start_character":0,"end_line":666,"end_character":42},"updated":"2021-07-28 18:30:46.000000000","message":"I also saw this in other patches, and I\u0027m a bit confused. Here \"namespace\" can either be namespace or a string object? This feels really weird.","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"429192e2bcd3088466b3806ae151f4368e7d259b","unresolved":true,"context_lines":[{"line_number":663,"context_line":"                             object_proxy_kwargs\u003dproxy_kwargs)"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def get(self, namespace, object_name):"},{"line_number":666,"context_line":"        if not isinstance(namespace, str):"},{"line_number":667,"context_line":"            target \u003d _build_namespace_target(namespace)"},{"line_number":668,"context_line":"            namespace \u003d namespace.namespace"},{"line_number":669,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"54a6efc9_642a9380","line":666,"range":{"start_line":666,"start_character":0,"end_line":666,"end_character":42},"in_reply_to":"ae71d69f_f5c8a203","updated":"2021-07-29 12:38:22.000000000","message":"Cyril, I hope your doubt is cleared with this comment? Please LMK if you still feel it confusing.","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"fdfd836f88970ecd7cf3b83b61fe4ff28ca82c8e","unresolved":true,"context_lines":[{"line_number":663,"context_line":"                             object_proxy_kwargs\u003dproxy_kwargs)"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def get(self, namespace, object_name):"},{"line_number":666,"context_line":"        if not isinstance(namespace, str):"},{"line_number":667,"context_line":"            target \u003d _build_namespace_target(namespace)"},{"line_number":668,"context_line":"            namespace \u003d namespace.namespace"},{"line_number":669,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ae71d69f_f5c8a203","line":666,"range":{"start_line":666,"start_character":0,"end_line":666,"end_character":42},"in_reply_to":"e7405191_dd9933d8","updated":"2021-07-28 18:41:25.000000000","message":"May be this comment helps you to understand it.\nhttps://review.opendev.org/c/openstack/glance/+/802054/2/glance/api/policy.py#670","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"f1399c1b1564ae0cee2722ca62529a079700ee3f","unresolved":true,"context_lines":[{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def get(self, namespace, object_name):"},{"line_number":667,"context_line":"        target \u003d {}"},{"line_number":668,"context_line":"        if namespace:"},{"line_number":669,"context_line":"            target.update(_build_namespace_target(namespace))"},{"line_number":670,"context_line":"            namespace \u003d namespace.namespace"},{"line_number":671,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"efe3ccf5_3ee2e8f9","line":668,"range":{"start_line":668,"start_character":8,"end_line":668,"end_character":21},"updated":"2021-08-03 09:21:52.000000000","message":"This if condition is confusing, namespace is a positional argument so it will never be None.\nLooking at controller modification you are passing object here instead of string, so I don\u0027t think that namespace will be string here now.\n \nAlso if you think it will be string as well, then it will be better to add a unit test here to check the target value if you are expecting namespace as a object as well as string here.","commit_id":"a2fb137f03858c8a2161e7b86b3b076b0208fd44"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"4eafa4597b07dc6989a2b79e689ea908a111952e","unresolved":true,"context_lines":[{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def get(self, namespace, object_name):"},{"line_number":667,"context_line":"        target \u003d {}"},{"line_number":668,"context_line":"        if namespace:"},{"line_number":669,"context_line":"            target.update(_build_namespace_target(namespace))"},{"line_number":670,"context_line":"            namespace \u003d namespace.namespace"},{"line_number":671,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"556aeac6_ab3c2618","line":668,"range":{"start_line":668,"start_character":8,"end_line":668,"end_character":21},"in_reply_to":"efe3ccf5_3ee2e8f9","updated":"2021-08-03 11:26:41.000000000","message":"yeah, that\u0027s right, it will never be None so point of having this check here.","commit_id":"a2fb137f03858c8a2161e7b86b3b076b0208fd44"}],"glance/api/v2/metadef_objects.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7a2b7def0294aee1f7913ea6e59bce133a1744fc","unresolved":true,"context_lines":[{"line_number":83,"context_line":"            namespace_obj \u003d ns_repo.get(namespace)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"            filters \u003d filters or dict()"},{"line_number":86,"context_line":"            filters[\u0027namespace\u0027] \u003d namespace"},{"line_number":87,"context_line":"            object_repo \u003d self.gateway.get_metadef_object_repo(req.context)"},{"line_number":88,"context_line":"            db_metaobject_list \u003d object_repo.list("},{"line_number":89,"context_line":"                marker\u003dmarker, limit\u003dlimit, sort_key\u003dsort_key,"}],"source_content_type":"text/x-python","patch_set":2,"id":"2a3cb9e4_e871a308","line":86,"range":{"start_line":86,"start_character":35,"end_line":86,"end_character":44},"updated":"2021-07-23 17:41:13.000000000","message":"just a nit if needs new PS\nnamespace_obj.namespace","commit_id":"7a605b07c95919fe7936c2dad9b608f39248dd33"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"bb946016ac879bddbbdef0dc4078b388907b06b8","unresolved":true,"context_lines":[{"line_number":107,"context_line":"            req.context)"},{"line_number":108,"context_line":"        try:"},{"line_number":109,"context_line":"            ns_repo \u003d self.gateway.get_metadef_namespace_repo(req.context)"},{"line_number":110,"context_line":"            namespace_obj \u003d ns_repo.get(namespace)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            metadef_object \u003d meta_object_repo.get(namespace_obj, object_name)"},{"line_number":113,"context_line":"            return MetadefObject.to_wsme_model("}],"source_content_type":"text/x-python","patch_set":7,"id":"876dbdb9_6da6541b","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":50},"updated":"2021-08-03 05:50:02.000000000","message":"I think here also you need to catch forbidden and raise not found.","commit_id":"c1861fc57bbd287de2a31d11a80b265a13cd28fc"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8718cd8a619b28337b2b4864fc21125ed2b8e479","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            req.context)"},{"line_number":108,"context_line":"        try:"},{"line_number":109,"context_line":"            ns_repo \u003d self.gateway.get_metadef_namespace_repo(req.context)"},{"line_number":110,"context_line":"            namespace_obj \u003d ns_repo.get(namespace)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            metadef_object \u003d meta_object_repo.get(namespace_obj, object_name)"},{"line_number":113,"context_line":"            return MetadefObject.to_wsme_model("}],"source_content_type":"text/x-python","patch_set":7,"id":"2bb6c39e_991f4ca0","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":50},"in_reply_to":"876dbdb9_6da6541b","updated":"2021-08-03 09:05:26.000000000","message":"Done","commit_id":"c1861fc57bbd287de2a31d11a80b265a13cd28fc"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"f1399c1b1564ae0cee2722ca62529a079700ee3f","unresolved":true,"context_lines":[{"line_number":110,"context_line":"                ns_repo \u003d self.gateway.get_metadef_namespace_repo(req.context)"},{"line_number":111,"context_line":"                namespace_obj \u003d ns_repo.get(namespace)"},{"line_number":112,"context_line":"            except exception.Forbidden as e:"},{"line_number":113,"context_line":"                raise exception.NotFound(e.msg)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            metadef_object \u003d meta_object_repo.get(namespace_obj, object_name)"},{"line_number":116,"context_line":"            return MetadefObject.to_wsme_model("}],"source_content_type":"text/x-python","patch_set":8,"id":"528c5d5c_6d7b1058","line":113,"range":{"start_line":113,"start_character":16,"end_line":113,"end_character":47},"updated":"2021-08-03 09:21:52.000000000","message":"Also a note saying converting to 404 as namespace is out of users scope will be beneficial.","commit_id":"a2fb137f03858c8a2161e7b86b3b076b0208fd44"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"4eafa4597b07dc6989a2b79e689ea908a111952e","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                ns_repo \u003d self.gateway.get_metadef_namespace_repo(req.context)"},{"line_number":111,"context_line":"                namespace_obj \u003d ns_repo.get(namespace)"},{"line_number":112,"context_line":"            except exception.Forbidden as e:"},{"line_number":113,"context_line":"                raise exception.NotFound(e.msg)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            metadef_object \u003d meta_object_repo.get(namespace_obj, object_name)"},{"line_number":116,"context_line":"            return MetadefObject.to_wsme_model("}],"source_content_type":"text/x-python","patch_set":8,"id":"ea0b23f6_38f27ec9","line":113,"range":{"start_line":113,"start_character":16,"end_line":113,"end_character":47},"in_reply_to":"528c5d5c_6d7b1058","updated":"2021-08-03 11:26:41.000000000","message":"Done","commit_id":"a2fb137f03858c8a2161e7b86b3b076b0208fd44"}],"glance/db/simple/api.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6354cbc641fc11858fe0d2c30eb70d59657fed33","unresolved":true,"context_lines":[{"line_number":2121,"context_line":""},{"line_number":2122,"context_line":""},{"line_number":2123,"context_line":"def _check_namespace_visibility(context, namespace, namespace_name):"},{"line_number":2124,"context_line":"    # NOTE(pdeore): We need this check to be performed only if"},{"line_number":2125,"context_line":"    # secure RBAC is not enabled in glance. Once secure RBAC is"},{"line_number":2126,"context_line":"    # supported then we can remove this check and solely depend"},{"line_number":2127,"context_line":"    # on default rbac policy."},{"line_number":2128,"context_line":"    if not CONF.enforce_secure_rbac:"},{"line_number":2129,"context_line":"        if not _is_namespace_visible(context, namespace):"},{"line_number":2130,"context_line":"            LOG.debug(\"Forbidding request, metadata definition namespace\u003d%s \""},{"line_number":2131,"context_line":"                      \"is not visible.\", namespace_name)"},{"line_number":2132,"context_line":"            emsg \u003d _(\"Forbidding request, metadata definition namespace\u003d%s\""},{"line_number":2133,"context_line":"                     \" is not visible.\") % namespace_name"},{"line_number":2134,"context_line":"            raise exception.MetadefForbidden(emsg)"},{"line_number":2135,"context_line":""},{"line_number":2136,"context_line":""},{"line_number":2137,"context_line":"def _get_metadef_id():"}],"source_content_type":"text/x-python","patch_set":4,"id":"7b508d6e_addff8fb","line":2134,"range":{"start_line":2124,"start_character":4,"end_line":2134,"end_character":50},"updated":"2021-07-27 08:24:52.000000000","message":"Any specific reason why this is not a part of namespace patch?\nhttps://review.opendev.org/c/openstack/glance/+/798700/22/glance/db/sqlalchemy/metadef_api/namespace.py\n\nI think this should be moved to namespace patch.","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"429192e2bcd3088466b3806ae151f4368e7d259b","unresolved":true,"context_lines":[{"line_number":2121,"context_line":""},{"line_number":2122,"context_line":""},{"line_number":2123,"context_line":"def _check_namespace_visibility(context, namespace, namespace_name):"},{"line_number":2124,"context_line":"    # NOTE(pdeore): We need this check to be performed only if"},{"line_number":2125,"context_line":"    # secure RBAC is not enabled in glance. Once secure RBAC is"},{"line_number":2126,"context_line":"    # supported then we can remove this check and solely depend"},{"line_number":2127,"context_line":"    # on default rbac policy."},{"line_number":2128,"context_line":"    if not CONF.enforce_secure_rbac:"},{"line_number":2129,"context_line":"        if not _is_namespace_visible(context, namespace):"},{"line_number":2130,"context_line":"            LOG.debug(\"Forbidding request, metadata definition namespace\u003d%s \""},{"line_number":2131,"context_line":"                      \"is not visible.\", namespace_name)"},{"line_number":2132,"context_line":"            emsg \u003d _(\"Forbidding request, metadata definition namespace\u003d%s\""},{"line_number":2133,"context_line":"                     \" is not visible.\") % namespace_name"},{"line_number":2134,"context_line":"            raise exception.MetadefForbidden(emsg)"},{"line_number":2135,"context_line":""},{"line_number":2136,"context_line":""},{"line_number":2137,"context_line":"def _get_metadef_id():"}],"source_content_type":"text/x-python","patch_set":4,"id":"1170802b_37862265","line":2134,"range":{"start_line":2124,"start_character":4,"end_line":2134,"end_character":50},"in_reply_to":"25eeed46_14d792e6","updated":"2021-07-29 12:38:22.000000000","message":"Ack, moved to https://review.opendev.org/c/openstack/glance/+/798700/23/glance/db/simple/api.py#2124","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"5155b15f7d69c08840815973b0c00c559e5cf9e6","unresolved":true,"context_lines":[{"line_number":2121,"context_line":""},{"line_number":2122,"context_line":""},{"line_number":2123,"context_line":"def _check_namespace_visibility(context, namespace, namespace_name):"},{"line_number":2124,"context_line":"    # NOTE(pdeore): We need this check to be performed only if"},{"line_number":2125,"context_line":"    # secure RBAC is not enabled in glance. Once secure RBAC is"},{"line_number":2126,"context_line":"    # supported then we can remove this check and solely depend"},{"line_number":2127,"context_line":"    # on default rbac policy."},{"line_number":2128,"context_line":"    if not CONF.enforce_secure_rbac:"},{"line_number":2129,"context_line":"        if not _is_namespace_visible(context, namespace):"},{"line_number":2130,"context_line":"            LOG.debug(\"Forbidding request, metadata definition namespace\u003d%s \""},{"line_number":2131,"context_line":"                      \"is not visible.\", namespace_name)"},{"line_number":2132,"context_line":"            emsg \u003d _(\"Forbidding request, metadata definition namespace\u003d%s\""},{"line_number":2133,"context_line":"                     \" is not visible.\") % namespace_name"},{"line_number":2134,"context_line":"            raise exception.MetadefForbidden(emsg)"},{"line_number":2135,"context_line":""},{"line_number":2136,"context_line":""},{"line_number":2137,"context_line":"def _get_metadef_id():"}],"source_content_type":"text/x-python","patch_set":4,"id":"25eeed46_14d792e6","line":2134,"range":{"start_line":2124,"start_character":4,"end_line":2134,"end_character":50},"in_reply_to":"7b508d6e_addff8fb","updated":"2021-07-28 14:51:33.000000000","message":"+1 It looks like a leftover from a previous patch.","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"}],"glance/policies/metadef.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"b239331cefe7d0f279464218b56366e4474abca4","unresolved":true,"context_lines":[{"line_number":98,"context_line":"    ),"},{"line_number":99,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":100,"context_line":"        name\u003d\"get_metadef_objects\","},{"line_number":101,"context_line":"        check_str\u003d\"rule:metadef_default\","},{"line_number":102,"context_line":"        scope_types\u003d[\u0027system\u0027, \u0027project\u0027],"},{"line_number":103,"context_line":"        description\u003d\"Get objects from a namespace.\","},{"line_number":104,"context_line":"        operations\u003d["}],"source_content_type":"text/x-python","patch_set":12,"id":"41b61ae9_b9098de3","line":101,"updated":"2021-08-30 16:30:48.000000000","message":"Similar comment here as in the preceding patch. Should we be replacing all occurences of rule:metadef_default with a specific policy check?\n\nDoes this should allow us to implement what\u0027s hard-coded in glance with a policy check instead, making it easier to clean up the hard-coded checks later.","commit_id":"5b91830b3037e133273ba341014b1c613f125cfe"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7e2742153f7d7cde7359c9a14d437d1b48498bad","unresolved":true,"context_lines":[{"line_number":98,"context_line":"    ),"},{"line_number":99,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":100,"context_line":"        name\u003d\"get_metadef_objects\","},{"line_number":101,"context_line":"        check_str\u003d\"rule:metadef_default\","},{"line_number":102,"context_line":"        scope_types\u003d[\u0027system\u0027, \u0027project\u0027],"},{"line_number":103,"context_line":"        description\u003d\"Get objects from a namespace.\","},{"line_number":104,"context_line":"        operations\u003d["}],"source_content_type":"text/x-python","patch_set":12,"id":"25d23809_5bc2160a","line":101,"in_reply_to":"41b61ae9_b9098de3","updated":"2021-08-30 17:08:15.000000000","message":"The reason for reverting this back is back that at policy layer we were adding the logic to satisfy this new policy check (base.ADMIN_OR_PROJECT_READER) which was actually a result of noop check.\n\nNow since we have moved policy check in the API layer we can revert it back to;\nbase.ADMIN_OR_PROJECT_READER","commit_id":"5b91830b3037e133273ba341014b1c613f125cfe"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a15268acd2be45614490ab50d95ede64a3ac7696","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        deprecated_rule\u003dpolicy.DeprecatedRule("},{"line_number":99,"context_line":"            name\u003d\"get_metadef_object\", check_str\u003d\"rule:metadef_default\","},{"line_number":100,"context_line":"            deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":101,"context_line":"            deprecated_since\u003dversionutils.deprecated.WALLABY"},{"line_number":102,"context_line":"        ),"},{"line_number":103,"context_line":"    ),"},{"line_number":104,"context_line":"    policy.DocumentedRuleDefault("}],"source_content_type":"text/x-python","patch_set":13,"id":"60488971_fe9083e0","line":101,"range":{"start_line":101,"start_character":53,"end_line":101,"end_character":60},"updated":"2021-08-30 20:51:00.000000000","message":"I should have caught this in the last review, but I think this should be the current release, Xena.","commit_id":"1e7b14ad0a705c8167406924d25dd6400b7e9abb"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f128b33e20a78d83f77f7852dae1f6fc7609fc24","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        deprecated_rule\u003dpolicy.DeprecatedRule("},{"line_number":99,"context_line":"            name\u003d\"get_metadef_object\", check_str\u003d\"rule:metadef_default\","},{"line_number":100,"context_line":"            deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":101,"context_line":"            deprecated_since\u003dversionutils.deprecated.WALLABY"},{"line_number":102,"context_line":"        ),"},{"line_number":103,"context_line":"    ),"},{"line_number":104,"context_line":"    policy.DocumentedRuleDefault("}],"source_content_type":"text/x-python","patch_set":13,"id":"04ce8b95_0cb5ce90","line":101,"range":{"start_line":101,"start_character":53,"end_line":101,"end_character":60},"in_reply_to":"60488971_fe9083e0","updated":"2021-08-31 06:09:30.000000000","message":"Ack","commit_id":"1e7b14ad0a705c8167406924d25dd6400b7e9abb"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a15268acd2be45614490ab50d95ede64a3ac7696","unresolved":true,"context_lines":[{"line_number":113,"context_line":"        deprecated_rule\u003dpolicy.DeprecatedRule("},{"line_number":114,"context_line":"            name\u003d\"get_metadef_objects\", check_str\u003d\"rule:metadef_default\","},{"line_number":115,"context_line":"            deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":116,"context_line":"            deprecated_since\u003dversionutils.deprecated.WALLABY"},{"line_number":117,"context_line":"        ),"},{"line_number":118,"context_line":"    ),"},{"line_number":119,"context_line":"    policy.DocumentedRuleDefault("}],"source_content_type":"text/x-python","patch_set":13,"id":"75552727_83e5b83a","line":116,"range":{"start_line":116,"start_character":53,"end_line":116,"end_character":60},"updated":"2021-08-30 20:51:00.000000000","message":"Ditto.","commit_id":"1e7b14ad0a705c8167406924d25dd6400b7e9abb"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f128b33e20a78d83f77f7852dae1f6fc7609fc24","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        deprecated_rule\u003dpolicy.DeprecatedRule("},{"line_number":114,"context_line":"            name\u003d\"get_metadef_objects\", check_str\u003d\"rule:metadef_default\","},{"line_number":115,"context_line":"            deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":116,"context_line":"            deprecated_since\u003dversionutils.deprecated.WALLABY"},{"line_number":117,"context_line":"        ),"},{"line_number":118,"context_line":"    ),"},{"line_number":119,"context_line":"    policy.DocumentedRuleDefault("}],"source_content_type":"text/x-python","patch_set":13,"id":"f5fd8416_8aa768b2","line":116,"range":{"start_line":116,"start_character":53,"end_line":116,"end_character":60},"in_reply_to":"75552727_83e5b83a","updated":"2021-08-31 06:09:30.000000000","message":"Ack","commit_id":"1e7b14ad0a705c8167406924d25dd6400b7e9abb"}],"glance/tests/functional/v2/test_metadef_objects.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6354cbc641fc11858fe0d2c30eb70d59657fed33","unresolved":true,"context_lines":[{"line_number":296,"context_line":"                            \"type\": \"integer\","},{"line_number":297,"context_line":"                            \"title\": \"property1\","},{"line_number":298,"context_line":"                            \"description\": \"property1 description\","},{"line_number":299,"context_line":"                            \"operators\": [\"\u003call-in\u003e\"],"},{"line_number":300,"context_line":"                            \"default\": 100,"},{"line_number":301,"context_line":"                            \"minimum\": 100,"},{"line_number":302,"context_line":"                            \"maximum\": 30000369"},{"line_number":303,"context_line":"                        },"},{"line_number":304,"context_line":"                    }"},{"line_number":305,"context_line":"                })"}],"source_content_type":"text/x-python","patch_set":4,"id":"441a7cf9_dc795f64","line":302,"range":{"start_line":299,"start_character":28,"end_line":302,"end_character":47},"updated":"2021-07-27 08:24:52.000000000","message":"As suggested earlier as well you can avoid creating object with above optional properties.\nWhile updating you can update description only.\n\nThis will help in following ways;\n1. It will reduce unnecessary asserts required to check these properties\n2. It will reduce your _update_object function length\n3. Make it easier for reviewer to review.","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"429192e2bcd3088466b3806ae151f4368e7d259b","unresolved":false,"context_lines":[{"line_number":296,"context_line":"                            \"type\": \"integer\","},{"line_number":297,"context_line":"                            \"title\": \"property1\","},{"line_number":298,"context_line":"                            \"description\": \"property1 description\","},{"line_number":299,"context_line":"                            \"operators\": [\"\u003call-in\u003e\"],"},{"line_number":300,"context_line":"                            \"default\": 100,"},{"line_number":301,"context_line":"                            \"minimum\": 100,"},{"line_number":302,"context_line":"                            \"maximum\": 30000369"},{"line_number":303,"context_line":"                        },"},{"line_number":304,"context_line":"                    }"},{"line_number":305,"context_line":"                })"}],"source_content_type":"text/x-python","patch_set":4,"id":"5e854bc0_623b33ba","line":302,"range":{"start_line":299,"start_character":28,"end_line":302,"end_character":47},"in_reply_to":"441a7cf9_dc795f64","updated":"2021-07-29 12:38:22.000000000","message":"Ack","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6354cbc641fc11858fe0d2c30eb70d59657fed33","unresolved":true,"context_lines":[{"line_number":308,"context_line":"            response \u003d requests.post(path, headers\u003dheaders, data\u003ddata)"},{"line_number":309,"context_line":"            self.assertEqual(http.CREATED, response.status_code)"},{"line_number":310,"context_line":"            object_returned \u003d jsonutils.loads(response.text)"},{"line_number":311,"context_line":"            object_with_namespace \u003d {}"},{"line_number":312,"context_line":"            object_with_namespace[\u0027namespace\u0027] \u003d namespace"},{"line_number":313,"context_line":"            object_with_namespace[\u0027object\u0027] \u003d object_returned"},{"line_number":314,"context_line":"            objects.append(object_with_namespace)"},{"line_number":315,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"8d75afee_2be50946","line":312,"range":{"start_line":311,"start_character":12,"end_line":312,"end_character":58},"updated":"2021-07-27 08:24:52.000000000","message":"ditto as commented in its parent patch\nyou can use \nobject_with_namespace[namespace.namespace] \u003d object_returned","commit_id":"fc6604635431382e33491f4f37f31a21fc1c019f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"bb946016ac879bddbbdef0dc4078b388907b06b8","unresolved":true,"context_lines":[{"line_number":118,"context_line":"        response \u003d requests.get(path,"},{"line_number":119,"context_line":"                                headers\u003dself._headers())"},{"line_number":120,"context_line":"        self.assertEqual(http.OK, response.status_code)"},{"line_number":121,"context_line":"        metadata_object \u003d response.json()"},{"line_number":122,"context_line":"        self.assertEqual(\"object1\", metadata_object[\u0027name\u0027])"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # Returned object should match the created object"}],"source_content_type":"text/x-python","patch_set":7,"id":"bee22cb9_2b72ed0d","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":41},"updated":"2021-08-03 05:50:02.000000000","message":"avoid doing changes to existing test","commit_id":"c1861fc57bbd287de2a31d11a80b265a13cd28fc"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8718cd8a619b28337b2b4864fc21125ed2b8e479","unresolved":true,"context_lines":[{"line_number":118,"context_line":"        response \u003d requests.get(path,"},{"line_number":119,"context_line":"                                headers\u003dself._headers())"},{"line_number":120,"context_line":"        self.assertEqual(http.OK, response.status_code)"},{"line_number":121,"context_line":"        metadata_object \u003d response.json()"},{"line_number":122,"context_line":"        self.assertEqual(\"object1\", metadata_object[\u0027name\u0027])"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # Returned object should match the created object"}],"source_content_type":"text/x-python","patch_set":7,"id":"5dbebacb_b0f9f459","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":41},"in_reply_to":"bee22cb9_2b72ed0d","updated":"2021-08-03 09:05:26.000000000","message":"oops!! happened by mistake.","commit_id":"c1861fc57bbd287de2a31d11a80b265a13cd28fc"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cbaa2a6163f6c0a00522f91f1ab1a5e1b77917dc","unresolved":true,"context_lines":[{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def _create_namespace(self, path, headers, data):"},{"line_number":276,"context_line":"        json_data \u003d jsonutils.dumps(data)"},{"line_number":277,"context_line":"        response \u003d requests.post(path, headers\u003dheaders, data\u003djson_data)"},{"line_number":278,"context_line":"        self.assertEqual(http.CREATED, response.status_code)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        return response.json()"}],"source_content_type":"text/x-python","patch_set":16,"id":"ab519ff4_9da03cf5","line":277,"range":{"start_line":277,"start_character":56,"end_line":277,"end_character":70},"updated":"2021-09-01 17:19:44.000000000","message":"json\u003ddata, here and elsewhere.","commit_id":"1f22a07ecabe821a06276e648f76ac318b575d0d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4eef0800a1b766cffda578d7b7031fa97a13731f","unresolved":false,"context_lines":[{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def _create_namespace(self, path, headers, data):"},{"line_number":276,"context_line":"        json_data \u003d jsonutils.dumps(data)"},{"line_number":277,"context_line":"        response \u003d requests.post(path, headers\u003dheaders, data\u003djson_data)"},{"line_number":278,"context_line":"        self.assertEqual(http.CREATED, response.status_code)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        return response.json()"}],"source_content_type":"text/x-python","patch_set":16,"id":"5bb566c3_6b188aba","line":277,"range":{"start_line":277,"start_character":56,"end_line":277,"end_character":70},"in_reply_to":"ab519ff4_9da03cf5","updated":"2021-09-02 09:14:05.000000000","message":"Done","commit_id":"1f22a07ecabe821a06276e648f76ac318b575d0d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cbaa2a6163f6c0a00522f91f1ab1a5e1b77917dc","unresolved":true,"context_lines":[{"line_number":322,"context_line":"        self.assertEqual(data[\u0027required\u0027][0], metadata_object[\u0027required\u0027][0])"},{"line_number":323,"context_line":"        updated_property1 \u003d metadata_object[\u0027properties\u0027][\u0027property1\u0027]"},{"line_number":324,"context_line":"        self.assertEqual(\u0027integer\u0027, updated_property1[\u0027type\u0027])"},{"line_number":325,"context_line":"        self.assertEqual(\u0027p1 desc-UPDATED\u0027, updated_property1[\u0027description\u0027])"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"        # Updates should persist across requests"},{"line_number":328,"context_line":"        response \u003d requests.get(path, headers\u003dself._headers())"}],"source_content_type":"text/x-python","patch_set":16,"id":"b4e16bf6_f7737066","line":325,"updated":"2021-09-01 17:19:44.000000000","message":"Why not make this one assert against an expected dict like in your previous patch? That\u0027s easier to read and confirm that it\u0027s right, IMHO.","commit_id":"1f22a07ecabe821a06276e648f76ac318b575d0d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4eef0800a1b766cffda578d7b7031fa97a13731f","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        self.assertEqual(data[\u0027required\u0027][0], metadata_object[\u0027required\u0027][0])"},{"line_number":323,"context_line":"        updated_property1 \u003d metadata_object[\u0027properties\u0027][\u0027property1\u0027]"},{"line_number":324,"context_line":"        self.assertEqual(\u0027integer\u0027, updated_property1[\u0027type\u0027])"},{"line_number":325,"context_line":"        self.assertEqual(\u0027p1 desc-UPDATED\u0027, updated_property1[\u0027description\u0027])"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"        # Updates should persist across requests"},{"line_number":328,"context_line":"        response \u003d requests.get(path, headers\u003dself._headers())"}],"source_content_type":"text/x-python","patch_set":16,"id":"441436e6_297edcea","line":325,"in_reply_to":"b4e16bf6_f7737066","updated":"2021-09-02 09:14:05.000000000","message":"Done","commit_id":"1f22a07ecabe821a06276e648f76ac318b575d0d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cbaa2a6163f6c0a00522f91f1ab1a5e1b77917dc","unresolved":true,"context_lines":[{"line_number":332,"context_line":"        self.assertEqual(data[\u0027required\u0027][0], metadata_object[\u0027required\u0027][0])"},{"line_number":333,"context_line":"        updated_property1 \u003d metadata_object[\u0027properties\u0027][\u0027property1\u0027]"},{"line_number":334,"context_line":"        self.assertEqual(\u0027integer\u0027, updated_property1[\u0027type\u0027])"},{"line_number":335,"context_line":"        self.assertEqual(\u0027p1 desc-UPDATED\u0027, updated_property1[\u0027description\u0027])"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def test_role_base_metadata_objects_lifecycle(self):"},{"line_number":338,"context_line":"        # Create public and private namespaces for tenant1 and tenant2"}],"source_content_type":"text/x-python","patch_set":16,"id":"f341d88b_1e57b07b","line":335,"updated":"2021-09-01 17:19:44.000000000","message":"Doing the above would make this less duplicative right?","commit_id":"1f22a07ecabe821a06276e648f76ac318b575d0d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4eef0800a1b766cffda578d7b7031fa97a13731f","unresolved":false,"context_lines":[{"line_number":332,"context_line":"        self.assertEqual(data[\u0027required\u0027][0], metadata_object[\u0027required\u0027][0])"},{"line_number":333,"context_line":"        updated_property1 \u003d metadata_object[\u0027properties\u0027][\u0027property1\u0027]"},{"line_number":334,"context_line":"        self.assertEqual(\u0027integer\u0027, updated_property1[\u0027type\u0027])"},{"line_number":335,"context_line":"        self.assertEqual(\u0027p1 desc-UPDATED\u0027, updated_property1[\u0027description\u0027])"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def test_role_base_metadata_objects_lifecycle(self):"},{"line_number":338,"context_line":"        # Create public and private namespaces for tenant1 and tenant2"}],"source_content_type":"text/x-python","patch_set":16,"id":"68ff4b95_25561f02","line":335,"in_reply_to":"f341d88b_1e57b07b","updated":"2021-09-02 09:14:05.000000000","message":"Ack","commit_id":"1f22a07ecabe821a06276e648f76ac318b575d0d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d5ad032d0d9362a97b1dfc61d4782868e313eac1","unresolved":true,"context_lines":[{"line_number":364,"context_line":"                for namespace, object_name in obj.items():"},{"line_number":365,"context_line":"                    path \u003d self._url(\u0027/v2/metadefs/namespaces/%s/objects/%s\u0027 %"},{"line_number":366,"context_line":"                                     (namespace, object_name))"},{"line_number":367,"context_line":"                    headers \u003d self._headers("},{"line_number":368,"context_line":"                        {\u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":369,"context_line":"                         \u0027X-Tenant-Id\u0027: tenant,"},{"line_number":370,"context_line":"                         \u0027X-Roles\u0027: \u0027reader,member\u0027})"},{"line_number":371,"context_line":"                    response \u003d requests.get(path, headers\u003dheaders)"},{"line_number":372,"context_line":"                    if namespace.split(\u0027_\u0027)[1] \u003d\u003d \u0027public\u0027:"},{"line_number":373,"context_line":"                        self.assertEqual(http.OK, response.status_code)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f751a3e_e730557d","line":370,"range":{"start_line":367,"start_character":20,"end_line":370,"end_character":53},"updated":"2021-09-02 09:28:52.000000000","message":"This can be defined outside for loop at line #363 to avoid calling it multiple times with same return values.","commit_id":"6c5c0c8dc90d16be2bb590a5e9d40e54fb48e0e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"4b2aeb5fb66c0535f14a253558ebb584c377a4f4","unresolved":false,"context_lines":[{"line_number":364,"context_line":"                for namespace, object_name in obj.items():"},{"line_number":365,"context_line":"                    path \u003d self._url(\u0027/v2/metadefs/namespaces/%s/objects/%s\u0027 %"},{"line_number":366,"context_line":"                                     (namespace, object_name))"},{"line_number":367,"context_line":"                    headers \u003d self._headers("},{"line_number":368,"context_line":"                        {\u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":369,"context_line":"                         \u0027X-Tenant-Id\u0027: tenant,"},{"line_number":370,"context_line":"                         \u0027X-Roles\u0027: \u0027reader,member\u0027})"},{"line_number":371,"context_line":"                    response \u003d requests.get(path, headers\u003dheaders)"},{"line_number":372,"context_line":"                    if namespace.split(\u0027_\u0027)[1] \u003d\u003d \u0027public\u0027:"},{"line_number":373,"context_line":"                        self.assertEqual(http.OK, response.status_code)"}],"source_content_type":"text/x-python","patch_set":17,"id":"381354f8_c174131f","line":370,"range":{"start_line":367,"start_character":20,"end_line":370,"end_character":53},"in_reply_to":"3f751a3e_e730557d","updated":"2021-09-02 12:17:27.000000000","message":"Done","commit_id":"6c5c0c8dc90d16be2bb590a5e9d40e54fb48e0e2"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a9041bffc14b927f6b6e7a920ee42f728393fef8","unresolved":true,"context_lines":[{"line_number":333,"context_line":"        metadata_object.pop(\u0027updated_at\u0027)"},{"line_number":334,"context_line":"        self.assertEqual(metadata_object, expected_object)"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def test_role_base_metadata_objects_lifecycle(self):"},{"line_number":337,"context_line":"        # Create public and private namespaces for tenant1 and tenant2"},{"line_number":338,"context_line":"        path \u003d self._url(\u0027/v2/metadefs/namespaces\u0027)"},{"line_number":339,"context_line":"        headers \u003d self._headers({\u0027content-type\u0027: \u0027application/json\u0027})"}],"source_content_type":"text/x-python","patch_set":18,"id":"5298eb91_ac3c685c","line":336,"updated":"2021-09-02 21:49:30.000000000","message":"FYI - this also passes when you completely disable the get_metadef_objects check.\n\nhttps://paste.opendev.org/raw/808562/","commit_id":"ea3ef052fdb4d3cc6d53a9ed02e4575e743993bb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"874326271383c23cea45f4e43a74df2d8fd77171","unresolved":true,"context_lines":[{"line_number":414,"context_line":""},{"line_number":415,"context_line":"        # Delete object should not be allowed to non admin role"},{"line_number":416,"context_line":"        for obj in total_objects:"},{"line_number":417,"context_line":"            for namespace, object_name in obj.items():"},{"line_number":418,"context_line":"                path \u003d self._url(\u0027/v2/metadefs/namespaces/%s/objects/%s\u0027 %"},{"line_number":419,"context_line":"                                 (namespace, object_name))"},{"line_number":420,"context_line":"                response \u003d requests.delete("}],"source_content_type":"text/x-python","patch_set":18,"id":"b1366c41_4a66af28","line":417,"updated":"2021-09-02 18:34:22.000000000","message":"Part of what I was trying to kinda get at in the previous patch with this is that I think that, while very comprehensive, trying to delete each object and make sure they all fail is probably overkill. It\u0027s definitely not bad, but it does make these tests a little more complicated than they need. If we\u0027ve created 100 objects the same way, it\u0027s probably okay to make sure one behaves the way we expect without needing all the looping and record-keeping. Hopefully these are all very fast and thus not slowing down our tests much, but..","commit_id":"ea3ef052fdb4d3cc6d53a9ed02e4575e743993bb"}]}
