)]}'
{"subunit2sql/db/api.py":[{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"0e9d921c9317099fa228e42d7c841bd3261c199b","unresolved":false,"context_lines":[{"line_number":1821,"context_line":"                    will be acquired for the duration of this operation"},{"line_number":1822,"context_line":"    :param bool include_run_id: boolean flag to enable including the run uuid"},{"line_number":1823,"context_line":"                    in the test run dicts returned"},{"line_number":1824,"context_line":""},{"line_number":1825,"context_line":"    :return test_runs: A list of dicts for the test_runs and associated data"},{"line_number":1826,"context_line":"    :rtype: list"},{"line_number":1827,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_be2566ad","line":1824,"updated":"2018-03-12 22:16:25.000000000","message":"We should add include_attachments here so we document the new parameter.","commit_id":"022c4c2d7ea6feae3e0da7263c5aea1c9cde2a8c"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"ee711d891e63d38f5aa34155ef6e81da48715a7c","unresolved":false,"context_lines":[{"line_number":1821,"context_line":"                    will be acquired for the duration of this operation"},{"line_number":1822,"context_line":"    :param bool include_run_id: boolean flag to enable including the run uuid"},{"line_number":1823,"context_line":"                    in the test run dicts returned"},{"line_number":1824,"context_line":""},{"line_number":1825,"context_line":"    :return test_runs: A list of dicts for the test_runs and associated data"},{"line_number":1826,"context_line":"    :rtype: list"},{"line_number":1827,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_6b4e0970","line":1824,"in_reply_to":"df7087c5_be2566ad","updated":"2018-03-13 22:25:58.000000000","message":"Done","commit_id":"022c4c2d7ea6feae3e0da7263c5aea1c9cde2a8c"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"0e9d921c9317099fa228e42d7c841bd3261c199b","unresolved":false,"context_lines":[{"line_number":1841,"context_line":"        query \u003d query.join("},{"line_number":1842,"context_line":"            models.Attachments,"},{"line_number":1843,"context_line":"            models.TestRun.id \u003d\u003d models.Attachments.test_run_id)"},{"line_number":1844,"context_line":"        query_values.append(models.Attachments.attachment)"},{"line_number":1845,"context_line":""},{"line_number":1846,"context_line":"    if key:"},{"line_number":1847,"context_line":"        query \u003d query.join("}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_be2b262e","line":1844,"updated":"2018-03-12 22:16:25.000000000","message":"What happens if there is \u003e 1 attachment for a test_run? This is a pretty common thing if attachments are used. (like stdout, stderr, logging, etc) I think maybe we should grab the label too and try to put it together. Or like the key parameter take in a label for the attachments table and only grab that attachment.","commit_id":"022c4c2d7ea6feae3e0da7263c5aea1c9cde2a8c"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"ee711d891e63d38f5aa34155ef6e81da48715a7c","unresolved":false,"context_lines":[{"line_number":1841,"context_line":"        query \u003d query.join("},{"line_number":1842,"context_line":"            models.Attachments,"},{"line_number":1843,"context_line":"            models.TestRun.id \u003d\u003d models.Attachments.test_run_id)"},{"line_number":1844,"context_line":"        query_values.append(models.Attachments.attachment)"},{"line_number":1845,"context_line":""},{"line_number":1846,"context_line":"    if key:"},{"line_number":1847,"context_line":"        query \u003d query.join("}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_8b059d13","line":1844,"in_reply_to":"df7087c5_be2b262e","updated":"2018-03-13 22:25:58.000000000","message":"In this case, the join created duplicate rows, where test_run_ids were duplicated for each attachment. At first I tried to understand how to do a group_by on the test_run_id  but instead I made a separate query and did the grouping with python.","commit_id":"022c4c2d7ea6feae3e0da7263c5aea1c9cde2a8c"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"23fe6ca44df8d1cdad3308bd48ca6270e24f92a9","unresolved":false,"context_lines":[{"line_number":1871,"context_line":"            \u0027stop_time\u0027: result.stop_time,"},{"line_number":1872,"context_line":"        }"},{"line_number":1873,"context_line":"        if include_attachments:"},{"line_number":1874,"context_line":"            test_run[\u0027attachments\u0027] \u003d attachments[result.test_id]"},{"line_number":1875,"context_line":"        if include_run_id:"},{"line_number":1876,"context_line":"            test_run[\u0027uuid\u0027] \u003d result.uuid"},{"line_number":1877,"context_line":"        if result.start_time_microsecond is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_2ea9c622","line":1874,"range":{"start_line":1874,"start_character":50,"end_line":1874,"end_character":64},"updated":"2018-04-13 18:29:18.000000000","message":"there\u0027s an issue with the uniqueness of this id. there are multiple test ids with the name \u0027devstack\u0027 for example.. switching to models.TestRun.id","commit_id":"932b7c1fb39e06291065e6e4f0c5d0bc2b896313"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"8025e75fca7aa49373e0fc18458828b7c3b9136c","unresolved":false,"context_lines":[{"line_number":1871,"context_line":"            \u0027stop_time\u0027: result.stop_time,"},{"line_number":1872,"context_line":"        }"},{"line_number":1873,"context_line":"        if include_attachments:"},{"line_number":1874,"context_line":"            test_run[\u0027attachments\u0027] \u003d attachments[result.test_id]"},{"line_number":1875,"context_line":"        if include_run_id:"},{"line_number":1876,"context_line":"            test_run[\u0027uuid\u0027] \u003d result.uuid"},{"line_number":1877,"context_line":"        if result.start_time_microsecond is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_0cb16b44","line":1874,"range":{"start_line":1874,"start_character":50,"end_line":1874,"end_character":64},"in_reply_to":"bf659307_2ea9c622","updated":"2018-04-13 18:32:34.000000000","message":"Run.uuid I think will work too, will try that before uploading.","commit_id":"932b7c1fb39e06291065e6e4f0c5d0bc2b896313"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"1caff42353fa6c4eb291020dd9148521315401f7","unresolved":false,"context_lines":[{"line_number":1891,"context_line":"        attachment_q_vals \u003d query_values[:]"},{"line_number":1892,"context_line":"        attachment_q_vals.extend([models.Attachments.label,"},{"line_number":1893,"context_line":"                                  models.Attachments.attachment])"},{"line_number":1894,"context_line":"        results \u003d attachment_q.values(*attachment_q_vals)"},{"line_number":1895,"context_line":"        for result in results:"},{"line_number":1896,"context_line":"            attachment_dict \u003d {\u0027label\u0027: result.label,"},{"line_number":1897,"context_line":"                               \u0027attachment\u0027: result.attachment}"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f769fc5_41562109","line":1894,"updated":"2018-12-24 20:41:44.000000000","message":"I\u0027m curious doesn\u0027t this make us end up doing 2 queries? Did you do any performance testing with 1 vs 2 here? My gut is telling me the double join query without the attachments is going to be kinda slow by itself. So I\u0027m wondering if we should try to optimize this to return it all in one go instead of splitting off the attachments as a separate overlapping query.","commit_id":"948b641d6b8d5ed09111ce4c87119eeb3489c074"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"0f146b7ff520b5a5438b358bb8f1a505a4ae465a","unresolved":false,"context_lines":[{"line_number":1891,"context_line":"        attachment_q_vals \u003d query_values[:]"},{"line_number":1892,"context_line":"        attachment_q_vals.extend([models.Attachments.label,"},{"line_number":1893,"context_line":"                                  models.Attachments.attachment])"},{"line_number":1894,"context_line":"        results \u003d attachment_q.values(*attachment_q_vals)"},{"line_number":1895,"context_line":"        for result in results:"},{"line_number":1896,"context_line":"            attachment_dict \u003d {\u0027label\u0027: result.label,"},{"line_number":1897,"context_line":"                               \u0027attachment\u0027: result.attachment}"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f769fc5_8b944146","line":1894,"in_reply_to":"1f769fc5_41562109","updated":"2018-12-27 15:12:51.000000000","message":"Done","commit_id":"948b641d6b8d5ed09111ce4c87119eeb3489c074"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"00ac7c9be3fee017e1308e72eb89975b26e41a54","unresolved":false,"context_lines":[{"line_number":1891,"context_line":"        attachment_q_vals \u003d query_values[:]"},{"line_number":1892,"context_line":"        attachment_q_vals.extend([models.Attachments.label,"},{"line_number":1893,"context_line":"                                  models.Attachments.attachment])"},{"line_number":1894,"context_line":"        results \u003d attachment_q.values(*attachment_q_vals)"},{"line_number":1895,"context_line":"        for result in results:"},{"line_number":1896,"context_line":"            attachment_dict \u003d {\u0027label\u0027: result.label,"},{"line_number":1897,"context_line":"                               \u0027attachment\u0027: result.attachment}"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f769fc5_9d4a4c7e","line":1894,"in_reply_to":"1f769fc5_41562109","updated":"2018-12-26 18:26:08.000000000","message":"Yeah it does. Let me give this another shot.","commit_id":"948b641d6b8d5ed09111ce4c87119eeb3489c074"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"00ac7c9be3fee017e1308e72eb89975b26e41a54","unresolved":false,"context_lines":[{"line_number":1898,"context_line":"            if result.uuid not in attachments:"},{"line_number":1899,"context_line":"                attachments[result.uuid] \u003d [attachment_dict]"},{"line_number":1900,"context_line":"            else:"},{"line_number":1901,"context_line":"                attachments[result.uuid].append(attachment_dict)"},{"line_number":1902,"context_line":"    if key:"},{"line_number":1903,"context_line":"        query \u003d query.join("},{"line_number":1904,"context_line":"            models.RunMetadata,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f769fc5_dd50c435","line":1901,"range":{"start_line":1901,"start_character":35,"end_line":1901,"end_character":39},"updated":"2018-12-26 18:26:08.000000000","message":"This attachment is not test run specific. I\u0027m appending every attachment at the run level. I should make this key a combination of the result\u0027s uuid and a test_id so that attachments are tied to the specific test that failed in the run.","commit_id":"948b641d6b8d5ed09111ce4c87119eeb3489c074"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"b528928dd208a98396a53637d31983ba58207066","unresolved":false,"context_lines":[{"line_number":1914,"context_line":"            \u0027start_time\u0027: result.start_time,"},{"line_number":1915,"context_line":"            \u0027stop_time\u0027: result.stop_time,"},{"line_number":1916,"context_line":"        }"},{"line_number":1917,"context_line":"        if include_attachments and result.uuid in attachments:"},{"line_number":1918,"context_line":"            test_run[\u0027attachments\u0027] \u003d attachments[result.uuid]"},{"line_number":1919,"context_line":"        if include_run_id:"},{"line_number":1920,"context_line":"            test_run[\u0027uuid\u0027] \u003d result.uuid"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f6a8fd7_a095e988","line":1917,"range":{"start_line":1917,"start_character":11,"end_line":1917,"end_character":34},"updated":"2018-04-24 21:31:45.000000000","message":"this can be removed but I left it to be explicit.","commit_id":"948b641d6b8d5ed09111ce4c87119eeb3489c074"}],"subunit2sql/read_subunit.py":[{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"71edc21c98e24eeab0354e7e19b33dc0c515f0f4","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        attach_dict \u003d {}"},{"line_number":74,"context_line":"        for name, detail in test[\u0027details\u0027].items():"},{"line_number":75,"context_line":"            name \u003d name.split(\u0027:\u0027)[0]"},{"line_number":76,"context_line":"            attach_dict[name] \u003d detail.as_text()"},{"line_number":77,"context_line":"        return attach_dict"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def parse_outcome(self, test):"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_2d20eaf6","line":76,"range":{"start_line":76,"start_character":39,"end_line":76,"end_character":48},"updated":"2018-03-15 18:21:07.000000000","message":"just realized.. this may not be backwards compatible. :/\n\nThe problem is when the blob is rendered, we would have to load the testtools Content object back into memory. It loses the object information so we would have to parse the data ourselves. This would require a reference implemntation and open up an opportunity for users to provide a custom parser on the openstack-health side if we want.","commit_id":"932b7c1fb39e06291065e6e4f0c5d0bc2b896313"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"85d17ed9b05daf74bbb5497fa94a2bc7f8cf216a","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        attach_dict \u003d {}"},{"line_number":74,"context_line":"        for name, detail in test[\u0027details\u0027].items():"},{"line_number":75,"context_line":"            name \u003d name.split(\u0027:\u0027)[0]"},{"line_number":76,"context_line":"            attach_dict[name] \u003d detail.as_text()"},{"line_number":77,"context_line":"        return attach_dict"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def parse_outcome(self, test):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_5e5985fa","line":76,"range":{"start_line":76,"start_character":39,"end_line":76,"end_character":48},"in_reply_to":"9f6a8fd7_207c7981","updated":"2018-06-22 13:43:17.000000000","message":"I think we need to work on this because now i\u0027m facing this error. I\u0027ll make a bug report.\n\noslo_db.exception.DBError: (exceptions.TypeError) \u0027Content\u0027 object is not iterable [SQL: u\u0027INSERT INTO attachments (test_run_id, label, attachment) VALUES (%(test_run_id)s, %(label)s, %(attachment)s)\u0027] [parameters: [{\u0027test_run_id\u0027: 1, \u0027attachment\u0027: \u003cContent type\u003dtext/plain; charset\u003d\"utf8\", value\u003d\u00272018-06-19 14:44:47,039 406 INFO     [tempest.lib.common.rest_client] Request (VolumesGetTest:test_vo ... (55096 characters truncated) ... request-id\\\u0027: \\\u0027req-3363a72f-7960-4fec-affc-52d273af7755\\\u0027}\\n        Body: {\"itemNotFound\": {\"message\": \"Volume could not be found\", \"code\": 404}}\\n\u0027\u003e, \u0027label\u0027: u\u0027pythonlogging\u0027}]]\n\nI applied the as_text() method and it gave another error\noslo_db.exception.DBError: (exceptions.TypeError) unicode argument without an encoding [SQL: u\u0027INSERT INTO attachments (test_run_id, label, attachment) VALUES (%(test_run_id)s, %(label)s, %(attachment)s)\u0027] [parameters: [{\u0027test_run_id\u0027: 1, \u0027attachment\u0027: u\u00272018-06-19 14:44:47,039 406 INFO     [tempest.lib.common.rest_client] Request (VolumesGetTest:test_volume_create_get_update_delete_from_image): 200  ... (55048 characters truncated) ... -request-id\\\u0027: \\\u0027req-3363a72f-7960-4fec-affc-52d273af7755\\\u0027}\\n        Body: {\"itemNotFound\": {\"message\": \"Volume could not be found\", \"code\": 404}}\\n\u0027, \u0027label\u0027: u\u0027pythonlogging\u0027}]]\n\nso I added the following and now it works for python2\ndetail.as_text().encode(\u0027UTF-8\u0027)","commit_id":"932b7c1fb39e06291065e6e4f0c5d0bc2b896313"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"dcd64e8b70b3fa3ab6a34992ff32e72a99144c42","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        attach_dict \u003d {}"},{"line_number":74,"context_line":"        for name, detail in test[\u0027details\u0027].items():"},{"line_number":75,"context_line":"            name \u003d name.split(\u0027:\u0027)[0]"},{"line_number":76,"context_line":"            attach_dict[name] \u003d detail.as_text()"},{"line_number":77,"context_line":"        return attach_dict"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def parse_outcome(self, test):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f6a8fd7_207c7981","line":76,"range":{"start_line":76,"start_character":39,"end_line":76,"end_character":48},"in_reply_to":"bf659307_213effd9","updated":"2018-04-24 21:30:16.000000000","message":"Removed.","commit_id":"932b7c1fb39e06291065e6e4f0c5d0bc2b896313"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"e8dd6240a837397c8a7ed1ce23181c9b59bba48b","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        attach_dict \u003d {}"},{"line_number":74,"context_line":"        for name, detail in test[\u0027details\u0027].items():"},{"line_number":75,"context_line":"            name \u003d name.split(\u0027:\u0027)[0]"},{"line_number":76,"context_line":"            attach_dict[name] \u003d detail.as_text()"},{"line_number":77,"context_line":"        return attach_dict"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def parse_outcome(self, test):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_6ff4475c","line":76,"range":{"start_line":76,"start_character":39,"end_line":76,"end_character":48},"in_reply_to":"df7087c5_2d20eaf6","updated":"2018-04-06 17:06:56.000000000","message":"- i guess we should bring this up in QA office hours?","commit_id":"932b7c1fb39e06291065e6e4f0c5d0bc2b896313"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"0d56c853e30f160a4f737bf32f722e5da5c94e4b","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        attach_dict \u003d {}"},{"line_number":74,"context_line":"        for name, detail in test[\u0027details\u0027].items():"},{"line_number":75,"context_line":"            name \u003d name.split(\u0027:\u0027)[0]"},{"line_number":76,"context_line":"            attach_dict[name] \u003d detail.as_text()"},{"line_number":77,"context_line":"        return attach_dict"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def parse_outcome(self, test):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_213effd9","line":76,"range":{"start_line":76,"start_character":39,"end_line":76,"end_character":48},"in_reply_to":"df7087c5_2d20eaf6","updated":"2018-04-06 17:29:22.000000000","message":"Yeah, we cant\u0027t really do this here. I don\u0027t know of anyone using this api, but there are likely users out there I don\u0027t know about.","commit_id":"932b7c1fb39e06291065e6e4f0c5d0bc2b896313"}],"subunit2sql/tests/db/test_api.py":[{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"0e9d921c9317099fa228e42d7c841bd3261c199b","unresolved":false,"context_lines":[{"line_number":736,"context_line":"            \u0027stop_time\u0027: stop_timestamp,"},{"line_number":737,"context_line":"        }, result[0])"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def test_get_test_runs_by_status_for_run_ids_with_attachments(self):"},{"line_number":740,"context_line":"        attach_dict \u003d {\u0027attach_label\u0027: b\u0027attach\u0027}"},{"line_number":741,"context_line":"        run_b \u003d api.create_run(artifacts\u003d\u0027fake_url\u0027)"},{"line_number":742,"context_line":"        run_a \u003d api.create_run()"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_9eb662fa","line":739,"updated":"2018-03-12 22:16:25.000000000","message":"Could we also have a test with more than one attachment and also with more than 1 test run and more than one attachment. I\u0027m curious about how this new feature is going to behave with more than 1 of everything.","commit_id":"022c4c2d7ea6feae3e0da7263c5aea1c9cde2a8c"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"ee711d891e63d38f5aa34155ef6e81da48715a7c","unresolved":false,"context_lines":[{"line_number":736,"context_line":"            \u0027stop_time\u0027: stop_timestamp,"},{"line_number":737,"context_line":"        }, result[0])"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def test_get_test_runs_by_status_for_run_ids_with_attachments(self):"},{"line_number":740,"context_line":"        attach_dict \u003d {\u0027attach_label\u0027: b\u0027attach\u0027}"},{"line_number":741,"context_line":"        run_b \u003d api.create_run(artifacts\u003d\u0027fake_url\u0027)"},{"line_number":742,"context_line":"        run_a \u003d api.create_run()"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_eeaf87e0","line":739,"in_reply_to":"df7087c5_9eb662fa","updated":"2018-03-13 22:25:58.000000000","message":"I modified this test case to use more than attachment. I added another one with more than one failing test_run.","commit_id":"022c4c2d7ea6feae3e0da7263c5aea1c9cde2a8c"}]}
