)]}'
{"glance/async_/flows/_internal_plugins/web_download.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a920e85adf417676f7fd8b85bcb0f13b147bfb8f","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                          {\"error\": encodeutils.exception_to_unicode(e),"},{"line_number":119,"context_line":"                           \"task_id\": self.task_id})"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        self._path, bytes_written \u003d self.store.add(self.image_id, data, 0)[0:2]"},{"line_number":122,"context_line":"        try:"},{"line_number":123,"context_line":"            content_length \u003d int(data.headers[\u0027content-length\u0027])"},{"line_number":124,"context_line":"            if bytes_written !\u003d content_length:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_450f5fdf","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":18},"updated":"2020-09-22 14:58:15.000000000","message":"This is not tested.","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"59df18cbb1413c9a81b2f770ab35835880f6574f","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                          {\"error\": encodeutils.exception_to_unicode(e),"},{"line_number":119,"context_line":"                           \"task_id\": self.task_id})"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        self._path, bytes_written \u003d self.store.add(self.image_id, data, 0)[0:2]"},{"line_number":122,"context_line":"        try:"},{"line_number":123,"context_line":"            content_length \u003d int(data.headers[\u0027content-length\u0027])"},{"line_number":124,"context_line":"            if bytes_written !\u003d content_length:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_9849da33","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":18},"in_reply_to":"9f560f44_450f5fdf","updated":"2020-09-22 15:43:19.000000000","message":"added new test for this.","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a920e85adf417676f7fd8b85bcb0f13b147bfb8f","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        # NOTE(abhishekk): Deleting partial image data from staging area"},{"line_number":148,"context_line":"        if self._path is not None:"},{"line_number":149,"context_line":"            LOG.debug(_LE(\u0027Deleting image %(image_id)s from staging \u0027"},{"line_number":150,"context_line":"                          \u0027area.\u0027),"},{"line_number":151,"context_line":"                      {\u0027image_id\u0027: self.image_id})"},{"line_number":152,"context_line":"            if CONF.enabled_backends:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_a5c47b93","line":149,"range":{"start_line":149,"start_character":22,"end_line":149,"end_character":25},"updated":"2020-09-22 14:58:15.000000000","message":"remove?","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"aa464f53080b3f4bf052fabfbe227dc5bb9b9d4f","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        # NOTE(abhishekk): Deleting partial image data from staging area"},{"line_number":148,"context_line":"        if self._path is not None:"},{"line_number":149,"context_line":"            LOG.debug(_LE(\u0027Deleting image %(image_id)s from staging \u0027"},{"line_number":150,"context_line":"                          \u0027area.\u0027),"},{"line_number":151,"context_line":"                      {\u0027image_id\u0027: self.image_id})"},{"line_number":152,"context_line":"            if CONF.enabled_backends:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_e5c4b362","line":149,"range":{"start_line":149,"start_character":22,"end_line":149,"end_character":25},"in_reply_to":"9f560f44_a5c47b93","updated":"2020-09-22 15:02:14.000000000","message":"Yes please, bad enough we still have these translation markers around. Let\u0027s not use error markers for debugging.","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"59df18cbb1413c9a81b2f770ab35835880f6574f","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        # NOTE(abhishekk): Deleting partial image data from staging area"},{"line_number":148,"context_line":"        if self._path is not None:"},{"line_number":149,"context_line":"            LOG.debug(_LE(\u0027Deleting image %(image_id)s from staging \u0027"},{"line_number":150,"context_line":"                          \u0027area.\u0027),"},{"line_number":151,"context_line":"                      {\u0027image_id\u0027: self.image_id})"},{"line_number":152,"context_line":"            if CONF.enabled_backends:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_e57b13bc","line":149,"range":{"start_line":149,"start_character":22,"end_line":149,"end_character":25},"in_reply_to":"9f560f44_e5c4b362","updated":"2020-09-22 15:43:19.000000000","message":"Done","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"ce028089f0b8915df3d6ebba5054cb99e48d8250","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        if self._path is not None:"},{"line_number":149,"context_line":"            LOG.debug((\u0027Deleting image %(image_id)s from staging \u0027"},{"line_number":150,"context_line":"                       \u0027area.\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":151,"context_line":"            if CONF.enabled_backends:"},{"line_number":152,"context_line":"                store_api.delete(self._path, None)"},{"line_number":153,"context_line":"            else:"},{"line_number":154,"context_line":"                store_api.delete_from_backend(self._path)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"def get_flow(**kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_f663c7af","line":154,"range":{"start_line":151,"start_character":0,"end_line":154,"end_character":57},"updated":"2020-09-22 17:24:41.000000000","message":"We should wrap this with\ntry:\n...\nexcept Exception:\n    LOG.exception(\"Error reverting web-download taks: %s\", self.taskID)\n\nThis way we can carry on with the rest of the revert flow (Nothing else really we can do.), the LOG.exception will log a stack trace with it for the admin and we can carry on after any i/o error, NotFound etc.","commit_id":"d4cf3863bd2f326f62d36cdc70d8fa2f9953b758"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bf3b3e66a9f8767d3727b02887033db474dcc551","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                    store_api.delete_from_backend(self._path)"},{"line_number":156,"context_line":"            except Exception:"},{"line_number":157,"context_line":"                LOG.exception(_LE(\"Error reverting web-download \""},{"line_number":158,"context_line":"                                  \"taks: %(task_id)s\"), {"},{"line_number":159,"context_line":"                    \u0027task_id\u0027: self.task_id})"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_f67c67ec","line":158,"range":{"start_line":158,"start_character":35,"end_line":158,"end_character":39},"updated":"2020-09-22 17:48:28.000000000","message":"We should do what Erno says here, but...with proper spelling :)","commit_id":"cb18bba2e3be005b01dbe08aaa6b447d189fe43f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"f47d12ad5da5f387f3a34241fd643db3b90b9319","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                    store_api.delete_from_backend(self._path)"},{"line_number":156,"context_line":"            except Exception:"},{"line_number":157,"context_line":"                LOG.exception(_LE(\"Error reverting web-download \""},{"line_number":158,"context_line":"                                  \"taks: %(task_id)s\"), {"},{"line_number":159,"context_line":"                    \u0027task_id\u0027: self.task_id})"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f560f44_76517762","line":158,"range":{"start_line":158,"start_character":35,"end_line":158,"end_character":39},"in_reply_to":"9f560f44_f67c67ec","updated":"2020-09-22 17:53:11.000000000","message":"fixing it from mobile, will rebase Reno patch tomorrow my time.","commit_id":"cb18bba2e3be005b01dbe08aaa6b447d189fe43f"}],"glance/tests/unit/async_/flows/test_web_download.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a920e85adf417676f7fd8b85bcb0f13b147bfb8f","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        web_download_task \u003d web_download._WebDownload("},{"line_number":183,"context_line":"            self.task.task_id, self.task_type, self.task_repo,"},{"line_number":184,"context_line":"            self.image_id, self.uri)"},{"line_number":185,"context_line":"        web_download_task._path \u003d \"/path/to_downloaded_data\""},{"line_number":186,"context_line":"        web_download_task.revert(\"/path/to_downloaded_data\")"},{"line_number":187,"context_line":"        mock_store_api.delete_from_backend.assert_called_once_with("},{"line_number":188,"context_line":"            \"/path/to_downloaded_data\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_455abff1","line":185,"updated":"2020-09-22 14:58:15.000000000","message":"This works, but it would be better to mock out store.add() to return a smaller size to make sure that you\u0027re actually setting _path in the execute() method.","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"59df18cbb1413c9a81b2f770ab35835880f6574f","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        web_download_task \u003d web_download._WebDownload("},{"line_number":183,"context_line":"            self.task.task_id, self.task_type, self.task_repo,"},{"line_number":184,"context_line":"            self.image_id, self.uri)"},{"line_number":185,"context_line":"        web_download_task._path \u003d \"/path/to_downloaded_data\""},{"line_number":186,"context_line":"        web_download_task.revert(\"/path/to_downloaded_data\")"},{"line_number":187,"context_line":"        mock_store_api.delete_from_backend.assert_called_once_with("},{"line_number":188,"context_line":"            \"/path/to_downloaded_data\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_3841ae0b","line":185,"in_reply_to":"9f560f44_455abff1","updated":"2020-09-22 15:43:19.000000000","message":"1. To mock the store.add I need to call execute method\n2. Then I need to call revert method and calling execute and revert method from same test explicitly doesn\u0027t looks good (as IMO it will never happen real scenario unless failure is raised from execute and revert is called by that failure)","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1440332813240c2e6d376824d79e27b683090d58","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            self.task.task_id, self.task_type, self.task_repo,"},{"line_number":184,"context_line":"            self.image_id, self.uri)"},{"line_number":185,"context_line":"        web_download_task._path \u003d \"/path/to_downloaded_data\""},{"line_number":186,"context_line":"        web_download_task.revert(\"/path/to_downloaded_data\")"},{"line_number":187,"context_line":"        mock_store_api.delete_from_backend.assert_called_once_with("},{"line_number":188,"context_line":"            \"/path/to_downloaded_data\")"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_f8bbb6c0","line":186,"range":{"start_line":186,"start_character":33,"end_line":186,"end_character":59},"updated":"2020-09-22 15:54:30.000000000","message":"Also, this is legacy right? It\u0027s not used.","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":30054,"name":"Grégoire Unbekandt","email":"gregoire.unbekandt@gmail.com","username":"yebinama"},"change_message_id":"d87a18e6ff1a7ce5d0a286d0e5949e71e4bc3481","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            self.task.task_id, self.task_type, self.task_repo,"},{"line_number":184,"context_line":"            self.image_id, self.uri)"},{"line_number":185,"context_line":"        web_download_task._path \u003d \"/path/to_downloaded_data\""},{"line_number":186,"context_line":"        web_download_task.revert(\"/path/to_downloaded_data\")"},{"line_number":187,"context_line":"        mock_store_api.delete_from_backend.assert_called_once_with("},{"line_number":188,"context_line":"            \"/path/to_downloaded_data\")"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_f650e70c","line":186,"range":{"start_line":186,"start_character":33,"end_line":186,"end_character":59},"in_reply_to":"9f560f44_1b4b0487","updated":"2020-09-22 17:10:14.000000000","message":"Yes only in that case. I agree with you for the test case.","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4dfff09df142972835d76391248ec911a5cea81f","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            self.task.task_id, self.task_type, self.task_repo,"},{"line_number":184,"context_line":"            self.image_id, self.uri)"},{"line_number":185,"context_line":"        web_download_task._path \u003d \"/path/to_downloaded_data\""},{"line_number":186,"context_line":"        web_download_task.revert(\"/path/to_downloaded_data\")"},{"line_number":187,"context_line":"        mock_store_api.delete_from_backend.assert_called_once_with("},{"line_number":188,"context_line":"            \"/path/to_downloaded_data\")"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_1b4b0487","line":186,"range":{"start_line":186,"start_character":33,"end_line":186,"end_character":59},"in_reply_to":"9f560f44_5b30dc55","updated":"2020-09-22 17:02:14.000000000","message":"Only in the case where our execute succeeded but another step after this one failed, right?\n\nAnyway, fair enough to leave it, but we should be checking that the task internally uses the path returned from the store add, IMHO.","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"},{"author":{"_account_id":30054,"name":"Grégoire Unbekandt","email":"gregoire.unbekandt@gmail.com","username":"yebinama"},"change_message_id":"233c8c021bb7a394bd211a9e88224f2646e087a5","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            self.task.task_id, self.task_type, self.task_repo,"},{"line_number":184,"context_line":"            self.image_id, self.uri)"},{"line_number":185,"context_line":"        web_download_task._path \u003d \"/path/to_downloaded_data\""},{"line_number":186,"context_line":"        web_download_task.revert(\"/path/to_downloaded_data\")"},{"line_number":187,"context_line":"        mock_store_api.delete_from_backend.assert_called_once_with("},{"line_number":188,"context_line":"            \"/path/to_downloaded_data\")"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_5b30dc55","line":186,"range":{"start_line":186,"start_character":33,"end_line":186,"end_character":59},"in_reply_to":"9f560f44_f8bbb6c0","updated":"2020-09-22 16:52:13.000000000","message":"It\u0027s not used anymore but this is still the way the revert would be called in case of failure. I think it should stay like this for more consistency","commit_id":"94dd3956949a97db3cbecfe97ce69b745aae30af"}]}
