)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"97a18c95239638fe1020c01abb1de0476d2b4b94","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"822341d0_13eeddfe","updated":"2023-06-09 16:54:03.000000000","message":"A soft -1. This is looking good otherwise, IMO","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"cae1c6c379b54748940a77d466bb9df4c4aff39c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"8768f2fd_9fccd86c","updated":"2023-06-14 19:04:51.000000000","message":"recheck flaky","commit_id":"d2a166a98eaaec40cdd994dfe3fddeefa6c34532"}],"openstack/test/fakes.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"97a18c95239638fe1020c01abb1de0476d2b4b94","unresolved":true,"context_lines":[{"line_number":31,"context_line":"        values of expected types."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    base_attrs \u003d dict()"},{"line_number":34,"context_line":"    for attr in inspect.getmembers(resource_type):"},{"line_number":35,"context_line":"        if isinstance(attr[1], resource.Body):"},{"line_number":36,"context_line":"            target_type \u003d attr[1].type"},{"line_number":37,"context_line":"            if target_type is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"e7016ee6_5a87197a","line":34,"updated":"2023-06-09 16:54:03.000000000","message":"nit: if you use the `predicate` argument, you won\u0027t get a load of irrelevant rubbish below.\n\n```\nfor attr in inspect.getmembers(\n    resource_type,\n    predicate\u003dlambda x: isinstance(x, (resource.Body, resource.URI)),\n):\n```","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"4cee9ae03ee0472d377c82c0b7685f3d07c900dc","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        values of expected types."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    base_attrs \u003d dict()"},{"line_number":34,"context_line":"    for attr in inspect.getmembers(resource_type):"},{"line_number":35,"context_line":"        if isinstance(attr[1], resource.Body):"},{"line_number":36,"context_line":"            target_type \u003d attr[1].type"},{"line_number":37,"context_line":"            if target_type is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"2c68e0aa_2be3e47c","line":34,"in_reply_to":"e7016ee6_5a87197a","updated":"2023-06-09 17:39:03.000000000","message":"Done, but it does not help much, since we anyway need to go through certain IFs. But not harming either.","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"97a18c95239638fe1020c01abb1de0476d2b4b94","unresolved":true,"context_lines":[{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    base_attrs \u003d dict()"},{"line_number":34,"context_line":"    for attr in inspect.getmembers(resource_type):"},{"line_number":35,"context_line":"        if isinstance(attr[1], resource.Body):"},{"line_number":36,"context_line":"            target_type \u003d attr[1].type"},{"line_number":37,"context_line":"            if target_type is None:"},{"line_number":38,"context_line":"                # Type not defined - string"}],"source_content_type":"text/x-python","patch_set":8,"id":"2b5c63bc_a7aab84c","line":35,"updated":"2023-06-09 16:54:03.000000000","message":"IMO this would be significantly more readable if you aliased `attr[0]` and `attr[1]` to `name` and `value`, respectively. Can we do that?","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"4cee9ae03ee0472d377c82c0b7685f3d07c900dc","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    base_attrs \u003d dict()"},{"line_number":34,"context_line":"    for attr in inspect.getmembers(resource_type):"},{"line_number":35,"context_line":"        if isinstance(attr[1], resource.Body):"},{"line_number":36,"context_line":"            target_type \u003d attr[1].type"},{"line_number":37,"context_line":"            if target_type is None:"},{"line_number":38,"context_line":"                # Type not defined - string"}],"source_content_type":"text/x-python","patch_set":8,"id":"d3b860bf_3cc6010e","line":35,"in_reply_to":"2b5c63bc_a7aab84c","updated":"2023-06-09 17:39:03.000000000","message":"Done","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"97a18c95239638fe1020c01abb1de0476d2b4b94","unresolved":true,"context_lines":[{"line_number":84,"context_line":"                    \"Not generating fake value for %s.%s as its type (%s) \""},{"line_number":85,"context_line":"                    \"is not supported\""},{"line_number":86,"context_line":"                    % (resource_type.__name__, attr[0], target_type)"},{"line_number":87,"context_line":"                )"},{"line_number":88,"context_line":"        if isinstance(attr[1], resource.URI):"},{"line_number":89,"context_line":"            # For URI we just generate something"},{"line_number":90,"context_line":"            base_attrs[attr[0]] \u003d uuid.uuid4().hex"}],"source_content_type":"text/x-python","patch_set":8,"id":"11dcc49a_d3127085","line":87,"updated":"2023-06-09 16:54:03.000000000","message":"Like above, shouldn\u0027t this be a `NotImplementedError`?","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"4cee9ae03ee0472d377c82c0b7685f3d07c900dc","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                    \"Not generating fake value for %s.%s as its type (%s) \""},{"line_number":85,"context_line":"                    \"is not supported\""},{"line_number":86,"context_line":"                    % (resource_type.__name__, attr[0], target_type)"},{"line_number":87,"context_line":"                )"},{"line_number":88,"context_line":"        if isinstance(attr[1], resource.URI):"},{"line_number":89,"context_line":"            # For URI we just generate something"},{"line_number":90,"context_line":"            base_attrs[attr[0]] \u003d uuid.uuid4().hex"}],"source_content_type":"text/x-python","patch_set":8,"id":"9dd767bb_cee96c27","line":87,"in_reply_to":"11dcc49a_d3127085","updated":"2023-06-09 17:39:03.000000000","message":"Done","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"97a18c95239638fe1020c01abb1de0476d2b4b94","unresolved":true,"context_lines":[{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"    for _ in range(count):"},{"line_number":110,"context_line":"        fakes.append(generate_fake_resource(resource_type, **attrs))"},{"line_number":111,"context_line":"    return fakes"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f6b56ca_b76b09b1","line":111,"updated":"2023-06-09 16:54:03.000000000","message":"Shouldn\u0027t this return an iterator, since that would closer map to the generators we _actually_ use in SDK? Also, list comprehension?","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"22dbee2807171cf0852b1c969fc0974f3cf21ed2","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"    for _ in range(count):"},{"line_number":110,"context_line":"        fakes.append(generate_fake_resource(resource_type, **attrs))"},{"line_number":111,"context_line":"    return fakes"}],"source_content_type":"text/x-python","patch_set":8,"id":"e1c2cdb1_60e79bf6","line":111,"in_reply_to":"15105d8d_3692dede","updated":"2023-07-17 10:54:07.000000000","message":"Done","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"4cee9ae03ee0472d377c82c0b7685f3d07c900dc","unresolved":true,"context_lines":[{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"    for _ in range(count):"},{"line_number":110,"context_line":"        fakes.append(generate_fake_resource(resource_type, **attrs))"},{"line_number":111,"context_line":"    return fakes"}],"source_content_type":"text/x-python","patch_set":8,"id":"9de0a8b4_7dd14773","line":111,"in_reply_to":"7f6b56ca_b76b09b1","updated":"2023-06-09 17:39:03.000000000","message":"I guess there was some idea with sort of caching behind that. Since it is not implemented now I rather admit making it simpler is better.\nYield inside of list comprehension does not work, so we have only one or another. I honestly do see right now generators should be more aligned with our usage, but also do not really object doing so.","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"0b41fc180010a03b782a0b758d070cb63b97d7ed","unresolved":true,"context_lines":[{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"    for _ in range(count):"},{"line_number":110,"context_line":"        fakes.append(generate_fake_resource(resource_type, **attrs))"},{"line_number":111,"context_line":"    return fakes"}],"source_content_type":"text/x-python","patch_set":8,"id":"15105d8d_3692dede","line":111,"in_reply_to":"9de0a8b4_7dd14773","updated":"2023-06-12 15:18:50.000000000","message":"after thinking a while I agree, it makes totally sense to have a generator. It will require some change in the unittests, but on the other side mocking listing method is becoming easier","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"}],"openstack/tests/unit/fakes.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"54d71e1caaaaa8c1e19540dc08674224bef031ed","unresolved":true,"context_lines":[{"line_number":46,"context_line":"        self.get_endpoint.return_value \u003d self.ENDPOINT"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get_fake_resource(resource_type, **attrs):"},{"line_number":50,"context_line":"    \"\"\"Generate fake resource"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    :param type resource_type: Object class"}],"source_content_type":"text/x-python","patch_set":2,"id":"e153f747_ef00e3cd","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":21},"updated":"2023-06-02 16:58:06.000000000","message":"rather than `get_`, how about `generate_`? This is a generator, after all.","commit_id":"7d8be69e97197410f097f986bbc9fa5f860eee96"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"c5e25585f25aee7852a03f7d3593fc27a171f3c9","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.get_endpoint.return_value \u003d self.ENDPOINT"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get_fake_resource(resource_type, **attrs):"},{"line_number":50,"context_line":"    \"\"\"Generate fake resource"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    :param type resource_type: Object class"}],"source_content_type":"text/x-python","patch_set":2,"id":"50b99197_41fca503","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":21},"in_reply_to":"e153f747_ef00e3cd","updated":"2023-06-06 11:09:59.000000000","message":"Done","commit_id":"7d8be69e97197410f097f986bbc9fa5f860eee96"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"54d71e1caaaaa8c1e19540dc08674224bef031ed","unresolved":true,"context_lines":[{"line_number":49,"context_line":"def get_fake_resource(resource_type, **attrs):"},{"line_number":50,"context_line":"    \"\"\"Generate fake resource"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    :param type resource_type: Object class"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    :return: Instance of `resource_type` class populated with fake"},{"line_number":55,"context_line":"        values of expected types."}],"source_content_type":"text/x-python","patch_set":2,"id":"9b8540fa_2530b485","line":52,"updated":"2023-06-02 16:58:06.000000000","message":"Need docs for `attrs`\n\nLater: which we don\u0027t seem to be using?","commit_id":"7d8be69e97197410f097f986bbc9fa5f860eee96"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"c5e25585f25aee7852a03f7d3593fc27a171f3c9","unresolved":true,"context_lines":[{"line_number":49,"context_line":"def get_fake_resource(resource_type, **attrs):"},{"line_number":50,"context_line":"    \"\"\"Generate fake resource"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    :param type resource_type: Object class"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    :return: Instance of `resource_type` class populated with fake"},{"line_number":55,"context_line":"        values of expected types."}],"source_content_type":"text/x-python","patch_set":2,"id":"f431253d_33b40fce","line":52,"in_reply_to":"9b8540fa_2530b485","updated":"2023-06-06 11:09:59.000000000","message":"right, now added both","commit_id":"7d8be69e97197410f097f986bbc9fa5f860eee96"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"d52dd612bf71547f624edd7f3772a5478370d6c5","unresolved":false,"context_lines":[{"line_number":49,"context_line":"def get_fake_resource(resource_type, **attrs):"},{"line_number":50,"context_line":"    \"\"\"Generate fake resource"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    :param type resource_type: Object class"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    :return: Instance of `resource_type` class populated with fake"},{"line_number":55,"context_line":"        values of expected types."}],"source_content_type":"text/x-python","patch_set":2,"id":"16f4ef66_da6b64d6","line":52,"in_reply_to":"f431253d_33b40fce","updated":"2023-06-06 15:31:58.000000000","message":"Done","commit_id":"7d8be69e97197410f097f986bbc9fa5f860eee96"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"54d71e1caaaaa8c1e19540dc08674224bef031ed","unresolved":true,"context_lines":[{"line_number":100,"context_line":"            base_attrs[attr[0]] \u003d uuid.uuid4().hex"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    fake \u003d resource_type(**base_attrs)"},{"line_number":103,"context_line":"    return fake"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"def get_fake_resources(resource_type, count\u003d1):"}],"source_content_type":"text/x-python","patch_set":2,"id":"edda49d1_4d7c3c68","line":103,"updated":"2023-06-02 16:58:06.000000000","message":"Proposal: we place this inside a new `openstack.test` module. Something like `openstack.test.fakes`. That was we don\u0027t require users to import something from `openstack.tests`, which is effectively a private module. The test for this would then go to `openstack.tests.unit.test.test_fakes.py`.","commit_id":"7d8be69e97197410f097f986bbc9fa5f860eee96"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"c5e25585f25aee7852a03f7d3593fc27a171f3c9","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            base_attrs[attr[0]] \u003d uuid.uuid4().hex"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    fake \u003d resource_type(**base_attrs)"},{"line_number":103,"context_line":"    return fake"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"def get_fake_resources(resource_type, count\u003d1):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bb58c02b_3c7becfe","line":103,"in_reply_to":"edda49d1_4d7c3c68","updated":"2023-06-06 11:09:59.000000000","message":"Done","commit_id":"7d8be69e97197410f097f986bbc9fa5f860eee96"}],"releasenotes/notes/add-fakes-generator-72c53d34c995fcb2.yaml":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"97a18c95239638fe1020c01abb1de0476d2b4b94","unresolved":true,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Adds fake resource generator to make unittesting in projects relying on"},{"line_number":5,"context_line":"    OpenStackSDK may become easier."}],"source_content_type":"text/x-yaml","patch_set":8,"id":"5bdd563d_f6ef8d06","line":5,"updated":"2023-06-09 16:54:03.000000000","message":"how about:\n\n\u003e Add fake resource generator to ease unit testing in packages that depend on\n\u003e openstacksdk.\n\n?","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"4cee9ae03ee0472d377c82c0b7685f3d07c900dc","unresolved":true,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Adds fake resource generator to make unittesting in projects relying on"},{"line_number":5,"context_line":"    OpenStackSDK may become easier."}],"source_content_type":"text/x-yaml","patch_set":8,"id":"e90d5252_d24af336","line":5,"in_reply_to":"5bdd563d_f6ef8d06","updated":"2023-06-09 17:39:03.000000000","message":"thanks for the idea, I was struggling with it ;-)","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"22dbee2807171cf0852b1c969fc0974f3cf21ed2","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Adds fake resource generator to make unittesting in projects relying on"},{"line_number":5,"context_line":"    OpenStackSDK may become easier."}],"source_content_type":"text/x-yaml","patch_set":8,"id":"3b64aa78_08db8ea8","line":5,"in_reply_to":"e90d5252_d24af336","updated":"2023-07-17 10:54:07.000000000","message":"Done","commit_id":"2ed347072b81573480f8b4d024ac8fd47e67a43e"}]}
