)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6d44969e7dbcb5dd46a8bb5538b9a68824054c87","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"While Python supports using tuples as dict keys, json.dumps() (which"},{"line_number":10,"context_line":"is what oslo_serialization.jsonutils.dumps() calls under the hood)"},{"line_number":11,"context_line":"does not. Stop using tuples as keys in our weight debug log."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ieaaa11bd78bf479c968ccbe614d1c42525b74bd6"},{"line_number":14,"context_line":"Closes-bug: 2028518"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"759fd4f0_1ef3cc79","line":11,"updated":"2023-12-20 08:38:10.000000000","message":"FWIW, this is because of the poor modeling of JSON itself, not the fault to Python. A tuple can be hashable, hence being a dict key.","commit_id":"329023fd34fa049b6fad5bd7fdd95c3066eb3d2b"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f2e8a2c1163cdff4bdeae9da0f448dcfaff366ff","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e996b705_6e2f182f","updated":"2023-12-21 01:33:44.000000000","message":"i have some other ideas of how to do this but this works so im ok with this approch","commit_id":"329023fd34fa049b6fad5bd7fdd95c3066eb3d2b"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"31cbc3c4bb8c4bd3e22d40e7e422ea94a64b8b99","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"824d7f94_14854b16","updated":"2023-12-21 02:21:10.000000000","message":"since you respone lets chat about the best way to adress this tomorrow","commit_id":"f71781d7ccad04e423d925e756702a5db53b5dce"}],"nova/weights.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6d44969e7dbcb5dd46a8bb5538b9a68824054c87","unresolved":true,"context_lines":[{"line_number":135,"context_line":"            return {"},{"line_number":136,"context_line":"                \u0027Host %s node %s\u0027 % (obj.obj.host, obj.obj.nodename): weight"},{"line_number":137,"context_line":"                for obj, weight in zip(weighed_objs, weights)"},{"line_number":138,"context_line":"            }"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        for weigher in weighers:"},{"line_number":141,"context_line":"            weights \u003d weigher.weigh_objects(weighed_objs, weighing_properties)"}],"source_content_type":"text/x-python","patch_set":2,"id":"099338ad_9b032941","line":138,"updated":"2023-12-20 08:38:10.000000000","message":"Yup, looks to me the best way.","commit_id":"329023fd34fa049b6fad5bd7fdd95c3066eb3d2b"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"31cbc3c4bb8c4bd3e22d40e7e422ea94a64b8b99","unresolved":true,"context_lines":[{"line_number":135,"context_line":"            return {"},{"line_number":136,"context_line":"                \u0027Host %s node %s\u0027 % (obj.obj.host, obj.obj.nodename): weight"},{"line_number":137,"context_line":"                for obj, weight in zip(weighed_objs, weights)"},{"line_number":138,"context_line":"            }"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        for weigher in weighers:"},{"line_number":141,"context_line":"            weights \u003d weigher.weigh_objects(weighed_objs, weighing_properties)"}],"source_content_type":"text/x-python","patch_set":2,"id":"f39f7764_137d3830","line":138,"in_reply_to":"099338ad_9b032941","updated":"2023-12-21 02:21:10.000000000","message":"actully a better way would be to use or update the __repr__\nof teh WeighedObject to print want we want and just call str on obj and use that as the key.\nhttps://review.opendev.org/c/openstack/nova/+/904060/3/nova/weights.py#68\n\nwe could add a dedicated __str__ if we want which is jsut \n```\ndef __str__(self):\n   return \u0027Host %s node %s\u0027 % (self.obj.host, self.obj.nodename)\n```\n\nthat would be more pythonic and cleaner then this.","commit_id":"329023fd34fa049b6fad5bd7fdd95c3066eb3d2b"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"0549ad768362d193c5ebb41bec0036c35625d496","unresolved":true,"context_lines":[{"line_number":166,"context_line":"                weigher_score \u003d multiplier * weight"},{"line_number":167,"context_line":"                obj.weight +\u003d weigher_score"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"                log_data[(obj.obj.host, obj.obj.nodename)] \u003d ("},{"line_number":170,"context_line":"                    f\"{multiplier} * {weight}\")"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"            LOG.debug("}],"source_content_type":"text/x-python","patch_set":2,"id":"2209ce01_fc9b4964","line":169,"range":{"start_line":169,"start_character":25,"end_line":169,"end_character":57},"updated":"2023-12-21 01:37:36.000000000","message":"forgot this one :(","commit_id":"329023fd34fa049b6fad5bd7fdd95c3066eb3d2b"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"851cc241655aa1e5c2f3580d3a8693caa7230e77","unresolved":true,"context_lines":[{"line_number":143,"context_line":"            # NOTE(artom) This is a sentinel to make sure we don\u0027t repeat bug"},{"line_number":144,"context_line":"            # 2028518. By sending the log string directly to jsonutils.dumps(),"},{"line_number":145,"context_line":"            # we avoid hiding buggy code behind LOG.debug."},{"line_number":146,"context_line":"            jsonutils.dumps(get_log_string(weighed_objs, weights))"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"            LOG.debug(\"%s: raw weights %s\","},{"line_number":149,"context_line":"                      weigher.__class__.__name__, get_log_string(weighed_objs,"}],"source_content_type":"text/x-python","patch_set":3,"id":"838cc062_1a419a10","line":146,"updated":"2023-12-21 02:22:26.000000000","message":"instead of this i would prefer to add a unit test that mocks log.debug and actully tests the log functionality.","commit_id":"f71781d7ccad04e423d925e756702a5db53b5dce"}]}
