)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6282acc38546de76e233f45dbda40b84f8938a35","unresolved":false,"context_lines":[{"line_number":17,"context_line":"should not be in nova_client.py, to keep it free of ARQ state details."},{"line_number":18,"context_line":"So it has been added in get_arq_bind_status() in ext_arq_job.py."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/700261"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Iddbf9a77196fc42ac82ad1f6d88a4b0732852463"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa7e38b_a206c71a","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":49},"updated":"2020-01-16 15:45:41.000000000","message":"this should be rebased on that patch.\nyou should in generall not use Depends-On in the\nsame repo.","commit_id":"2fe7796204a921f5b04f4f39a4dbbc5c1ad95918"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"8519629954ec4e1b595fc81c0b8d5f98b5591a27","unresolved":false,"context_lines":[{"line_number":17,"context_line":"should not be in nova_client.py, to keep it free of ARQ state details."},{"line_number":18,"context_line":"So it has been added in get_arq_bind_status() in ext_arq_job.py."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Depends-On: https://review.opendev.org/#/c/700261"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Iddbf9a77196fc42ac82ad1f6d88a4b0732852463"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3fa7e38b_7712b357","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":49},"in_reply_to":"3fa7e38b_a206c71a","updated":"2020-01-18 16:34:24.000000000","message":"Done","commit_id":"2fe7796204a921f5b04f4f39a4dbbc5c1ad95918"}],"cyborg/common/constants.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b6dd5c29660838d04ec6b2d5cc8c440d9aa890a3","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"ARQ_BIND_STAGE \u003d (ARQ_PRE_BIND, ARQ_FINISH_BIND,"},{"line_number":30,"context_line":"                  ARQ_OUFOF_BIND_FLOW) \u003d ("},{"line_number":31,"context_line":"    [ARQ_INITIAL, ARQ_BIND_STARTED], [ARQ_BOUND, ARQ_BIND_FAILED],"},{"line_number":32,"context_line":"    [ARQ_UNBOUND, ARQ_DELETING])"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_4d47a31f","side":"PARENT","line":30,"range":{"start_line":30,"start_character":22,"end_line":30,"end_character":27},"updated":"2020-01-06 16:15:09.000000000","message":"If this were nova, I\u0027d ask you to fix this (and the other) typos in a separate gardening patch... :)","commit_id":"6363cb9ab3b1e174fedafbc57be895494664906a"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bad9bf63f4c5d0b0fd6ab93054a05c7acae5f37b","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"ARQ_BIND_STAGE \u003d (ARQ_PRE_BIND, ARQ_FINISH_BIND,"},{"line_number":30,"context_line":"                  ARQ_OUFOF_BIND_FLOW) \u003d ("},{"line_number":31,"context_line":"    [ARQ_INITIAL, ARQ_BIND_STARTED], [ARQ_BOUND, ARQ_BIND_FAILED],"},{"line_number":32,"context_line":"    [ARQ_UNBOUND, ARQ_DELETING])"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_316639f0","side":"PARENT","line":30,"range":{"start_line":30,"start_character":22,"end_line":30,"end_character":27},"in_reply_to":"3fa7e38b_4d47a31f","updated":"2020-01-13 04:47:12.000000000","message":"Done","commit_id":"6363cb9ab3b1e174fedafbc57be895494664906a"}],"cyborg/common/exception.py":[{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"49a3c201a36d50ca2dd2b87fe7f8581b29abd0d5","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    code \u003d http_client.FORBIDDEN"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"# TODO(Sundar): Eliminate this after ARQBadState is merged."},{"line_number":96,"context_line":"class ARQInvalidState(CyborgException):"},{"line_number":97,"context_line":"    _msg_fmt \u003d _(\"Accelerator Requests cannot be requested with \""},{"line_number":98,"context_line":"                 \"state %(state)s.\")"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"class ARQBadState(CyborgException):"},{"line_number":102,"context_line":"    _msg_fmt \u003d _(\u0027Bad state \\\"%(state)s\\\" for ARQ %(uuid)s. \u0027"},{"line_number":103,"context_line":"                 \u0027Expected state(s): %(expected)s\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"class AttachHandleAlreadyExists(CyborgException):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_a06438e7","line":103,"range":{"start_line":95,"start_character":0,"end_line":103,"end_character":51},"updated":"2020-02-10 10:05:58.000000000","message":"IMO, this 2 exception have the similar functionality, why don\u0027t we leave just one of them？","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6ccc807400896f02f99739515006c902b94593f5","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    code \u003d http_client.FORBIDDEN"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"# TODO(Sundar): Eliminate this after ARQBadState is merged."},{"line_number":96,"context_line":"class ARQInvalidState(CyborgException):"},{"line_number":97,"context_line":"    _msg_fmt \u003d _(\"Accelerator Requests cannot be requested with \""},{"line_number":98,"context_line":"                 \"state %(state)s.\")"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"class ARQBadState(CyborgException):"},{"line_number":102,"context_line":"    _msg_fmt \u003d _(\u0027Bad state \\\"%(state)s\\\" for ARQ %(uuid)s. \u0027"},{"line_number":103,"context_line":"                 \u0027Expected state(s): %(expected)s\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"class AttachHandleAlreadyExists(CyborgException):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_92e4e70c","line":103,"range":{"start_line":95,"start_character":0,"end_line":103,"end_character":51},"in_reply_to":"3fa7e38b_a06438e7","updated":"2020-02-10 16:43:52.000000000","message":"ARWInvalidState is too restrictive for many places where we use the second one. As the TODO says, we can probably replace ARQInvalidState with BadState, but that requires discussion and could be a separate patch.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"}],"cyborg/common/nova_client.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b6dd5c29660838d04ec6b2d5cc8c440d9aa890a3","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            # is due to a race condition where Nova has not associated"},{"line_number":53,"context_line":"            # the instance with a host yet. See"},{"line_number":54,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1855752"},{"line_number":55,"context_line":"            err_event \u003d response.json()[\u0027events\u0027][0]  # Only 1 event in resp"},{"line_number":56,"context_line":"            if err_event[\u0027code\u0027] \u003d\u003d 422:"},{"line_number":57,"context_line":"                LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":58,"context_line":"                         \u0027instance %s is not yet associated with a host.\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_cd3393c3","line":55,"updated":"2020-01-06 16:15:09.000000000","message":"Is this still correct? I thought you\u0027re now sending multiple events, so you need to check the per-event status for all of them, right? I know that *currently* the reason for getting a 422 is likely to be the same for all of the events in a batch, but that may not be true in the future, so I would think you should check them all (or at least assert that they\u0027re all the same).","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bad9bf63f4c5d0b0fd6ab93054a05c7acae5f37b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            # is due to a race condition where Nova has not associated"},{"line_number":53,"context_line":"            # the instance with a host yet. See"},{"line_number":54,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1855752"},{"line_number":55,"context_line":"            err_event \u003d response.json()[\u0027events\u0027][0]  # Only 1 event in resp"},{"line_number":56,"context_line":"            if err_event[\u0027code\u0027] \u003d\u003d 422:"},{"line_number":57,"context_line":"                LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":58,"context_line":"                         \u0027instance %s is not yet associated with a host.\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_f42def8f","line":55,"in_reply_to":"3fa7e38b_cd3393c3","updated":"2020-01-13 04:47:12.000000000","message":"Yes, the current code sends all events together, so expects only one type of response code for all events in this context. Will future-proof by checking that all have the same code.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9b6a88cbeaa5e7f24d59dfe6b2ad7684e21e181","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            # is due to a race condition where Nova has not associated"},{"line_number":53,"context_line":"            # the instance with a host yet. See"},{"line_number":54,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1855752"},{"line_number":55,"context_line":"            err_event \u003d response.json()[\u0027events\u0027][0]  # Only 1 event in resp"},{"line_number":56,"context_line":"            if err_event[\u0027code\u0027] \u003d\u003d 422:"},{"line_number":57,"context_line":"                LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":58,"context_line":"                         \u0027instance %s is not yet associated with a host.\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_9a825251","line":55,"in_reply_to":"3fa7e38b_f42def8f","updated":"2020-01-13 15:25:26.000000000","message":"I think that\u0027d be good.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b6dd5c29660838d04ec6b2d5cc8c440d9aa890a3","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        :param get_arq_bind_status:"},{"line_number":72,"context_line":"            Function that returns the bind status of a given ARQ."},{"line_number":73,"context_line":"            See cyborg/objects/extarq/ext_arq_job.py:get_arq_bind_status()"},{"line_number":74,"context_line":"            This function is passed here to avoid circular dependence between"},{"line_number":75,"context_line":"            this file and ext_arq_job.py."},{"line_number":76,"context_line":"        \"\"\""},{"line_number":77,"context_line":"        events \u003d self._get_acc_changed_events(instance_uuid, arq_list,"},{"line_number":78,"context_line":"                                              get_arq_bind_status)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_4a00e935","line":75,"range":{"start_line":74,"start_character":12,"end_line":75,"end_character":40},"updated":"2020-01-06 16:15:09.000000000","message":"The circular dependency exists regardless, so I assume this means it avoids \"circular imports\" right? Typically the solution to this is to just do the import in the method itself (_get_acc_changed_events in this case) It\u0027s also common to do it in the __init__ of this api class, and stashing a pointer to that method on self. Passing the method around like this makes it harder to trace where it is defined, IMHO.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bad9bf63f4c5d0b0fd6ab93054a05c7acae5f37b","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        :param get_arq_bind_status:"},{"line_number":72,"context_line":"            Function that returns the bind status of a given ARQ."},{"line_number":73,"context_line":"            See cyborg/objects/extarq/ext_arq_job.py:get_arq_bind_status()"},{"line_number":74,"context_line":"            This function is passed here to avoid circular dependence between"},{"line_number":75,"context_line":"            this file and ext_arq_job.py."},{"line_number":76,"context_line":"        \"\"\""},{"line_number":77,"context_line":"        events \u003d self._get_acc_changed_events(instance_uuid, arq_list,"},{"line_number":78,"context_line":"                                              get_arq_bind_status)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_142beb7b","line":75,"range":{"start_line":74,"start_character":12,"end_line":75,"end_character":40},"in_reply_to":"3fa7e38b_4a00e935","updated":"2020-01-13 04:47:12.000000000","message":"Done","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"094c4ab172c7c59ca728cc7f4324e754333b0f68","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1855752"},{"line_number":57,"context_line":"            events \u003d [ev for ev in response.json()[\u0027events\u0027]]"},{"line_number":58,"context_line":"            event_codes \u003d [ev[\u0027code\u0027] for ev in events]"},{"line_number":59,"context_line":"            if len(set(event_codes)) \u003d\u003d 1:  # all events have same event code"},{"line_number":60,"context_line":"                if event_codes[0] \u003d\u003d 422:"},{"line_number":61,"context_line":"                    LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":62,"context_line":"                             \u0027instance %s is not yet associated with a host.\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_2a18a91d","line":59,"updated":"2020-01-14 00:28:58.000000000","message":"Create a set in line 58 to avoid the need for a cast in line 59.","commit_id":"f491af7278489392b3aa082f9a82de73e85285bd"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"99965bc74c9cb0782ac7866e7423d3f5b2a94449","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1855752"},{"line_number":57,"context_line":"            events \u003d [ev for ev in response.json()[\u0027events\u0027]]"},{"line_number":58,"context_line":"            event_codes \u003d [ev[\u0027code\u0027] for ev in events]"},{"line_number":59,"context_line":"            if len(set(event_codes)) \u003d\u003d 1:  # all events have same event code"},{"line_number":60,"context_line":"                if event_codes[0] \u003d\u003d 422:"},{"line_number":61,"context_line":"                    LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":62,"context_line":"                             \u0027instance %s is not yet associated with a host.\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_30c6af17","line":59,"in_reply_to":"3fa7e38b_2a18a91d","updated":"2020-01-15 19:11:50.000000000","message":"Done","commit_id":"f491af7278489392b3aa082f9a82de73e85285bd"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"49a3c201a36d50ca2dd2b87fe7f8581b29abd0d5","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":29,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":32,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_4084645d","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":68},"updated":"2020-02-10 10:05:58.000000000","message":"It is not general usage of \"import\", at least in openstack project. if you want use import it, please import it in the beginning of this file.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6ccc807400896f02f99739515006c902b94593f5","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":29,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":32,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_d2757f34","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":68},"in_reply_to":"3fa7e38b_4084645d","updated":"2020-02-10 16:43:52.000000000","message":"That would result in a situation where each file is importing from the other. The suggestion from experts is to keep the import here to avoid any circularity.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"49a75d1f9f43708aee4240494c4557dea866943d","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":29,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":32,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_b8cd3a5c","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":68},"in_reply_to":"3fa7e38b_42c77798","updated":"2020-02-11 07:26:30.000000000","message":"We have discussed offline and agreed to leave this as is.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"ad17e958b9d4d083f976ec8d3e0ed4d799f84c18","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":29,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":32,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_42c77798","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":68},"in_reply_to":"3fa7e38b_5f251015","updated":"2020-02-11 03:06:21.000000000","message":"Agree with xinran, that we can avoid import the same class more than one in a same file.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"ce26c46474256de94e5e70415f5e861a377608d7","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":29,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":32,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_0af43155","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":68},"in_reply_to":"3fa7e38b_695db652","updated":"2020-02-11 13:06:41.000000000","message":"https://review.opendev.org/#/c/698846/6/cyborg/objects/extarq/ext_arq_job.py@196 \nno tight couple. \n\nHere, the client is just a common lib, and other cyborg files can call it.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f668e44e9269cee4d30000ff8fcb499281d4ff89","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":29,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":32,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_695db652","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":68},"in_reply_to":"3fa7e38b_b8cd3a5c","updated":"2020-02-11 11:16:47.000000000","message":"when this is required however it indicates that the current structure of the code likely needs to be reconsidered as there is clearly too tight a coupling between classes in both modules.\n\nyou should in general never call functions in a mixin class directly and only call them via inheritance. so that is the other thing that striks me as ode with this code that has lead to this situation","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"0c052d22c5012b4dfab46c995409f70022acb1df","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":29,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":32,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_5f251015","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":68},"in_reply_to":"3fa7e38b_d2757f34","updated":"2020-02-11 02:02:28.000000000","message":"I have met this importing circle before, you are right, the general suggestion is importing it just before use it. IMO we should avoid this issue as possible as we can.  Can we do https://stackoverflow.com/questions/7336802/how-to-avoid-circular-imports-in-python/37126790 instead?","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"49a3c201a36d50ca2dd2b87fe7f8581b29abd0d5","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            events \u003d [ev for ev in response.json()[\u0027events\u0027]]"},{"line_number":58,"context_line":"            event_codes \u003d {ev[\u0027code\u0027] for ev in events}"},{"line_number":59,"context_line":"            if len(event_codes) \u003d\u003d 1:  # all events have same event code"},{"line_number":60,"context_line":"                if event_codes \u003d\u003d {422}:"},{"line_number":61,"context_line":"                    LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":62,"context_line":"                             \u0027instance %s is not yet associated with a host.\u0027,"},{"line_number":63,"context_line":"                             events[0][\u0027server_uuid\u0027])"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise exception.InvalidAPIResponse("},{"line_number":66,"context_line":"                    service\u003d\u0027Nova\u0027, api\u003durl[1:],"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_c08cd43a","line":63,"range":{"start_line":60,"start_character":0,"end_line":63,"end_character":54},"updated":"2020-02-10 10:05:58.000000000","message":"Is there any possibility to have an \"else\" here? Any situation that all events have same event code but is not 422?","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"49a75d1f9f43708aee4240494c4557dea866943d","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            events \u003d [ev for ev in response.json()[\u0027events\u0027]]"},{"line_number":58,"context_line":"            event_codes \u003d {ev[\u0027code\u0027] for ev in events}"},{"line_number":59,"context_line":"            if len(event_codes) \u003d\u003d 1:  # all events have same event code"},{"line_number":60,"context_line":"                if event_codes \u003d\u003d {422}:"},{"line_number":61,"context_line":"                    LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":62,"context_line":"                             \u0027instance %s is not yet associated with a host.\u0027,"},{"line_number":63,"context_line":"                             events[0][\u0027server_uuid\u0027])"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise exception.InvalidAPIResponse("},{"line_number":66,"context_line":"                    service\u003d\u0027Nova\u0027, api\u003durl[1:],"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_958847c4","line":63,"range":{"start_line":60,"start_character":0,"end_line":63,"end_character":54},"in_reply_to":"3fa7e38b_7f780cf6","updated":"2020-02-11 07:26:30.000000000","message":"Done","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6ccc807400896f02f99739515006c902b94593f5","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            events \u003d [ev for ev in response.json()[\u0027events\u0027]]"},{"line_number":58,"context_line":"            event_codes \u003d {ev[\u0027code\u0027] for ev in events}"},{"line_number":59,"context_line":"            if len(event_codes) \u003d\u003d 1:  # all events have same event code"},{"line_number":60,"context_line":"                if event_codes \u003d\u003d {422}:"},{"line_number":61,"context_line":"                    LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":62,"context_line":"                             \u0027instance %s is not yet associated with a host.\u0027,"},{"line_number":63,"context_line":"                             events[0][\u0027server_uuid\u0027])"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise exception.InvalidAPIResponse("},{"line_number":66,"context_line":"                    service\u003d\u0027Nova\u0027, api\u003durl[1:],"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_d236df4f","line":63,"range":{"start_line":60,"start_character":0,"end_line":63,"end_character":54},"in_reply_to":"3fa7e38b_c08cd43a","updated":"2020-02-10 16:43:52.000000000","message":"If the HTTP response code is 207, it is an error -- except if the event code is 422. If the event code is something else, we\u0027ll treat it as an error.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"0c052d22c5012b4dfab46c995409f70022acb1df","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            events \u003d [ev for ev in response.json()[\u0027events\u0027]]"},{"line_number":58,"context_line":"            event_codes \u003d {ev[\u0027code\u0027] for ev in events}"},{"line_number":59,"context_line":"            if len(event_codes) \u003d\u003d 1:  # all events have same event code"},{"line_number":60,"context_line":"                if event_codes \u003d\u003d {422}:"},{"line_number":61,"context_line":"                    LOG.info(\u0027Ignoring Nova notification error that the \u0027"},{"line_number":62,"context_line":"                             \u0027instance %s is not yet associated with a host.\u0027,"},{"line_number":63,"context_line":"                             events[0][\u0027server_uuid\u0027])"},{"line_number":64,"context_line":"            else:"},{"line_number":65,"context_line":"                raise exception.InvalidAPIResponse("},{"line_number":66,"context_line":"                    service\u003d\u0027Nova\u0027, api\u003durl[1:],"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_7f780cf6","line":63,"range":{"start_line":60,"start_character":0,"end_line":63,"end_character":54},"in_reply_to":"3fa7e38b_d236df4f","updated":"2020-02-11 02:02:28.000000000","message":"So we do need an else to treat other same event error code here. Otherwise, it will be ignored. The else below is for the different event code.","commit_id":"26fc0a4fd24a78c94dd54d530592e63a26c4460e"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"7cc7f1e436dcc5e9ff2ac232c39b4e40a66c5e44","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":30,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_737043a8","line":30,"range":{"start_line":30,"start_character":8,"end_line":30,"end_character":68},"updated":"2020-02-11 08:24:41.000000000","message":"to avoid import loop?","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"eb86d3c5984218e6db955808730a031ccb7109d1","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":30,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_7e66c3f2","line":30,"range":{"start_line":30,"start_character":8,"end_line":30,"end_character":68},"in_reply_to":"3fa7e38b_2d9fc7f6","updated":"2020-02-12 00:32:14.000000000","message":"Yes, this has been discussed in PS1. Given the long discussions, I changed the patch set to skip the circularity and avoid this import.","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d54dd8ff793a8701bd908390a38a53e47e9a62e7","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        self.nova_client.default_microversion \u003d \u0027latest\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":30,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_2d9fc7f6","line":30,"range":{"start_line":30,"start_character":8,"end_line":30,"end_character":68},"in_reply_to":"3fa7e38b_737043a8","updated":"2020-02-11 13:59:05.000000000","message":"yep","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"7cc7f1e436dcc5e9ff2ac232c39b4e40a66c5e44","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":30,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"},{"line_number":34,"context_line":"                 \u0027tag\u0027: arq.uuid,"},{"line_number":35,"context_line":"                 \u0027status\u0027: ExtARQJobMixin.get_arq_bind_status("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_b3879b5c","line":32,"range":{"start_line":32,"start_character":26,"end_line":32,"end_character":51},"updated":"2020-02-11 08:24:41.000000000","message":"This is a request special name.\n\nIMHO, this whole function can be in ARQ class.","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"eb86d3c5984218e6db955808730a031ccb7109d1","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    def _get_acc_changed_events(self, instance_uuid, arq_list):"},{"line_number":30,"context_line":"        from cyborg.objects.extarq.ext_arq_job import ExtARQJobMixin"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"},{"line_number":34,"context_line":"                 \u0027tag\u0027: arq.uuid,"},{"line_number":35,"context_line":"                 \u0027status\u0027: ExtARQJobMixin.get_arq_bind_status("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_7e9b23c6","line":32,"range":{"start_line":32,"start_character":26,"end_line":32,"end_character":51},"in_reply_to":"3fa7e38b_b3879b5c","updated":"2020-02-12 00:32:14.000000000","message":"Code related to ARQs stays in ARQ class. Code related to events are here. The only data that this function needs is the list of ARQ UUIDs. Hence the split.","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"7cc7f1e436dcc5e9ff2ac232c39b4e40a66c5e44","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"},{"line_number":34,"context_line":"                 \u0027tag\u0027: arq.uuid,"},{"line_number":35,"context_line":"                 \u0027status\u0027: ExtARQJobMixin.get_arq_bind_status("},{"line_number":36,"context_line":"                     arq.state, arq.uuid)"},{"line_number":37,"context_line":"                 } for arq in arq_list]"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_93837f55","line":35,"range":{"start_line":35,"start_character":27,"end_line":35,"end_character":61},"updated":"2020-02-11 08:24:41.000000000","message":"This can be a callback in low level language such as C.","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"eb86d3c5984218e6db955808730a031ccb7109d1","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"},{"line_number":34,"context_line":"                 \u0027tag\u0027: arq.uuid,"},{"line_number":35,"context_line":"                 \u0027status\u0027: ExtARQJobMixin.get_arq_bind_status("},{"line_number":36,"context_line":"                     arq.state, arq.uuid)"},{"line_number":37,"context_line":"                 } for arq in arq_list]"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_ca192e87","line":35,"range":{"start_line":35,"start_character":27,"end_line":35,"end_character":61},"in_reply_to":"3fa7e38b_6da93f23","updated":"2020-02-12 00:32:14.000000000","message":"Indeed. That\u0027s what I am doing in the next PS.","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d54dd8ff793a8701bd908390a38a53e47e9a62e7","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":33,"context_line":"                 \u0027server_uuid\u0027: instance_uuid,"},{"line_number":34,"context_line":"                 \u0027tag\u0027: arq.uuid,"},{"line_number":35,"context_line":"                 \u0027status\u0027: ExtARQJobMixin.get_arq_bind_status("},{"line_number":36,"context_line":"                     arq.state, arq.uuid)"},{"line_number":37,"context_line":"                 } for arq in arq_list]"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_6da93f23","line":35,"range":{"start_line":35,"start_character":27,"end_line":35,"end_character":61},"in_reply_to":"3fa7e38b_93837f55","updated":"2020-02-11 13:59:05.000000000","message":"you can use call back function n python too. although really you chould just pass in the satatus as was done before.","commit_id":"e940dca3871de189b7f6c11687e04a7fce24ff99"}],"cyborg/objects/extarq/ext_arq_job.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b6dd5c29660838d04ec6b2d5cc8c440d9aa890a3","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        # deleting state. So, arq_state must be \u0027Bound\u0027, \u0027BindFailed\u0027"},{"line_number":108,"context_line":"        # or \u0027Deleting\u0027"},{"line_number":109,"context_line":"        state_map \u003d constants.ARQ_BIND_STATES_STATUS_MAP"},{"line_number":110,"context_line":"        if arq_state not in state_map.keys():"},{"line_number":111,"context_line":"            # TODO(Sundar): Adapt ARQInvalidState exception and use it here."},{"line_number":112,"context_line":"            raise Exception("},{"line_number":113,"context_line":"                _(\u0027State %(state)s for ARQ %(uuid)s not in %(valid)s\u0027) %"},{"line_number":114,"context_line":"                {\u0027state\u0027: arq_state,"},{"line_number":115,"context_line":"                 \u0027uuid\u0027: arq_uuid,"},{"line_number":116,"context_line":"                 \u0027valid\u0027: state_map.keys()})"},{"line_number":117,"context_line":"        return state_map[arq_state]"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_8d9d9bbb","line":116,"range":{"start_line":110,"start_character":0,"end_line":116,"end_character":44},"updated":"2020-01-06 16:15:09.000000000","message":"This is not tested, AFAICT.\n\nSince this is clearly an external-to-this-module interface, I\u0027d expect it should also have its own happy-path unit test.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bad9bf63f4c5d0b0fd6ab93054a05c7acae5f37b","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        # deleting state. So, arq_state must be \u0027Bound\u0027, \u0027BindFailed\u0027"},{"line_number":108,"context_line":"        # or \u0027Deleting\u0027"},{"line_number":109,"context_line":"        state_map \u003d constants.ARQ_BIND_STATES_STATUS_MAP"},{"line_number":110,"context_line":"        if arq_state not in state_map.keys():"},{"line_number":111,"context_line":"            # TODO(Sundar): Adapt ARQInvalidState exception and use it here."},{"line_number":112,"context_line":"            raise Exception("},{"line_number":113,"context_line":"                _(\u0027State %(state)s for ARQ %(uuid)s not in %(valid)s\u0027) %"},{"line_number":114,"context_line":"                {\u0027state\u0027: arq_state,"},{"line_number":115,"context_line":"                 \u0027uuid\u0027: arq_uuid,"},{"line_number":116,"context_line":"                 \u0027valid\u0027: state_map.keys()})"},{"line_number":117,"context_line":"        return state_map[arq_state]"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_a7b8abe7","line":116,"range":{"start_line":110,"start_character":0,"end_line":116,"end_character":44},"in_reply_to":"3fa7e38b_8d9d9bbb","updated":"2020-01-13 04:47:12.000000000","message":"Done","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b6dd5c29660838d04ec6b2d5cc8c440d9aa890a3","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                      \"For some ARQs %s are deleted.\","},{"line_number":133,"context_line":"                      arq_uuids, constants.ARQ_BIND_STATUS_FAILED,"},{"line_number":134,"context_line":"                      set(arq_uuids) - set([[ea.arq.uuid for ea in extarqs]]))"},{"line_number":135,"context_line":"            cls.bind_notify(instance_uuid, arq_list)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        status \u003d constants.ARQ_BIND_STATUS_FINISH"},{"line_number":138,"context_line":"        for extarq in extarqs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_edea0f0c","line":135,"updated":"2020-01-06 16:15:09.000000000","message":"I could be wrong, but I don\u0027t think this case is tested. I\u0027m also not sure what this means (extargs \u003c arg_uuids) so maybe I\u0027m missing that it\u0027s handled in another test.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bad9bf63f4c5d0b0fd6ab93054a05c7acae5f37b","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                      \"For some ARQs %s are deleted.\","},{"line_number":133,"context_line":"                      arq_uuids, constants.ARQ_BIND_STATUS_FAILED,"},{"line_number":134,"context_line":"                      set(arq_uuids) - set([[ea.arq.uuid for ea in extarqs]]))"},{"line_number":135,"context_line":"            cls.bind_notify(instance_uuid, arq_list)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        status \u003d constants.ARQ_BIND_STATUS_FINISH"},{"line_number":138,"context_line":"        for extarq in extarqs:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_c7a287ad","line":135,"in_reply_to":"3fa7e38b_edea0f0c","updated":"2020-01-13 04:47:12.000000000","message":"The original author of this code has proposed WIP patches to add more UT for this entire area.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"}],"cyborg/tests/unit/common/test_nova_client.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b6dd5c29660838d04ec6b2d5cc8c440d9aa890a3","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000002\u0027},"},{"line_number":35,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000003\u0027},"},{"line_number":36,"context_line":"        ]"},{"line_number":37,"context_line":"        [event.update(template) for event in self.events]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.mock_sdk \u003d self.useFixture(fixtures.MockPatch("},{"line_number":40,"context_line":"            \u0027cyborg.common.utils.get_sdk_adapter\u0027)).mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_cdfb9312","line":37,"range":{"start_line":37,"start_character":8,"end_line":37,"end_character":57},"updated":"2020-01-06 16:15:09.000000000","message":"This is a pretty bad abuse of a list comprehension. If you\u0027re iterating to take some effect, you should use a regular loop, IMHO. The indirectness of this makes it pretty obscure -- I was about to suggest that this was residue from cleanup that looked like it could just be removed.\n\nWhy not just build the whole event list as a comprehension?\n\n tags \u003d [\u002700000000-0000-0000-0000-000000000002\u0027,\n        [\u002700000000-0000-0000-0000-000000000003\u0027]\n self.events \u003d [dict(template, tag\u003dtag) for tag in tags]","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"c8924ae26de187743bb57c8b478fd4bf6e5a9458","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000002\u0027},"},{"line_number":35,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000003\u0027},"},{"line_number":36,"context_line":"        ]"},{"line_number":37,"context_line":"        [event.update(template) for event in self.events]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.mock_sdk \u003d self.useFixture(fixtures.MockPatch("},{"line_number":40,"context_line":"            \u0027cyborg.common.utils.get_sdk_adapter\u0027)).mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_63329911","line":37,"range":{"start_line":37,"start_character":8,"end_line":37,"end_character":57},"updated":"2020-01-08 00:38:14.000000000","message":"Yes, this is very strangely.\nIn order to update self.events, get a result list with all None elements of this list comprehension.\n\nit is twist.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"0abdd3c13b1d3f8f5953a0dc63ccc1ee49bde176","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000002\u0027},"},{"line_number":35,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000003\u0027},"},{"line_number":36,"context_line":"        ]"},{"line_number":37,"context_line":"        [event.update(template) for event in self.events]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.mock_sdk \u003d self.useFixture(fixtures.MockPatch("},{"line_number":40,"context_line":"            \u0027cyborg.common.utils.get_sdk_adapter\u0027)).mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_f61a0eca","line":37,"range":{"start_line":37,"start_character":8,"end_line":37,"end_character":57},"in_reply_to":"1fa4df85_93a88c8c","updated":"2020-03-03 02:06:30.000000000","message":"yes, looks it is similar case.\n\nit is introduced by:\nhttps://review.opendev.org/#/c/349577/3/nova/tests/unit/db/test_db_api.py@3555","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1ff7e934211d0451be95c96eaf58fcc3f56bbbe3","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000002\u0027},"},{"line_number":35,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000003\u0027},"},{"line_number":36,"context_line":"        ]"},{"line_number":37,"context_line":"        [event.update(template) for event in self.events]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.mock_sdk \u003d self.useFixture(fixtures.MockPatch("},{"line_number":40,"context_line":"            \u0027cyborg.common.utils.get_sdk_adapter\u0027)).mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_1591d74e","line":37,"range":{"start_line":37,"start_character":8,"end_line":37,"end_character":57},"in_reply_to":"1fa4df85_f61a0eca","updated":"2020-03-03 15:24:45.000000000","message":"Excellent, thanks.\n\nhttps://review.opendev.org/711039","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9b6a88cbeaa5e7f24d59dfe6b2ad7684e21e181","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000002\u0027},"},{"line_number":35,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000003\u0027},"},{"line_number":36,"context_line":"        ]"},{"line_number":37,"context_line":"        [event.update(template) for event in self.events]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.mock_sdk \u003d self.useFixture(fixtures.MockPatch("},{"line_number":40,"context_line":"            \u0027cyborg.common.utils.get_sdk_adapter\u0027)).mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_fad58649","line":37,"range":{"start_line":37,"start_character":8,"end_line":37,"end_character":57},"in_reply_to":"3fa7e38b_744fbf68","updated":"2020-01-13 15:25:26.000000000","message":"Point them out and I will gladly fix them :)","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bad9bf63f4c5d0b0fd6ab93054a05c7acae5f37b","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000002\u0027},"},{"line_number":35,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000003\u0027},"},{"line_number":36,"context_line":"        ]"},{"line_number":37,"context_line":"        [event.update(template) for event in self.events]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.mock_sdk \u003d self.useFixture(fixtures.MockPatch("},{"line_number":40,"context_line":"            \u0027cyborg.common.utils.get_sdk_adapter\u0027)).mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_744fbf68","line":37,"range":{"start_line":37,"start_character":8,"end_line":37,"end_character":57},"in_reply_to":"3fa7e38b_cdfb9312","updated":"2020-01-13 04:47:12.000000000","message":"I have seen similar code in Nova too. :) But other sources also discourage list comprehensions with side effects. So I\u0027ll change this.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"73c16a20b81a37689317fdea74796c6f70a95e47","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000002\u0027},"},{"line_number":35,"context_line":"            {\u0027tag\u0027: \u002700000000-0000-0000-0000-000000000003\u0027},"},{"line_number":36,"context_line":"        ]"},{"line_number":37,"context_line":"        [event.update(template) for event in self.events]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.mock_sdk \u003d self.useFixture(fixtures.MockPatch("},{"line_number":40,"context_line":"            \u0027cyborg.common.utils.get_sdk_adapter\u0027)).mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"1fa4df85_93a88c8c","line":37,"range":{"start_line":37,"start_character":8,"end_line":37,"end_character":57},"in_reply_to":"3fa7e38b_fad58649","updated":"2020-03-02 23:52:32.000000000","message":"Took me a while to remember where I saw them, but here we go :)\n\nhttps://github.com/openstack/nova/blob/master/nova/tests/unit/db/test_db_api.py#L3557 \nhttps://github.com/openstack/nova/blob/master/nova/tests/unit/db/test_db_api.py#L3579","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"}],"cyborg/tests/unit/objects/test_extarq.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b6dd5c29660838d04ec6b2d5cc8c440d9aa890a3","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        mock_notify_bind.assert_called_once()"},{"line_number":160,"context_line":"        call_args \u003d mock_notify_bind.call_args.args"},{"line_number":161,"context_line":"        self.assertEqual(call_args[0], instance_uuid)"},{"line_number":162,"context_line":"        self.assertEqual(call_args[1][0].__dict__, obj_extarq.arq.__dict__)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @mock.patch(\u0027openstack.connection.Connection\u0027)"},{"line_number":165,"context_line":"    @mock.patch(\u0027cyborg.common.nova_client.NovaAPI.notify_binding\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_4d3803d3","line":162,"updated":"2020-01-06 16:15:09.000000000","message":"Why not\n\n mock_notify_bind.assert_called_once_with(...)\n\n?","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bad9bf63f4c5d0b0fd6ab93054a05c7acae5f37b","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        mock_notify_bind.assert_called_once()"},{"line_number":160,"context_line":"        call_args \u003d mock_notify_bind.call_args.args"},{"line_number":161,"context_line":"        self.assertEqual(call_args[0], instance_uuid)"},{"line_number":162,"context_line":"        self.assertEqual(call_args[1][0].__dict__, obj_extarq.arq.__dict__)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @mock.patch(\u0027openstack.connection.Connection\u0027)"},{"line_number":165,"context_line":"    @mock.patch(\u0027cyborg.common.nova_client.NovaAPI.notify_binding\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_8706cf1a","line":162,"in_reply_to":"3fa7e38b_4d3803d3","updated":"2020-01-13 04:47:12.000000000","message":"Having the function pointer as an arg complicated this a bit, but that is gone now. Changed it.","commit_id":"43d6ccd0e6239eeeaabc6378fdb64291fd5fe58b"}]}
