)]}'
{"smaug/services/protection/graph.py":[{"author":{"_account_id":19346,"name":"yinwei","email":"yinweiishere@icloud.com","username":"yinwei"},"change_message_id":"a5a00fff4f600835b38ff507c0793af44725de6b","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                graph_nodes_dict[child_sid] \u003d GraphNode("},{"line_number":188,"context_line":"                    nodes_dict[child_sid], ())"},{"line_number":189,"context_line":"            children.append(graph_nodes_dict[child_sid])"},{"line_number":190,"context_line":"            del(nodes_dict[child_sid])"},{"line_number":191,"context_line":"        graph_nodes_dict[parent_sid] \u003d GraphNode(nodes_dict[parent_sid],"},{"line_number":192,"context_line":"                                                 tuple(children))"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_1e582cfa","line":190,"updated":"2016-04-12 03:17:19.000000000","message":"It looks like a bug to me:\nsay, node1 has children (node2, node3), node2 has child node4.\n1. node2 and node3 built, insert them into graph_nodes_dict, delete them from nodes_dict; node1 built and put it into graph_nodes_dict.  so far so good.\n2. when it comes to node2\u0027s turn, we will build node4, delete node4 from nodes_dict.  We build node2 again, and tries to get node2\u0027s value from nodes_dict. oh, node2 has been deleted from nodes_dict already...\n\nJust add a check from grap_nodes_dict, only build them when they doesn\u0027t exist. fill in children field only if they have existed already.","commit_id":"2e349c464100f247f4e27d40984e15633e5a4684"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"e4fba98cfdf1f8e823c0881ce944bcd3f98fb9d9","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                graph_nodes_dict[child_sid] \u003d GraphNode("},{"line_number":188,"context_line":"                    nodes_dict[child_sid], ())"},{"line_number":189,"context_line":"            children.append(graph_nodes_dict[child_sid])"},{"line_number":190,"context_line":"            del(nodes_dict[child_sid])"},{"line_number":191,"context_line":"        graph_nodes_dict[parent_sid] \u003d GraphNode(nodes_dict[parent_sid],"},{"line_number":192,"context_line":"                                                 tuple(children))"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_b464b949","line":190,"in_reply_to":"5a18252c_1e582cfa","updated":"2016-04-12 05:40:38.000000000","message":"The adjacency list is ordered - every parent appears its children. When we unpack the graph, it means that we build a parent after all of its children were built. This property is kept because \u0027pack_graph()\u0027 walks the tree using DFS, and appends to the adjacency list in every node.\nAn adjacency like you gave will break the unpacking, but such list shouldn\u0027t be passed to unpack_graph().\nI will add a comment/doctstring to unpack_graph() to emphasize this issue.","commit_id":"2e349c464100f247f4e27d40984e15633e5a4684"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"95c198d45cf25cee719758dd8b62751fc92627f5","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                graph_nodes_dict[child_sid] \u003d GraphNode("},{"line_number":188,"context_line":"                    nodes_dict[child_sid], ())"},{"line_number":189,"context_line":"            children.append(graph_nodes_dict[child_sid])"},{"line_number":190,"context_line":"            del(nodes_dict[child_sid])"},{"line_number":191,"context_line":"        graph_nodes_dict[parent_sid] \u003d GraphNode(nodes_dict[parent_sid],"},{"line_number":192,"context_line":"                                                 tuple(children))"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_f4d591b9","line":190,"in_reply_to":"5a18252c_b464b949","updated":"2016-04-12 05:41:55.000000000","message":"*every parent appears after its children","commit_id":"2e349c464100f247f4e27d40984e15633e5a4684"}],"smaug/tests/unit/protection/test_graph.py":[{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"6ed9358631be491a8813985b3db68c6bd43bf783","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            unserialized \u003d graph.unpack_graph(fmt.loads(serialized))"},{"line_number":117,"context_line":"            self.assertEqual(test_graph, unserialized)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def test_graph_deserialize_unordered_adjascency(self):"},{"line_number":120,"context_line":"        test_base \u003d {"},{"line_number":121,"context_line":"            \"A1\": [\"B1\", \"B2\"],"},{"line_number":122,"context_line":"            \"B1\": [\"C1\", \"C2\"],"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a18252c_e30583c2","line":119,"range":{"start_line":119,"start_character":8,"end_line":119,"end_character":51},"updated":"2016-04-13 13:11:25.000000000","message":"please fix spelling","commit_id":"2cdbc5601bc8c6cc7cc1c3664bec6326017e8bee"}]}
