)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":17,"context_line":"This patch also includes a workflow to download the latest log via a temporary"},{"line_number":18,"context_line":"url."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Implements: spec gui-logging"},{"line_number":21,"context_line":"Change-Id: I2affd39e85ccfdbaa18590de182104715cfbbed4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3f1d235d_d7472cbc","line":20,"range":{"start_line":20,"start_character":12,"end_line":20,"end_character":16},"updated":"2017-07-11 11:40:30.000000000","message":"This should be \"blueprint\" for the automatic linking to work. Though I can\u0027t find any blueprint named gui-logging, should this be websocket-logging?","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"This patch also includes a workflow to download the latest log via a temporary"},{"line_number":18,"context_line":"url."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Implements: spec gui-logging"},{"line_number":21,"context_line":"Change-Id: I2affd39e85ccfdbaa18590de182104715cfbbed4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1f1a1f67_c1e75512","line":20,"range":{"start_line":20,"start_character":12,"end_line":20,"end_character":16},"in_reply_to":"3f1d235d_d7472cbc","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"}],"setup.cfg":[{"author":{"_account_id":17888,"name":"Florian Fuchs","email":"f@florianfuchs.com","username":"flfuchs"},"change_message_id":"da092fd18eb4a39c22fa4c9bb93ddf9f52752d62","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    tripleo.plan.delete \u003d tripleo_common.actions.plan:DeletePlanAction"},{"line_number":95,"context_line":"    tripleo.plan.list \u003d tripleo_common.actions.plan:ListPlansAction"},{"line_number":96,"context_line":"    tripleo.plan.export \u003d tripleo_common.actions.plan:ExportPlanAction"},{"line_number":97,"context_line":"    tripleo.logging_to_swift.format_messages \u003d tripleo_common.actions.queue:FormatMessagesAction"},{"line_number":98,"context_line":"    tripleo.logging_to_swift.publish_ui_log_to_swift \u003d tripleo_common.actions.queue:PublishUILogToSwiftAction"},{"line_number":99,"context_line":"    tripleo.logging_to_swift.prepare_log_download \u003d tripleo_common.actions.queue:PrepareLogDownloadAction"},{"line_number":100,"context_line":"    tripleo.role.list \u003d tripleo_common.actions.plan:ListRolesAction"}],"source_content_type":"text/x-ttcn-cfg","patch_set":10,"id":"df3967d1_bbf26e05","line":97,"range":{"start_line":97,"start_character":70,"end_line":97,"end_character":75},"updated":"2017-07-31 15:53:53.000000000","message":"Shouldn\u0027t this be `logging_to_swift`? \n\nSame for the two following lines.","commit_id":"aecc038d0fe44e628fd884992b88809dde8d8548"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"8b8f1d66d15f8d21413f23e104a7ba6ddd216424","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    tripleo.plan.delete \u003d tripleo_common.actions.plan:DeletePlanAction"},{"line_number":95,"context_line":"    tripleo.plan.list \u003d tripleo_common.actions.plan:ListPlansAction"},{"line_number":96,"context_line":"    tripleo.plan.export \u003d tripleo_common.actions.plan:ExportPlanAction"},{"line_number":97,"context_line":"    tripleo.logging_to_swift.format_messages \u003d tripleo_common.actions.queue:FormatMessagesAction"},{"line_number":98,"context_line":"    tripleo.logging_to_swift.publish_ui_log_to_swift \u003d tripleo_common.actions.queue:PublishUILogToSwiftAction"},{"line_number":99,"context_line":"    tripleo.logging_to_swift.prepare_log_download \u003d tripleo_common.actions.queue:PrepareLogDownloadAction"},{"line_number":100,"context_line":"    tripleo.role.list \u003d tripleo_common.actions.plan:ListRolesAction"}],"source_content_type":"text/x-ttcn-cfg","patch_set":10,"id":"df3967d1_1be17a9b","line":97,"range":{"start_line":97,"start_character":70,"end_line":97,"end_character":75},"in_reply_to":"df3967d1_bbf26e05","updated":"2017-07-31 16:13:41.000000000","message":"Done","commit_id":"aecc038d0fe44e628fd884992b88809dde8d8548"}],"tripleo_common/actions/logging_to_swift.py":[{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"dd2abad99c5f502827a53b5b4695f0a4ebc88e5c","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":111,"context_line":"            swift.put_container(self.logging_container)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        # Determine if we need to rotate the log file"},{"line_number":114,"context_line":"        try:"},{"line_number":115,"context_line":"            headers \u003d swift.head_object(self.logging_container,"},{"line_number":116,"context_line":"                                        constants.TRIPLEO_UI_LOG_FILENAME)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_f328df34","line":113,"range":{"start_line":113,"start_character":10,"end_line":113,"end_character":53},"updated":"2017-08-02 09:40:16.000000000","message":"I think this comment should say \"Rotate the log file\"","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"dd2abad99c5f502827a53b5b4695f0a4ebc88e5c","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            if headers[\u0027content-length\u0027] \u003e constants.TRIPLEO_UI_LOG_FILE_SIZE:"},{"line_number":118,"context_line":"                self._rotate(swift)"},{"line_number":119,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":120,"context_line":"            LOG.debug(\"We don\u0027t have to rotate the log file.\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        try:"},{"line_number":123,"context_line":"            old_contents \u003d swift.get_object("}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_38c88420","line":120,"range":{"start_line":120,"start_character":23,"end_line":120,"end_character":59},"updated":"2017-08-02 09:40:16.000000000","message":"This message doesn\u0027t seem right. It should probably read something like \"File rotation failed.\"","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"dd2abad99c5f502827a53b5b4695f0a4ebc88e5c","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        self.downloads_container \u003d downloads_container"},{"line_number":144,"context_line":"        self.delete_after \u003d delete_after"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _timestamp(self):"},{"line_number":147,"context_line":"        return datetime.utcnow().strftime(\u0027%Y%m%d-%H%M%S\u0027)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def _download_log_files(self, swift, tmp_dir):"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_b804744b","line":146,"range":{"start_line":146,"start_character":8,"end_line":146,"end_character":18},"updated":"2017-08-02 09:40:16.000000000","message":"This method does not have anything to do with this class. I suggest you put both this and the _epoch_to_formatted_date functions in a new module, e.g. utils/time.py.","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"b14079cdb9a4bcdaa8ba265b11450df00a4c14c4","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        self.downloads_container \u003d downloads_container"},{"line_number":144,"context_line":"        self.delete_after \u003d delete_after"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _timestamp(self):"},{"line_number":147,"context_line":"        return datetime.utcnow().strftime(\u0027%Y%m%d-%H%M%S\u0027)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def _download_log_files(self, swift, tmp_dir):"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_fe599f8d","line":146,"range":{"start_line":146,"start_character":8,"end_line":146,"end_character":18},"in_reply_to":"df3967d1_b804744b","updated":"2017-08-03 08:24:37.000000000","message":"Done","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"a7182a833411e5ce2d5316eb628ea0b08d97f569","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            dirname \u003d os.path.dirname(path)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"            if not os.path.exists(dirname):"},{"line_number":159,"context_line":"                os.makedir(dirname)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"            with open(path, \u0027w\u0027) as f:"},{"line_number":162,"context_line":"                f.write(contents)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_9384f3b2","line":159,"range":{"start_line":159,"start_character":16,"end_line":159,"end_character":26},"updated":"2017-08-02 09:49:36.000000000","message":"os.makedir does not exist, you probably want os.makedirs. Another point for reducing code duplication.","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"b14079cdb9a4bcdaa8ba265b11450df00a4c14c4","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            dirname \u003d os.path.dirname(path)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"            if not os.path.exists(dirname):"},{"line_number":159,"context_line":"                os.makedir(dirname)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"            with open(path, \u0027w\u0027) as f:"},{"line_number":162,"context_line":"                f.write(contents)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_581683aa","line":159,"range":{"start_line":159,"start_character":16,"end_line":159,"end_character":26},"in_reply_to":"df3967d1_9384f3b2","updated":"2017-08-03 08:24:37.000000000","message":"Done","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"dd2abad99c5f502827a53b5b4695f0a4ebc88e5c","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            if not os.path.exists(dirname):"},{"line_number":159,"context_line":"                os.makedir(dirname)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"            with open(path, \u0027w\u0027) as f:"},{"line_number":162,"context_line":"                f.write(contents)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _create_and_upload_tarball(self, swift, tmp_dir):"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_588ea8d0","line":161,"range":{"start_line":161,"start_character":36,"end_line":161,"end_character":37},"updated":"2017-08-02 09:40:16.000000000","message":"This f is shadowing the f from line 152.","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"b14079cdb9a4bcdaa8ba265b11450df00a4c14c4","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            if not os.path.exists(dirname):"},{"line_number":159,"context_line":"                os.makedir(dirname)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"            with open(path, \u0027w\u0027) as f:"},{"line_number":162,"context_line":"                f.write(contents)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _create_and_upload_tarball(self, swift, tmp_dir):"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_381bbfd0","line":161,"range":{"start_line":161,"start_character":36,"end_line":161,"end_character":37},"in_reply_to":"df3967d1_588ea8d0","updated":"2017-08-03 08:24:37.000000000","message":"Done","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"dd2abad99c5f502827a53b5b4695f0a4ebc88e5c","unresolved":false,"context_lines":[{"line_number":161,"context_line":"            with open(path, \u0027w\u0027) as f:"},{"line_number":162,"context_line":"                f.write(contents)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _create_and_upload_tarball(self, swift, tmp_dir):"},{"line_number":165,"context_line":"        \"\"\"Create a tarball containing the tmp_dir and upload it to Swift.\"\"\""},{"line_number":166,"context_line":"        tarball_name \u003d \u0027logs-%s.tar.gz\u0027 % self._timestamp()"},{"line_number":167,"context_line":"        headers \u003d {\u0027X-Delete-After\u0027: self.delete_after}"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_b860f402","line":164,"range":{"start_line":164,"start_character":8,"end_line":164,"end_character":34},"updated":"2017-08-02 09:40:16.000000000","message":"This and the previous methods have a lot of code duplication with similar methods from the plan export action. I wonder if we could reduce this code duplication.","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"b14079cdb9a4bcdaa8ba265b11450df00a4c14c4","unresolved":false,"context_lines":[{"line_number":161,"context_line":"            with open(path, \u0027w\u0027) as f:"},{"line_number":162,"context_line":"                f.write(contents)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _create_and_upload_tarball(self, swift, tmp_dir):"},{"line_number":165,"context_line":"        \"\"\"Create a tarball containing the tmp_dir and upload it to Swift.\"\"\""},{"line_number":166,"context_line":"        tarball_name \u003d \u0027logs-%s.tar.gz\u0027 % self._timestamp()"},{"line_number":167,"context_line":"        headers \u003d {\u0027X-Delete-After\u0027: self.delete_after}"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_180c7b92","line":164,"range":{"start_line":164,"start_character":8,"end_line":164,"end_character":34},"in_reply_to":"df3967d1_b860f402","updated":"2017-08-03 08:24:37.000000000","message":"Done","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"dd2abad99c5f502827a53b5b4695f0a4ebc88e5c","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    def run(self, context):"},{"line_number":184,"context_line":"        swift \u003d self.get_object_client(context)"},{"line_number":185,"context_line":"        tmp_dir \u003d tempfile.mkdtemp()"},{"line_number":186,"context_line":"        tarball_name \u003d None"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        try:"},{"line_number":189,"context_line":"            self._download_log_files(swift, tmp_dir)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_33d42720","line":186,"range":{"start_line":186,"start_character":8,"end_line":186,"end_character":27},"updated":"2017-08-02 09:40:16.000000000","message":"This line is unnecessary. Since every except: block returns, the return on the line 203 will only be reached if the try: block succeeds.","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"b14079cdb9a4bcdaa8ba265b11450df00a4c14c4","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    def run(self, context):"},{"line_number":184,"context_line":"        swift \u003d self.get_object_client(context)"},{"line_number":185,"context_line":"        tmp_dir \u003d tempfile.mkdtemp()"},{"line_number":186,"context_line":"        tarball_name \u003d None"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        try:"},{"line_number":189,"context_line":"            self._download_log_files(swift, tmp_dir)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_f81097aa","line":186,"range":{"start_line":186,"start_character":8,"end_line":186,"end_character":27},"in_reply_to":"df3967d1_33d42720","updated":"2017-08-03 08:24:37.000000000","message":"Done","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"2bed9cf79be344ae58b2d3c8b97512a87f287084","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            if headers[\u0027content-length\u0027] \u003c constants.TRIPLEO_UI_LOG_FILE_SIZE:"},{"line_number":82,"context_line":"                return"},{"line_number":83,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":84,"context_line":"            return"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        files \u003d swift.get_container(self.logging_container)[1]"},{"line_number":87,"context_line":"        largest_existing_suffix \u003d 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"df3967d1_7f069f22","line":84,"range":{"start_line":84,"start_character":12,"end_line":84,"end_character":18},"updated":"2017-08-04 13:33:19.000000000","message":"I think we should return actions.Result here, with an appropriate error message.","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"1e49bcf095bd99779f09b1b1a7fbba3371f455bd","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            if headers[\u0027content-length\u0027] \u003c constants.TRIPLEO_UI_LOG_FILE_SIZE:"},{"line_number":82,"context_line":"                return"},{"line_number":83,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":84,"context_line":"            return"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        files \u003d swift.get_container(self.logging_container)[1]"},{"line_number":87,"context_line":"        largest_existing_suffix \u003d 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf3e73b7_cfe69de9","line":84,"range":{"start_line":84,"start_character":12,"end_line":84,"end_character":18},"in_reply_to":"df3967d1_7f069f22","updated":"2017-08-07 13:03:17.000000000","message":"Done","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"2bed9cf79be344ae58b2d3c8b97512a87f287084","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":84,"context_line":"            return"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        files \u003d swift.get_container(self.logging_container)[1]"},{"line_number":87,"context_line":"        largest_existing_suffix \u003d 0"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        for f in files:"}],"source_content_type":"text/x-python","patch_set":12,"id":"df3967d1_6216044c","line":86,"range":{"start_line":86,"start_character":16,"end_line":86,"end_character":21},"updated":"2017-08-04 13:33:19.000000000","message":"This API call could fail, so we should surround it with a try/except block.","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"1e49bcf095bd99779f09b1b1a7fbba3371f455bd","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":84,"context_line":"            return"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        files \u003d swift.get_container(self.logging_container)[1]"},{"line_number":87,"context_line":"        largest_existing_suffix \u003d 0"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        for f in files:"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf3e73b7_6fcd715c","line":86,"range":{"start_line":86,"start_character":16,"end_line":86,"end_character":21},"in_reply_to":"df3967d1_6216044c","updated":"2017-08-07 13:03:17.000000000","message":"Done","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"2bed9cf79be344ae58b2d3c8b97512a87f287084","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        next_suffix \u003d largest_existing_suffix + 1"},{"line_number":98,"context_line":"        next_filename \u003d \u0027{}.{}\u0027.format("},{"line_number":99,"context_line":"            constants.TRIPLEO_UI_LOG_FILENAME, next_suffix)"},{"line_number":100,"context_line":"        data \u003d swift.get_object(self.logging_container,"},{"line_number":101,"context_line":"                                constants.TRIPLEO_UI_LOG_FILENAME)[1]"},{"line_number":102,"context_line":"        swift.put_object(self.logging_container, next_filename, data)"},{"line_number":103,"context_line":"        swift.delete_object(self.logging_container,"},{"line_number":104,"context_line":"                            constants.TRIPLEO_UI_LOG_FILENAME)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def run(self, context):"},{"line_number":107,"context_line":"        swift \u003d self.get_object_client(context)"}],"source_content_type":"text/x-python","patch_set":12,"id":"df3967d1_c23ed0bf","line":104,"range":{"start_line":100,"start_character":8,"end_line":104,"end_character":62},"updated":"2017-08-04 13:33:19.000000000","message":"These API calls could fail, so we should surround them with a try/except block.","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"1e49bcf095bd99779f09b1b1a7fbba3371f455bd","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        next_suffix \u003d largest_existing_suffix + 1"},{"line_number":98,"context_line":"        next_filename \u003d \u0027{}.{}\u0027.format("},{"line_number":99,"context_line":"            constants.TRIPLEO_UI_LOG_FILENAME, next_suffix)"},{"line_number":100,"context_line":"        data \u003d swift.get_object(self.logging_container,"},{"line_number":101,"context_line":"                                constants.TRIPLEO_UI_LOG_FILENAME)[1]"},{"line_number":102,"context_line":"        swift.put_object(self.logging_container, next_filename, data)"},{"line_number":103,"context_line":"        swift.delete_object(self.logging_container,"},{"line_number":104,"context_line":"                            constants.TRIPLEO_UI_LOG_FILENAME)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def run(self, context):"},{"line_number":107,"context_line":"        swift \u003d self.get_object_client(context)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf3e73b7_4fdaad17","line":104,"range":{"start_line":100,"start_character":8,"end_line":104,"end_character":62},"in_reply_to":"df3967d1_c23ed0bf","updated":"2017-08-07 13:03:17.000000000","message":"Done","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"2bed9cf79be344ae58b2d3c8b97512a87f287084","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                \"There is no existing logging data, starting a new file.\")"},{"line_number":119,"context_line":"            new_contents \u003d self.logging_data"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        swift.put_object(self.logging_container,"},{"line_number":122,"context_line":"                         constants.TRIPLEO_UI_LOG_FILENAME,"},{"line_number":123,"context_line":"                         new_contents)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"df3967d1_02561807","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":24},"updated":"2017-08-04 13:33:19.000000000","message":"Missing a try/except here as well.","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"1e49bcf095bd99779f09b1b1a7fbba3371f455bd","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                \"There is no existing logging data, starting a new file.\")"},{"line_number":119,"context_line":"            new_contents \u003d self.logging_data"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        swift.put_object(self.logging_container,"},{"line_number":122,"context_line":"                         constants.TRIPLEO_UI_LOG_FILENAME,"},{"line_number":123,"context_line":"                         new_contents)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"bf3e73b7_4f486dcb","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":24},"in_reply_to":"df3967d1_02561807","updated":"2017-08-07 13:03:17.000000000","message":"Done","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"99146c1d9e7809a75c9872a931fa3b44c63d61ce","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def run(self, context):"},{"line_number":125,"context_line":"        swift \u003d self.get_object_client(context)"},{"line_number":126,"context_line":"        swiftutils.get_or_create_container(swift, self.logging_container)"},{"line_number":127,"context_line":"        self._rotate(swift)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_e92682ce","line":126,"updated":"2017-08-14 08:52:09.000000000","message":"IIUC, we get the container here, and again on line 96 in _rotate. This could be slightly optimised.","commit_id":"4cd60846af566b380ff9039f5daa6d5c1f875e76"}],"tripleo_common/actions/queue.py":[{"author":{"_account_id":8532,"name":"Ryan Brady","email":"rbrady@redhat.com","username":"rbrady"},"change_message_id":"5958044bf39ac5689673673b07794325048b582f","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from tripleo_common.actions import base"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"FILE_SIZE \u003d 1e7  # 10MB"},{"line_number":22,"context_line":"FILENAME \u003d \u0027tripleo-ui.log\u0027"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def _epoch_to_formatted_date(epoch):"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_7bdaa017","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":27},"updated":"2017-05-30 21:14:46.000000000","message":"Why not define these in tripleo_common.constants ?","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"fa8a8db7ababa5e64297e8acb673744d2fa30b03","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from tripleo_common.actions import base"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"FILE_SIZE \u003d 1e7  # 10MB"},{"line_number":22,"context_line":"FILENAME \u003d \u0027tripleo-ui.log\u0027"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def _epoch_to_formatted_date(epoch):"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_0e3a2433","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":27},"in_reply_to":"df140735_7bdaa017","updated":"2017-05-31 17:57:45.000000000","message":"Done","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":8532,"name":"Ryan Brady","email":"rbrady@redhat.com","username":"rbrady"},"change_message_id":"5958044bf39ac5689673673b07794325048b582f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    return dt.strftime(\u0027%Y-%m-%d %H:%M:%S\u0027)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class FormatMessagesAction(base.TripleOAction):"},{"line_number":32,"context_line":"    \"\"\"Format messages as logs"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Given a list of Zaqar messages from the TripleO UI, return a log-formatted"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_bb271813","line":31,"range":{"start_line":31,"start_character":32,"end_line":31,"end_character":45},"updated":"2017-05-30 21:14:46.000000000","message":"If this action isn\u0027t calling any of the methods in the TripleOAction, it can just derive from mistral_lib.actions.Action","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":8532,"name":"Ryan Brady","email":"rbrady@redhat.com","username":"rbrady"},"change_message_id":"22793e379c53a6bcbe791aa6366a7fa2b4a69206","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    return dt.strftime(\u0027%Y-%m-%d %H:%M:%S\u0027)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class FormatMessagesAction(base.TripleOAction):"},{"line_number":32,"context_line":"    \"\"\"Format messages as logs"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Given a list of Zaqar messages from the TripleO UI, return a log-formatted"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_ac63401a","line":31,"range":{"start_line":31,"start_character":32,"end_line":31,"end_character":45},"in_reply_to":"df140735_4e381c3c","updated":"2017-05-31 18:09:10.000000000","message":"I don\u0027t see it in this action, only the other action.","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"0eda7b97d19dbcf616f603d63ba6957ecb4adf19","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    return dt.strftime(\u0027%Y-%m-%d %H:%M:%S\u0027)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class FormatMessagesAction(base.TripleOAction):"},{"line_number":32,"context_line":"    \"\"\"Format messages as logs"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Given a list of Zaqar messages from the TripleO UI, return a log-formatted"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_a7ffdbff","line":31,"range":{"start_line":31,"start_character":32,"end_line":31,"end_character":45},"in_reply_to":"df140735_ac63401a","updated":"2017-05-31 18:10:17.000000000","message":"My mistake, thanks!","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"fa8a8db7ababa5e64297e8acb673744d2fa30b03","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    return dt.strftime(\u0027%Y-%m-%d %H:%M:%S\u0027)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class FormatMessagesAction(base.TripleOAction):"},{"line_number":32,"context_line":"    \"\"\"Format messages as logs"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Given a list of Zaqar messages from the TripleO UI, return a log-formatted"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_4e381c3c","line":31,"range":{"start_line":31,"start_character":32,"end_line":31,"end_character":45},"in_reply_to":"df140735_bb271813","updated":"2017-05-31 17:57:45.000000000","message":"It does actually call \"get_object_client\".","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":8532,"name":"Ryan Brady","email":"rbrady@redhat.com","username":"rbrady"},"change_message_id":"5958044bf39ac5689673673b07794325048b582f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"class PublishUILogToSwiftAction(base.TripleOAction):"},{"line_number":58,"context_line":"    \"\"\"Publish logs from UI to Swift\"\"\""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def __init__(self, logging_data, logging_container\u003d\u0027tripleo-ui-logs\u0027):"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        super(PublishUILogToSwiftAction, self).__init__()"},{"line_number":63,"context_line":"        self.logging_data \u003d logging_data"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_db608c35","line":60,"range":{"start_line":60,"start_character":37,"end_line":60,"end_character":72},"updated":"2017-05-30 21:14:46.000000000","message":"This might be better to leave as a standard arg and put the default of \u0027tripleo-ui-logs\u0027 in the workflow input. (similar to how we set the default for zaqar queue)","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"fa8a8db7ababa5e64297e8acb673744d2fa30b03","unresolved":false,"context_lines":[{"line_number":57,"context_line":"class PublishUILogToSwiftAction(base.TripleOAction):"},{"line_number":58,"context_line":"    \"\"\"Publish logs from UI to Swift\"\"\""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def __init__(self, logging_data, logging_container\u003d\u0027tripleo-ui-logs\u0027):"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        super(PublishUILogToSwiftAction, self).__init__()"},{"line_number":63,"context_line":"        self.logging_data \u003d logging_data"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_0e68e41e","line":60,"range":{"start_line":60,"start_character":37,"end_line":60,"end_character":72},"in_reply_to":"df140735_db608c35","updated":"2017-05-31 17:57:45.000000000","message":"Done","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":11,"context_line":"# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"},{"line_number":12,"context_line":"# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"# under the License."},{"line_number":15,"context_line":"from datetime import datetime"},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":"import os"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_77c97823","line":14,"updated":"2017-07-11 11:40:30.000000000","message":"This module itself in general could use some logging itself, there\u0027s complex stuff going on. You can look at actions/baremetal.py for some light logging examples. At least for the relevant exceptions, and some debug/info statements where we expect things might go wrong.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":11,"context_line":"# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"},{"line_number":12,"context_line":"# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"# under the License."},{"line_number":15,"context_line":"from datetime import datetime"},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":"import os"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_529f14b4","line":14,"in_reply_to":"3f1d235d_77c97823","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        for message in self.messages:"},{"line_number":49,"context_line":"            message \u003d message[\u0027body\u0027]"},{"line_number":50,"context_line":"            body \u003d message[\u0027message\u0027]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            if isinstance(body, (dict, list,)):"},{"line_number":53,"context_line":"                body \u003d json.dumps(body)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_9789b427","line":50,"updated":"2017-07-11 11:40:30.000000000","message":"Should we use .get() with a default in order to be more resilient here, in case the keys don\u0027t exist for some reason? Even if it\u0027s not very likely, since the logs are supposed to be helping resolve problems better be as safe as possible, I think.\n\nHaving \"message\" assigned [\u0027body\u0027] and \"body\" receive [\u0027message\u0027] is somewhat confusing at a first glance. Could we call it log_line or something? The second one feels more like a message (clearer than body) since it ends up being what\u0027s dumped into the log file, though I might well be misunderstanding.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        for message in self.messages:"},{"line_number":49,"context_line":"            message \u003d message[\u0027body\u0027]"},{"line_number":50,"context_line":"            body \u003d message[\u0027message\u0027]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            if isinstance(body, (dict, list,)):"},{"line_number":53,"context_line":"                body \u003d json.dumps(body)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_12a98cde","line":50,"in_reply_to":"3f1d235d_9789b427","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":66,"context_line":"class PublishUILogToSwiftAction(base.TripleOAction):"},{"line_number":67,"context_line":"    \"\"\"Publish logs from UI to Swift\"\"\""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, logging_data, logging_container):"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        super(PublishUILogToSwiftAction, self).__init__()"},{"line_number":72,"context_line":"        self.logging_data \u003d logging_data"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_6265381d","line":69,"range":{"start_line":69,"start_character":37,"end_line":69,"end_character":54},"updated":"2017-07-11 11:40:30.000000000","message":"We might want to set it to a default defined in constants.py (and still keep it as a parameter like e.g. https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/plan.py#L192 ), unless we expect it to be quite variable?","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":66,"context_line":"class PublishUILogToSwiftAction(base.TripleOAction):"},{"line_number":67,"context_line":"    \"\"\"Publish logs from UI to Swift\"\"\""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, logging_data, logging_container):"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        super(PublishUILogToSwiftAction, self).__init__()"},{"line_number":72,"context_line":"        self.logging_data \u003d logging_data"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_d29304a3","line":69,"range":{"start_line":69,"start_character":37,"end_line":69,"end_character":54},"in_reply_to":"3f1d235d_6265381d","updated":"2017-07-21 17:35:20.000000000","message":"rbrady suggested the opposite in a previous comment; I think it\u0027s better to put the default in the workbook.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    \"\"\"Publish logs from UI to Swift\"\"\""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, logging_data, logging_container):"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        super(PublishUILogToSwiftAction, self).__init__()"},{"line_number":72,"context_line":"        self.logging_data \u003d logging_data"},{"line_number":73,"context_line":"        self.logging_container \u003d logging_container"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_d7abac72","line":70,"updated":"2017-07-11 11:40:30.000000000","message":"Probably no need for the new line, the other classes in this file don\u0027t have it.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    \"\"\"Publish logs from UI to Swift\"\"\""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def __init__(self, logging_data, logging_container):"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        super(PublishUILogToSwiftAction, self).__init__()"},{"line_number":72,"context_line":"        self.logging_data \u003d logging_data"},{"line_number":73,"context_line":"        self.logging_container \u003d logging_container"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_b2908097","line":70,"in_reply_to":"3f1d235d_d7abac72","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        suffix_numbers \u003d []"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        for file in files:"},{"line_number":81,"context_line":"            try:"},{"line_number":82,"context_line":"                suffix_numbers.append("},{"line_number":83,"context_line":"                    int(file[\u0027name\u0027].split(\u0027.\u0027)[-1])"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_7dbb99e4","line":80,"range":{"start_line":80,"start_character":12,"end_line":80,"end_character":17},"updated":"2017-07-11 11:40:30.000000000","message":"file\u0027s a reserved keyword in python, it may be safer to call this \u0027f\u0027 or something.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        suffix_numbers \u003d []"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        for file in files:"},{"line_number":81,"context_line":"            try:"},{"line_number":82,"context_line":"                suffix_numbers.append("},{"line_number":83,"context_line":"                    int(file[\u0027name\u0027].split(\u0027.\u0027)[-1])"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_72e8d815","line":80,"range":{"start_line":80,"start_character":12,"end_line":80,"end_character":17},"in_reply_to":"3f1d235d_7dbb99e4","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        for file in files:"},{"line_number":81,"context_line":"            try:"},{"line_number":82,"context_line":"                suffix_numbers.append("},{"line_number":83,"context_line":"                    int(file[\u0027name\u0027].split(\u0027.\u0027)[-1])"},{"line_number":84,"context_line":"                )"},{"line_number":85,"context_line":"            except ValueError:"},{"line_number":86,"context_line":"                continue"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_dd8e2d31","line":84,"range":{"start_line":82,"start_character":0,"end_line":84,"end_character":17},"updated":"2017-07-11 11:40:30.000000000","message":"Do we really need to store them all in a list? Couldn\u0027t we do the comparison on the go so we only store the max_suffix_number if the new suffix is bigger?","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        for file in files:"},{"line_number":81,"context_line":"            try:"},{"line_number":82,"context_line":"                suffix_numbers.append("},{"line_number":83,"context_line":"                    int(file[\u0027name\u0027].split(\u0027.\u0027)[-1])"},{"line_number":84,"context_line":"                )"},{"line_number":85,"context_line":"            except ValueError:"},{"line_number":86,"context_line":"                continue"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_32dc9045","line":84,"range":{"start_line":82,"start_character":0,"end_line":84,"end_character":17},"in_reply_to":"3f1d235d_dd8e2d31","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            constants.TRIPLEO_UI_LOG_FILENAME, next_number)"},{"line_number":96,"context_line":"        data \u003d swift.get_object(self.logging_container,"},{"line_number":97,"context_line":"                                constants.TRIPLEO_UI_LOG_FILENAME)[1]"},{"line_number":98,"context_line":"        swift.put_object(self.logging_container, next_filename, data)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def run(self, context):"},{"line_number":101,"context_line":"        swift \u003d self.get_object_client(context)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_dd9ced5c","line":98,"updated":"2017-07-11 11:40:30.000000000","message":"Do we need to delete the old file too?","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            constants.TRIPLEO_UI_LOG_FILENAME, next_number)"},{"line_number":96,"context_line":"        data \u003d swift.get_object(self.logging_container,"},{"line_number":97,"context_line":"                                constants.TRIPLEO_UI_LOG_FILENAME)[1]"},{"line_number":98,"context_line":"        swift.put_object(self.logging_container, next_filename, data)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def run(self, context):"},{"line_number":101,"context_line":"        swift \u003d self.get_object_client(context)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_f2ce0882","line":98,"in_reply_to":"3f1d235d_dd9ced5c","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            headers \u003d swift.head_object(self.logging_container,"},{"line_number":112,"context_line":"                                        constants.TRIPLEO_UI_LOG_FILENAME)"},{"line_number":113,"context_line":"            if headers[\u0027content-length\u0027] \u003e constants.TRIPLEO_UI_LOG_FILE_SIZE:"},{"line_number":114,"context_line":"                self._rotate(swift)"},{"line_number":115,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":116,"context_line":"            pass"},{"line_number":117,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_0897c592","line":114,"updated":"2017-07-11 11:40:30.000000000","message":"Should rotation also handle deleting old log files, I wonder? Limit to 100 or something so that we don\u0027t end up with the UI log files eating up all the undercloud space? Or is this handled via another header somewhere? This could be handled in a separate patch if preferred, if we want to keep this one for laying the foundations.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                constants.TRIPLEO_UI_LOG_FILENAME)[1]"},{"line_number":122,"context_line":"            new_contents \u003d old_contents + \u0027\\n\u0027 + self.logging_data"},{"line_number":123,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":124,"context_line":"            new_contents \u003d self.logging_data"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        swift.put_object(self.logging_container,"},{"line_number":127,"context_line":"                         constants.TRIPLEO_UI_LOG_FILENAME,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_882d1548","line":124,"updated":"2017-07-11 11:40:30.000000000","message":"Definitely a place where we\u0027ll want some logging for the exception.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                constants.TRIPLEO_UI_LOG_FILENAME)[1]"},{"line_number":122,"context_line":"            new_contents \u003d old_contents + \u0027\\n\u0027 + self.logging_data"},{"line_number":123,"context_line":"        except swiftexceptions.ClientException:"},{"line_number":124,"context_line":"            new_contents \u003d self.logging_data"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        swift.put_object(self.logging_container,"},{"line_number":127,"context_line":"                         constants.TRIPLEO_UI_LOG_FILENAME,"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_92c1fc31","line":124,"in_reply_to":"3f1d235d_882d1548","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":131,"context_line":"class PrepareLogDownloadAction(base.TripleOAction):"},{"line_number":132,"context_line":"    \"\"\"Publish all GUI logs to a temporary URL\"\"\""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def __init__(self, source_container, container, delete_after):"},{"line_number":135,"context_line":"        super(PrepareLogDownloadAction, self).__init__()"},{"line_number":136,"context_line":"        self.source_container \u003d source_container"},{"line_number":137,"context_line":"        self.container \u003d container"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_6878798e","line":134,"range":{"start_line":134,"start_character":23,"end_line":134,"end_character":39},"updated":"2017-07-11 11:40:30.000000000","message":"What\u0027s the source here? The container which currently contains the logs? And \u0027container\u0027 is the temporary one that\u0027ll contained the tarball? I feel like we could improve the naming and/or add a comment to make life easier here.\n\nAlso, the code is so similar to ExportPlanAction, perhaps we should keep a similar parameter order so the classes are easier to refactor into one or something in the future.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"9dccf31da8878e405f9adba65304496f95d9ccf6","unresolved":false,"context_lines":[{"line_number":131,"context_line":"class PrepareLogDownloadAction(base.TripleOAction):"},{"line_number":132,"context_line":"    \"\"\"Publish all GUI logs to a temporary URL\"\"\""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def __init__(self, source_container, container, delete_after):"},{"line_number":135,"context_line":"        super(PrepareLogDownloadAction, self).__init__()"},{"line_number":136,"context_line":"        self.source_container \u003d source_container"},{"line_number":137,"context_line":"        self.container \u003d container"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_52e154d0","line":134,"range":{"start_line":134,"start_character":23,"end_line":134,"end_character":39},"in_reply_to":"3f1d235d_6878798e","updated":"2017-07-21 17:35:20.000000000","message":"Done","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"}],"tripleo_common/tests/actions/test_logging_to_swift.py":[{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"a7182a833411e5ce2d5316eb628ea0b08d97f569","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Red Hat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":11,"id":"df3967d1_d3d4bbbf","line":1,"updated":"2017-08-02 09:49:36.000000000","message":"Would be good to add some more tests and test other two new actions.","commit_id":"0243d67d6fd73c32493d4afd12646fd2ace4b980"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"2bed9cf79be344ae58b2d3c8b97512a87f287084","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Red Hat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":12,"id":"df3967d1_429e60b9","line":1,"updated":"2017-08-04 13:33:19.000000000","message":"Still missing tests for other 2 actions.","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"1e49bcf095bd99779f09b1b1a7fbba3371f455bd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Red Hat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf3e73b7_2f4529b4","line":1,"in_reply_to":"df3967d1_429e60b9","updated":"2017-08-07 13:03:17.000000000","message":"Done","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"}],"tripleo_common/tests/actions/test_queue.py":[{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"3f1d235d_68d4f947","line":42,"updated":"2017-07-11 11:40:30.000000000","message":"I\u0027d be more comfortable with additional testing. At least for the rotate function.","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"}],"tripleo_common/utils/swift.py":[{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"1914bc567ac2c56f853c5af006c44ac2a188a59f","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            os.makedirs(dirname)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        with open(path, \u0027w\u0027) as f:"},{"line_number":72,"context_line":"            f.write(contents)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def get_or_create_container(swiftclient, container):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f436f4f_bada5ae6","line":72,"updated":"2017-08-09 19:01:15.000000000","message":"I just noticed that this functionalitiy is duplicated in tripleoclient. Probably should add that to the list of things to clean up after this.\n\nhttps://github.com/openstack/python-tripleoclient/blob/master/tripleoclient/workflows/support.py#L34","commit_id":"4cd60846af566b380ff9039f5daa6d5c1f875e76"}],"tripleo_common/utils/time_functions.py":[{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"2bed9cf79be344ae58b2d3c8b97512a87f287084","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Red Hat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":12,"id":"df3967d1_826c489c","line":1,"updated":"2017-08-04 13:33:19.000000000","message":"Thanks for extracting these in a separate module! Could you add some unit tests for these functions as well?","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"1e49bcf095bd99779f09b1b1a7fbba3371f455bd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Red Hat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf3e73b7_cf0d7d91","line":1,"in_reply_to":"df3967d1_826c489c","updated":"2017-08-07 13:03:17.000000000","message":"Done","commit_id":"0188bd75d2b3a5214daf34cc1821b7191d920fad"}],"workbooks/plan_management.yaml":[{"author":{"_account_id":8532,"name":"Ryan Brady","email":"rbrady@redhat.com","username":"rbrady"},"change_message_id":"5958044bf39ac5689673673b07794325048b582f","unresolved":false,"context_lines":[{"line_number":412,"context_line":"        on-success:"},{"line_number":413,"context_line":"          - fail: \u003c% $.get(\u0027status\u0027) \u003d \"FAILED\" %\u003e"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"  publish_ui_logs_to_swift:"},{"line_number":416,"context_line":"    description: \u003e"},{"line_number":417,"context_line":"      Drain a zaqar queue and publish its messages into a log file in swift"},{"line_number":418,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"df140735_761cf769","line":415,"range":{"start_line":415,"start_character":2,"end_line":415,"end_character":26},"updated":"2017-05-30 21:14:46.000000000","message":"How is this workflow going to be called?  There\u0027s no zaqar messaging tasks here to update the caller of this workflow.","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":20970,"name":"Honza Pokorny","email":"honza@redhat.com","username":"hpokorny"},"change_message_id":"fa8a8db7ababa5e64297e8acb673744d2fa30b03","unresolved":false,"context_lines":[{"line_number":412,"context_line":"        on-success:"},{"line_number":413,"context_line":"          - fail: \u003c% $.get(\u0027status\u0027) \u003d \"FAILED\" %\u003e"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"  publish_ui_logs_to_swift:"},{"line_number":416,"context_line":"    description: \u003e"},{"line_number":417,"context_line":"      Drain a zaqar queue and publish its messages into a log file in swift"},{"line_number":418,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"df140735_8c651c48","line":415,"range":{"start_line":415,"start_character":2,"end_line":415,"end_character":26},"in_reply_to":"df140735_761cf769","updated":"2017-05-31 17:57:45.000000000","message":"Calle by cron trigger.  I think we should probably create a new queue for logging messages.","commit_id":"c93f408529889d957dc30c70400cbf03ef22bc8d"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":487,"context_line":""},{"line_number":488,"context_line":"      format_messages:"},{"line_number":489,"context_line":"        action: tripleo.queue.format_messages"},{"line_number":490,"context_line":"        on-success: upload_to_swift"},{"line_number":491,"context_line":"        input:"},{"line_number":492,"context_line":"          messages: \u003c% $.messages %\u003e"},{"line_number":493,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":9,"id":"3f1d235d_887875f8","line":490,"range":{"start_line":490,"start_character":8,"end_line":490,"end_character":18},"updated":"2017-07-11 11:40:30.000000000","message":"Might need an on-error too?","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"0d04fc8c93977a141e263b9899c53344b9edc8fd","unresolved":false,"context_lines":[{"line_number":535,"context_line":"          - fail: \u003c% $.get(\u0027status\u0027) \u003d \"FAILED\" %\u003e"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"  download_logs:"},{"line_number":538,"context_line":"    description: Creates an export tarball for a given plan"},{"line_number":539,"context_line":"    input:"},{"line_number":540,"context_line":"      - queue_name: tripleo"},{"line_number":541,"context_line":"      - source_container: \"tripleo-ui-logs\""}],"source_content_type":"text/x-yaml","patch_set":9,"id":"3f1d235d_a898d174","line":538,"range":{"start_line":538,"start_character":17,"end_line":538,"end_character":59},"updated":"2017-07-11 11:40:30.000000000","message":"Probably needs an update :)","commit_id":"279db9e97a7e97acb9f1084fef2188c75d5ce83f"}]}
