)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4486d829678c85899002d44f7853de274f114fad","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"42af7500_8323c8fa","updated":"2022-08-31 14:49:07.000000000","message":"i like that we don\u0027t have to pass around the shard prefix - it doesn\u0027t seem like it\u0027s going to effect root\u003d\u003echildren relationships.  But I think maybe we should also make it not apply to shard\u003d\u003esub-shard relationships for consistency.","commit_id":"ed56eb5661fde1ac88456162cb1748f5471c8e04"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9b3b8fbf082e3ab1760b25e5e55463c175002a8e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"d9349895_fd4aa752","updated":"2022-09-07 14:00:33.000000000","message":"this fails:\n\n  diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py\nindex 789901727..9fc9ddb67 100644\n--- a/test/unit/common/test_utils.py\n+++ b/test/unit/common/test_utils.py\n@@ -9046,6 +9046,13 @@ class TestShardRange(unittest.TestCase):\n\n         self.assertFalse(other_a1_r1_gp1_p1.is_child_of(a1_r1_gp1_p1))\n\n+        ts \u003d next(self.ts_iter)\n+        aa1_r1 \u003d utils.ShardRange(\u0027aa1/r1\u0027, ts)\n+        other_aa1_r1_gp1 \u003d utils.ShardRange(utils.ShardRange.make_path(\n+            \u0027.shards_shards_aa1\u0027, \u0027r1\u0027, aa1_r1.container, ts, 2), ts)\n+        self.assertFalse(other_a1_r1_gp1.is_child_of(aa1_r1))\n+        self.assertFalse(other_aa1_r1_gp1.is_child_of(a1_r1))\n+\n         self.assertFalse(a1_r1_gp1_p1_c1.is_child_of(a1_r1))\n         self.assertFalse(a1_r1_gp1_p1_c1.is_child_of(a1_r1_gp1))\n         self.assertFalse(a1_r1_gp1_p1_c1.is_child_of(a1_r1_gp1_p2))","commit_id":"1787bb2b35e81bda28eb5f0fb2b687feddd90013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"82552e7c07f48f753ddffd9e298634fc6618f6b1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"828d0d80_e1a834c6","updated":"2022-09-08 18:41:17.000000000","message":"this was misguided in some ways and may not be very useful anymore","commit_id":"1787bb2b35e81bda28eb5f0fb2b687feddd90013"}],"swift/common/utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4486d829678c85899002d44f7853de274f114fad","unresolved":true,"context_lines":[{"line_number":5347,"context_line":"        try:"},{"line_number":5348,"context_line":"            parsed_parent_name \u003d ShardName.parse(parent.name)"},{"line_number":5349,"context_line":"        except ValueError:"},{"line_number":5350,"context_line":"            if not parsed_name.account.endswith(parent.account):"},{"line_number":5351,"context_line":"                return False"},{"line_number":5352,"context_line":"            root_container \u003d parent.container"},{"line_number":5353,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"dcf0433a_45915591","line":5350,"updated":"2022-08-31 14:49:07.000000000","message":"maybe instead of endswith (which has problems distinguishing between accounts a1 and aa1) we could\n\n\tdiff --git a/swift/common/utils.py b/swift/common/utils.py\n\tindex 1789a9cc4..6790090d2 100644\n\t--- a/swift/common/utils.py\n\t+++ b/swift/common/utils.py\n\t@@ -5347,7 +5347,7 @@ class ShardRange(object):\n\t\t try:\n\t\t     parsed_parent_name \u003d ShardName.parse(parent.name)\n\t\t except ValueError:\n\t-            if not parsed_name.account.endswith(parent.account):\n\t+            if parsed_name.account.rsplit(\u0027_\u0027, 1)[1] !\u003d parent.account:\n\t\t\t return False\n\t\t     root_container \u003d parent.container\n\t\t else:\n\n... or something else that doesn\u0027t blow up if the underscore is missing","commit_id":"ed56eb5661fde1ac88456162cb1748f5471c8e04"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4e6c3611da54fe8d215bb892aff97b3e297814df","unresolved":true,"context_lines":[{"line_number":5347,"context_line":"        try:"},{"line_number":5348,"context_line":"            parsed_parent_name \u003d ShardName.parse(parent.name)"},{"line_number":5349,"context_line":"        except ValueError:"},{"line_number":5350,"context_line":"            if not parsed_name.account.endswith(parent.account):"},{"line_number":5351,"context_line":"                return False"},{"line_number":5352,"context_line":"            root_container \u003d parent.container"},{"line_number":5353,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"a037f040_df641d85","line":5350,"in_reply_to":"dcf0433a_45915591","updated":"2022-09-02 13:46:15.000000000","message":"I think (unfortunately) an auto account prefix is allowed to have an underscore, and worse, could be \".shards_\", so without knowing the auto account prefix it\u0027s hard to tell if \".shards_shards_foo\" is a child of root \"shards_foo\" or root \"foo\"","commit_id":"ed56eb5661fde1ac88456162cb1748f5471c8e04"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4486d829678c85899002d44f7853de274f114fad","unresolved":true,"context_lines":[{"line_number":5351,"context_line":"                return False"},{"line_number":5352,"context_line":"            root_container \u003d parent.container"},{"line_number":5353,"context_line":"        else:"},{"line_number":5354,"context_line":"            if parsed_name.account !\u003d parsed_parent_name.account:"},{"line_number":5355,"context_line":"                return False"},{"line_number":5356,"context_line":"            root_container \u003d parsed_parent_name.root_container"},{"line_number":5357,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"0761ac01_c92a9c47","line":5354,"updated":"2022-08-31 14:49:07.000000000","message":"it seems like this is basically the same condition as above - except it doesn\u0027t tolerate a difference in the shard range prefix e.g.\n\n\tdiff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py\n\tindex 0bb5f9764..bcef6a391 100644\n\t--- a/test/unit/common/test_utils.py\n\t+++ b/test/unit/common/test_utils.py\n\t@@ -8954,6 +8954,9 @@ class TestShardRange(unittest.TestCase):\n\t\t     \u0027.other_a1\u0027, \u0027r1\u0027, a1_r1.container, ts, 2), ts)\n\t\t other_a1_r1_gp1_p1 \u003d utils.ShardRange(utils.ShardRange.make_path(\n\t\t     \u0027.other_a1\u0027, \u0027r1\u0027, other_a1_r1_gp1.container, ts, 2), ts)\n\t+        shards_other_a1_r1_gp1_p1 \u003d utils.ShardRange(utils.ShardRange.make_path(\n\t+            \u0027.shards_a1\u0027, \u0027r1\u0027, other_a1_r1_gp1.container, ts, 2), ts)\n\t+        self.assertFalse(shards_other_a1_r1_gp1_p1.is_child_of(other_a1_r1_gp1))\n\t \n\t\t # account 1, root 2\n\t\t ts \u003d next(self.ts_iter)\n\n\n... but maybe it\u0027d be reasonable since other_a1_r1_gp1_p1.is_child_of(other_a1_r1_gp1) is true?","commit_id":"ed56eb5661fde1ac88456162cb1748f5471c8e04"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"374446a130dde86c5923d0359aa80de5c5116901","unresolved":true,"context_lines":[{"line_number":5152,"context_line":"    # container.sharder.ContainerSharder.__init__"},{"line_number":5153,"context_line":"    shards_account_prefix \u003d auto_create_account_prefix + \u0027shards_\u0027"},{"line_number":5154,"context_line":"    return (account.startswith(shards_account_prefix),"},{"line_number":5155,"context_line":"            account.removeprefix(shards_account_prefix))"},{"line_number":5156,"context_line":""},{"line_number":5157,"context_line":""},{"line_number":5158,"context_line":"class ShardName(object):"}],"source_content_type":"text/x-python","patch_set":2,"id":"4db3f998_2d618f82","line":5155,"range":{"start_line":5155,"start_character":20,"end_line":5155,"end_character":32},"updated":"2022-09-07 13:17:25.000000000","message":"\"New in version 3.9.\"","commit_id":"c8b35c48d94bcadfb956d26a84c55d9746aa351b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"374446a130dde86c5923d0359aa80de5c5116901","unresolved":true,"context_lines":[{"line_number":5172,"context_line":"    def __init__(self, auto_create_account_prefix, is_shard, account_name,"},{"line_number":5173,"context_line":"                 root_container, parent_container_hash, timestamp, index):"},{"line_number":5174,"context_line":"        self.shards_account_prefix \u003d (auto_create_account_prefix + \u0027shards_\u0027) \\"},{"line_number":5175,"context_line":"            if is_shard else \u0027\u0027"},{"line_number":5176,"context_line":"        self.account_name \u003d self._validate(account_name)"},{"line_number":5177,"context_line":"        self.root_container \u003d self._validate(root_container)"},{"line_number":5178,"context_line":"        self.parent_container_hash \u003d self._validate(parent_container_hash)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f0c9b41_89853fd3","line":5175,"range":{"start_line":5175,"start_character":12,"end_line":5175,"end_character":31},"updated":"2022-09-07 13:17:25.000000000","message":"ShardName is only used for shards (see note line 5169)","commit_id":"c8b35c48d94bcadfb956d26a84c55d9746aa351b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"374446a130dde86c5923d0359aa80de5c5116901","unresolved":true,"context_lines":[{"line_number":5418,"context_line":"                                    root_container,"},{"line_number":5419,"context_line":"                                    parent_container,"},{"line_number":5420,"context_line":"                                    timestamp,"},{"line_number":5421,"context_line":"                                    index, **kwargs)"},{"line_number":5422,"context_line":""},{"line_number":5423,"context_line":"    @classmethod"},{"line_number":5424,"context_line":"    def _to_timestamp(cls, timestamp):"}],"source_content_type":"text/x-python","patch_set":2,"id":"f0d96463_cc4b0d13","line":5421,"updated":"2022-09-07 13:17:25.000000000","message":"missing )","commit_id":"c8b35c48d94bcadfb956d26a84c55d9746aa351b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9b3b8fbf082e3ab1760b25e5e55463c175002a8e","unresolved":true,"context_lines":[{"line_number":5367,"context_line":"        \"\"\""},{"line_number":5368,"context_line":""},{"line_number":5369,"context_line":"        try:"},{"line_number":5370,"context_line":"            parsed_name \u003d ShardName.parse(self.name, **kwargs)"},{"line_number":5371,"context_line":"        except ValueError:"},{"line_number":5372,"context_line":"            # self is not a shard and therefore not a child"},{"line_number":5373,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"9133b1b7_c0fa0f87","line":5370,"updated":"2022-09-07 14:00:33.000000000","message":"with non-standard auto account prefix, IIUC parsed_name has the wrong account *unless there is auto_create_account_prefix kwarg passed in*. The actual auto account prefix gets left as part of the account name.","commit_id":"1787bb2b35e81bda28eb5f0fb2b687feddd90013"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"9b3b8fbf082e3ab1760b25e5e55463c175002a8e","unresolved":true,"context_lines":[{"line_number":5375,"context_line":"        try:"},{"line_number":5376,"context_line":"            parsed_parent_name \u003d ShardName.parse(parent.name, **kwargs)"},{"line_number":5377,"context_line":"        except ValueError:"},{"line_number":5378,"context_line":"            if not parsed_name.account_name.endswith(parent.account):"},{"line_number":5379,"context_line":"                return False"},{"line_number":5380,"context_line":"            root_container \u003d parent.container"},{"line_number":5381,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"0e37ca15_0af38331","line":5378,"range":{"start_line":5378,"start_character":19,"end_line":5378,"end_character":51},"updated":"2022-09-07 14:00:33.000000000","message":"this is not reliable\n\nwe get here is the parent is a root, it\u0027s account is \"bert\" but the parsed shard name account is \"robert\", so we do NOT return False, and from then on  the difference in accounts is ignored.","commit_id":"1787bb2b35e81bda28eb5f0fb2b687feddd90013"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"82552e7c07f48f753ddffd9e298634fc6618f6b1","unresolved":true,"context_lines":[{"line_number":7982,"context_line":"        self.assertEqual(\u00277c92cf1eee8d99cc85f8355a3d6e4b86\u0027,"},{"line_number":7983,"context_line":"                         parsed.parent_container_hash)"},{"line_number":7984,"context_line":"        self.assertEqual(utils.Timestamp(1662475499), parsed.timestamp)"},{"line_number":7985,"context_line":"        self.assertEqual(1, parsed.index)"},{"line_number":7986,"context_line":""},{"line_number":7987,"context_line":"    def test_bad_parse(self):"},{"line_number":7988,"context_line":"        with self.assertRaises(ValueError) as cm:"}],"source_content_type":"text/x-python","patch_set":3,"id":"e365699f_16f4c1dc","line":7985,"updated":"2022-09-08 18:41:17.000000000","message":"something like this might still be useful in the parent","commit_id":"1787bb2b35e81bda28eb5f0fb2b687feddd90013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"82552e7c07f48f753ddffd9e298634fc6618f6b1","unresolved":true,"context_lines":[{"line_number":7989,"context_line":"            utils.ShardName.parse(\u0027a\u0027)"},{"line_number":7990,"context_line":"        self.assertEqual(\u0027invalid name: a\u0027, str(cm.exception))"},{"line_number":7991,"context_line":"        with self.assertRaises(ValueError) as cm:"},{"line_number":7992,"context_line":"            utils.ShardName.parse(\u0027a/c\u0027)"},{"line_number":7993,"context_line":"        self.assertEqual(\u0027invalid name: a/c\u0027, str(cm.exception))"},{"line_number":7994,"context_line":"        with self.assertRaises(ValueError) as cm:"},{"line_number":7995,"context_line":"            utils.ShardName.parse(\u0027a/root-hash-bad\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"f19bed75_7d48cafe","line":7992,"updated":"2022-09-08 18:41:17.000000000","message":"oic, so when we\u0027re in is_child and one of the ShardRange params is a root we expect ShardName.parse to fail.","commit_id":"1787bb2b35e81bda28eb5f0fb2b687feddd90013"}]}
