)]}'
{"karbor/services/protection/checkpoint.py":[{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"b7ff7cece9efd4aa88056eef84271238f0e10604","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            value\u003dself._md_cache,"},{"line_number":194,"context_line":"        )"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def commit_db(self, context):"},{"line_number":197,"context_line":"        checkpoint_dict \u003d self.to_dict()"},{"line_number":198,"context_line":"        extend_info \u003d checkpoint_dict.get(\u0027extend_info\u0027, None)"},{"line_number":199,"context_line":"        create_by \u003d (extend_info.get(\u0027create_by\u0027, None)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a77a97e_989120f4","line":196,"range":{"start_line":196,"start_character":8,"end_line":196,"end_character":17},"updated":"2016-11-18 02:10:58.000000000","message":"I am confused about this operation in the checkpoint. I don\u0027t think the db operation of CheckpointRecord should put in the checkpoint object. It is not one datamodel of checkpoint. It is just a common database operation for checkpoint_record database table.","commit_id":"da718edad554452c40a159f3572992223caba3c5"}],"karbor/services/protection/flows/create_protection.py":[{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"f12cd9deb078dc7fc35a75ae3e0a064770ad1083","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        LOG.debug(\"Complete protect checkpoint_id: %s\", checkpoint.id)"},{"line_number":47,"context_line":"        checkpoint.status \u003d constants.CHECKPOINT_STATUS_AVAILABLE"},{"line_number":48,"context_line":"        checkpoint.commit()"},{"line_number":49,"context_line":"        self._record_checkpoint_db(checkpoint)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _record_checkpoint_db(self, checkpoint):"},{"line_number":52,"context_line":"        checkpoint_dict \u003d checkpoint.to_dict()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_bf3a7c32","line":49,"range":{"start_line":49,"start_character":8,"end_line":49,"end_character":46},"updated":"2016-12-21 02:45:07.000000000","message":"It is better to add another task to finish this work. Because one task just do one thing.\nBy the way, if your \u0027execute\u0027 method needs \u0027context\u0027 parameter, add it to the \u0027store\u0027 parameter on line 97, but don\u0027t add it as the attribute of task.","commit_id":"23ae85f27a45ae0099e42dca4d241be905874d35"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"2906b931206ee5442516167a5ba07770b37f9db1","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class CompleteProtectTask(task.Task):"},{"line_number":78,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":79,"context_line":"        super(CompleteProtectTask, self).__init__(*args, **kwargs)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def execute(self, context, checkpoint):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_13404756","line":78,"range":{"start_line":78,"start_character":22,"end_line":78,"end_character":38},"updated":"2016-12-22 01:35:48.000000000","message":"Why do you add these two parameters?","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"9bdc3850df1515b7086acc1749b2c83f5ff20614","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class CompleteProtectTask(task.Task):"},{"line_number":78,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":79,"context_line":"        super(CompleteProtectTask, self).__init__(*args, **kwargs)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def execute(self, context, checkpoint):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_ee93d64d","line":78,"range":{"start_line":78,"start_character":22,"end_line":78,"end_character":38},"in_reply_to":"da4df55a_13404756","updated":"2016-12-22 01:50:37.000000000","message":"Keep scalability","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"b89155d09a97e28d8ddc6cc6a93fba5e857c222d","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class CompleteProtectTask(task.Task):"},{"line_number":78,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":79,"context_line":"        super(CompleteProtectTask, self).__init__(*args, **kwargs)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def execute(self, context, checkpoint):"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_894ec4bf","line":78,"range":{"start_line":78,"start_character":22,"end_line":78,"end_character":38},"in_reply_to":"da4df55a_ee93d64d","updated":"2016-12-22 02:45:47.000000000","message":"But you did not use it. If some one need use it, he/she will add it.","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"2906b931206ee5442516167a5ba07770b37f9db1","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        LOG.debug(\"Complete protect checkpoint_id: %s\", checkpoint.id)"},{"line_number":83,"context_line":"        checkpoint.status \u003d constants.CHECKPOINT_STATUS_AVAILABLE"},{"line_number":84,"context_line":"        checkpoint.commit()"},{"line_number":85,"context_line":"        update_checkpoint_db(context, checkpoint, checkpoint.status)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_flow(context, workflow_engine, operation_type, plan, provider,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_6e10c64f","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":28},"updated":"2016-12-22 01:35:48.000000000","message":"IMO, it is not a good practice to do two things in one task. You can see the flows/create_restoration.py as the reference.","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"9bdc3850df1515b7086acc1749b2c83f5ff20614","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        LOG.debug(\"Complete protect checkpoint_id: %s\", checkpoint.id)"},{"line_number":83,"context_line":"        checkpoint.status \u003d constants.CHECKPOINT_STATUS_AVAILABLE"},{"line_number":84,"context_line":"        checkpoint.commit()"},{"line_number":85,"context_line":"        update_checkpoint_db(context, checkpoint, checkpoint.status)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_flow(context, workflow_engine, operation_type, plan, provider,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_ee0916df","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":28},"in_reply_to":"da4df55a_6e10c64f","updated":"2016-12-22 01:50:37.000000000","message":"In my humble option, They are all update status, it is the same thing.","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"0e1b14f3d36919678e177cee983c56bb572a952c","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        LOG.debug(\"Complete protect checkpoint_id: %s\", checkpoint.id)"},{"line_number":83,"context_line":"        checkpoint.status \u003d constants.CHECKPOINT_STATUS_AVAILABLE"},{"line_number":84,"context_line":"        checkpoint.commit()"},{"line_number":85,"context_line":"        update_checkpoint_db(context, checkpoint, checkpoint.status)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_flow(context, workflow_engine, operation_type, plan, provider,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_9fe4363c","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":28},"in_reply_to":"da4df55a_89fc0440","updated":"2016-12-22 03:38:31.000000000","message":"Why failed? By the way, if you separate it as a task, it still have this problem.","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"207eb045230aa3ae498045e19b4c9683574678f2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        LOG.debug(\"Complete protect checkpoint_id: %s\", checkpoint.id)"},{"line_number":83,"context_line":"        checkpoint.status \u003d constants.CHECKPOINT_STATUS_AVAILABLE"},{"line_number":84,"context_line":"        checkpoint.commit()"},{"line_number":85,"context_line":"        update_checkpoint_db(context, checkpoint, checkpoint.status)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_flow(context, workflow_engine, operation_type, plan, provider,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_fffd426f","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":28},"in_reply_to":"da4df55a_9fe4363c","updated":"2016-12-22 03:52:57.000000000","message":"There are many reason to lead failure when you access other services.\nI mean how do you know which fails when one of them fails if you add these two work in one task. On the other hand, it is more clear to do one thing in one task. And you can define \u0027revert\u0027 method in task to handle the exception when subsequent task fail.","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"b89155d09a97e28d8ddc6cc6a93fba5e857c222d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        LOG.debug(\"Complete protect checkpoint_id: %s\", checkpoint.id)"},{"line_number":83,"context_line":"        checkpoint.status \u003d constants.CHECKPOINT_STATUS_AVAILABLE"},{"line_number":84,"context_line":"        checkpoint.commit()"},{"line_number":85,"context_line":"        update_checkpoint_db(context, checkpoint, checkpoint.status)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_flow(context, workflow_engine, operation_type, plan, provider,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_89fc0440","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":28},"in_reply_to":"da4df55a_ee0916df","updated":"2016-12-22 02:45:47.000000000","message":"IF update checkpoint success but update db fail, what would you do?","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"0dfd720ee241be8c61cbad429642d2a752827c46","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        LOG.debug(\"Complete protect checkpoint_id: %s\", checkpoint.id)"},{"line_number":83,"context_line":"        checkpoint.status \u003d constants.CHECKPOINT_STATUS_AVAILABLE"},{"line_number":84,"context_line":"        checkpoint.commit()"},{"line_number":85,"context_line":"        update_checkpoint_db(context, checkpoint, checkpoint.status)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_flow(context, workflow_engine, operation_type, plan, provider,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_0252aa13","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":28},"in_reply_to":"da4df55a_fffd426f","updated":"2016-12-22 04:56:27.000000000","message":"If we separate it as two tasks like class UpdateBankStatusTask(task.Task) and class UpdateDBStatusTask(task.Task), They all only need to define \u0027execute\u0027 method, because \u0027InitiateProtectTask\u0027 task has \u0027revert\u0027 method to handle it.\nso, if that, I think it all is ok.","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"2906b931206ee5442516167a5ba07770b37f9db1","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        protection_flow,"},{"line_number":109,"context_line":"        InitiateProtectTask(),"},{"line_number":110,"context_line":"        resources_task_flow,"},{"line_number":111,"context_line":"        CompleteProtectTask(context),"},{"line_number":112,"context_line":"    )"},{"line_number":113,"context_line":"    flow_engine \u003d workflow_engine.get_engine(protection_flow, store\u003d{"},{"line_number":114,"context_line":"        \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_f343c36a","line":111,"range":{"start_line":111,"start_character":28,"end_line":111,"end_character":35},"updated":"2016-12-22 01:35:48.000000000","message":"Sorry, not quite understand. Why do you pass it?","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"9bdc3850df1515b7086acc1749b2c83f5ff20614","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        protection_flow,"},{"line_number":109,"context_line":"        InitiateProtectTask(),"},{"line_number":110,"context_line":"        resources_task_flow,"},{"line_number":111,"context_line":"        CompleteProtectTask(context),"},{"line_number":112,"context_line":"    )"},{"line_number":113,"context_line":"    flow_engine \u003d workflow_engine.get_engine(protection_flow, store\u003d{"},{"line_number":114,"context_line":"        \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_ce2b7232","line":111,"range":{"start_line":111,"start_character":28,"end_line":111,"end_character":35},"in_reply_to":"da4df55a_f343c36a","updated":"2016-12-22 01:50:37.000000000","message":"Sorry, forgot it.","commit_id":"5a6043f01925fdb1172c859eb5705afe82a7fdd0"}],"karbor/services/protection/flows/delete.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"9bc7c4856efb3de7bc15499c2dda4b953110e8f4","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def update_checkpoint_db(context, checkpoint, status):"},{"line_number":25,"context_line":"    try:"},{"line_number":26,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":27,"context_line":"                                                         checkpoint.id)"},{"line_number":28,"context_line":"    except Exception:"},{"line_number":29,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_3c992e20","line":26,"range":{"start_line":26,"start_character":8,"end_line":26,"end_character":19},"updated":"2016-12-26 04:23:45.000000000","message":"checkpoint_record or checkpoint_data","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"471e7184bd9a5b5c1a5b259f63bfde75389fd309","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def update_checkpoint_db(context, checkpoint, status):"},{"line_number":25,"context_line":"    try:"},{"line_number":26,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":27,"context_line":"                                                         checkpoint.id)"},{"line_number":28,"context_line":"    except Exception:"},{"line_number":29,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_10752b97","line":26,"range":{"start_line":26,"start_character":8,"end_line":26,"end_character":19},"in_reply_to":"da4df55a_3c992e20","updated":"2016-12-26 07:14:46.000000000","message":"Done","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"9bc7c4856efb3de7bc15499c2dda4b953110e8f4","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":27,"context_line":"                                                         checkpoint.id)"},{"line_number":28,"context_line":"    except Exception:"},{"line_number":29,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","},{"line_number":30,"context_line":"                  checkpoint.id)"},{"line_number":31,"context_line":"    else:"},{"line_number":32,"context_line":"        checkpoint_.status \u003d status"},{"line_number":33,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_1c962af0","line":30,"range":{"start_line":29,"start_character":7,"end_line":30,"end_character":32},"updated":"2016-12-26 04:23:45.000000000","message":"In what cases would this happen? Why do we silently ignore this?","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"471e7184bd9a5b5c1a5b259f63bfde75389fd309","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":27,"context_line":"                                                         checkpoint.id)"},{"line_number":28,"context_line":"    except Exception:"},{"line_number":29,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","},{"line_number":30,"context_line":"                  checkpoint.id)"},{"line_number":31,"context_line":"    else:"},{"line_number":32,"context_line":"        checkpoint_.status \u003d status"},{"line_number":33,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_309f8fb5","line":30,"range":{"start_line":29,"start_character":7,"end_line":30,"end_character":32},"in_reply_to":"da4df55a_1c962af0","updated":"2016-12-26 07:14:46.000000000","message":"Nop, I think you are right about ignoring this.","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"9bc7c4856efb3de7bc15499c2dda4b953110e8f4","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def delete_checkpoint_db(context, checkpoint):"},{"line_number":40,"context_line":"    try:"},{"line_number":41,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":42,"context_line":"                                                         checkpoint.id)"},{"line_number":43,"context_line":"    except Exception:"},{"line_number":44,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_7ca3b64f","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":19},"updated":"2016-12-26 04:23:45.000000000","message":"ditto","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"471e7184bd9a5b5c1a5b259f63bfde75389fd309","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def delete_checkpoint_db(context, checkpoint):"},{"line_number":40,"context_line":"    try:"},{"line_number":41,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":42,"context_line":"                                                         checkpoint.id)"},{"line_number":43,"context_line":"    except Exception:"},{"line_number":44,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_d0bac322","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":19},"in_reply_to":"da4df55a_7ca3b64f","updated":"2016-12-26 07:14:46.000000000","message":"Done","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"d1d3f7536b12faa3b695bfd5bfd3ac4b50d21a0c","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        checkpoint_record.status \u003d status"},{"line_number":29,"context_line":"        checkpoint_record.save()"},{"line_number":30,"context_line":"    except Exception:"},{"line_number":31,"context_line":"        pass"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def delete_checkpoint_db(context, checkpoint):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_4300d001","line":31,"range":{"start_line":31,"start_character":8,"end_line":31,"end_character":12},"updated":"2017-03-09 03:14:39.000000000","message":"It is better to write some log.","commit_id":"1755e2898d06aa2dddabac18c552deda2f8217f9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"d1d3f7536b12faa3b695bfd5bfd3ac4b50d21a0c","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                                                               checkpoint.id)"},{"line_number":38,"context_line":"        checkpoint_record.destroy()"},{"line_number":39,"context_line":"    except Exception:"},{"line_number":40,"context_line":"        pass"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class InitiateDeleteTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_c314c045","line":40,"range":{"start_line":40,"start_character":8,"end_line":40,"end_character":12},"updated":"2017-03-09 03:14:39.000000000","message":"ditto","commit_id":"1755e2898d06aa2dddabac18c552deda2f8217f9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"d1d3f7536b12faa3b695bfd5bfd3ac4b50d21a0c","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        delete_flow,"},{"line_number":87,"context_line":"        InitiateDeleteTask(),"},{"line_number":88,"context_line":"        resources_task_flow,"},{"line_number":89,"context_line":"        CompleteDeleteTask(context),"},{"line_number":90,"context_line":"    )"},{"line_number":91,"context_line":"    flow_engine \u003d workflow_engine.get_engine(delete_flow, store\u003d{"},{"line_number":92,"context_line":"        \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_40328611","line":89,"range":{"start_line":89,"start_character":27,"end_line":89,"end_character":34},"updated":"2017-03-09 03:14:39.000000000","message":"Why do you add this parameter? According to the definition of \u0027Task\u0027, \u0027context\u0027 will be used as the name of that task, however obviously, it is not a good name.","commit_id":"1755e2898d06aa2dddabac18c552deda2f8217f9"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"5bc2ff1862f2e5d297a9b880e65e85dd089a7c4d","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def raise_unknown_exception(exception_instance):"},{"line_number":27,"context_line":"    LOG.exception(\u0027An unknown exception happened\u0027)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    value \u003d exception_instance.msg if isinstance("}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_e4da56e7","line":26,"range":{"start_line":26,"start_character":4,"end_line":26,"end_character":27},"updated":"2017-11-01 08:14:17.000000000","message":"What are unknown exceptions? How are they different from unexpected exceptions? Why and when would they pop up?","commit_id":"0c857086a7868b71c1ea3e0a3fa95b272467c69d"}],"karbor/services/protection/flows/protect.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"9bc7c4856efb3de7bc15499c2dda4b953110e8f4","unresolved":false,"context_lines":[{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def record_checkpoint_db(context, checkpoint):"},{"line_number":26,"context_line":"    checkpoint_dict \u003d checkpoint.to_dict()"},{"line_number":27,"context_line":"    extend_info \u003d checkpoint_dict.get(\u0027extend_info\u0027, None)"},{"line_number":28,"context_line":"    create_by \u003d (extend_info.get(\u0027create_by\u0027, None)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_9cdcdae5","line":25,"range":{"start_line":25,"start_character":4,"end_line":25,"end_character":24},"updated":"2016-12-26 04:23:45.000000000","message":"create_checkpoint_db","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"471e7184bd9a5b5c1a5b259f63bfde75389fd309","unresolved":false,"context_lines":[{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def record_checkpoint_db(context, checkpoint):"},{"line_number":26,"context_line":"    checkpoint_dict \u003d checkpoint.to_dict()"},{"line_number":27,"context_line":"    extend_info \u003d checkpoint_dict.get(\u0027extend_info\u0027, None)"},{"line_number":28,"context_line":"    create_by \u003d (extend_info.get(\u0027create_by\u0027, None)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_d54ab5c4","line":25,"range":{"start_line":25,"start_character":4,"end_line":25,"end_character":24},"in_reply_to":"da4df55a_9cdcdae5","updated":"2016-12-26 07:14:46.000000000","message":"Done","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"9bc7c4856efb3de7bc15499c2dda4b953110e8f4","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def update_checkpoint_db(context, checkpoint, status):"},{"line_number":46,"context_line":"    try:"},{"line_number":47,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":48,"context_line":"                                                         checkpoint.id)"},{"line_number":49,"context_line":"    except Exception:"},{"line_number":50,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_7c5e5677","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":19},"updated":"2016-12-26 04:23:45.000000000","message":"checkpoint_record or checkpoint_data","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"471e7184bd9a5b5c1a5b259f63bfde75389fd309","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def update_checkpoint_db(context, checkpoint, status):"},{"line_number":46,"context_line":"    try:"},{"line_number":47,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":48,"context_line":"                                                         checkpoint.id)"},{"line_number":49,"context_line":"    except Exception:"},{"line_number":50,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_15135db9","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":19},"in_reply_to":"da4df55a_7c5e5677","updated":"2016-12-26 07:14:46.000000000","message":"Done","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"9bc7c4856efb3de7bc15499c2dda4b953110e8f4","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":48,"context_line":"                                                         checkpoint.id)"},{"line_number":49,"context_line":"    except Exception:"},{"line_number":50,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","},{"line_number":51,"context_line":"                  checkpoint.id)"},{"line_number":52,"context_line":"    else:"},{"line_number":53,"context_line":"        checkpoint_.status \u003d status"},{"line_number":54,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_1c61ca39","line":51,"range":{"start_line":50,"start_character":0,"end_line":51,"end_character":32},"updated":"2016-12-26 04:23:45.000000000","message":"Should this even happen? Should we fallback to create?","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":21648,"name":"zhangshuai","email":"446077695@qq.com","username":"zhangshuai"},"change_message_id":"471e7184bd9a5b5c1a5b259f63bfde75389fd309","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        checkpoint_ \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":48,"context_line":"                                                         checkpoint.id)"},{"line_number":49,"context_line":"    except Exception:"},{"line_number":50,"context_line":"        LOG.debug(\"Failed to get checkpoint by checkpoint_id: %s\","},{"line_number":51,"context_line":"                  checkpoint.id)"},{"line_number":52,"context_line":"    else:"},{"line_number":53,"context_line":"        checkpoint_.status \u003d status"},{"line_number":54,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da4df55a_903bdbd0","line":51,"range":{"start_line":50,"start_character":0,"end_line":51,"end_character":32},"in_reply_to":"da4df55a_1c61ca39","updated":"2016-12-26 07:14:46.000000000","message":"Nop, I just want to print out debug information.","commit_id":"cbc66647a8e2cd8d1dddfcf4b3b47758c1fa3043"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"d1d3f7536b12faa3b695bfd5bfd3ac4b50d21a0c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    }"},{"line_number":39,"context_line":"    checkpoint_record \u003d objects.CheckpointRecord(context\u003dcontext,"},{"line_number":40,"context_line":"                                                 **checkpoint_properties)"},{"line_number":41,"context_line":"    checkpoint_record.create()"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def update_checkpoint_db(context, checkpoint, status):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_633b149d","line":41,"range":{"start_line":41,"start_character":4,"end_line":41,"end_character":30},"updated":"2017-03-09 03:14:39.000000000","message":"\u0027create\u0027 may fail. So in \u0027update_checkpoint_db\u0027, it will be failed to get the record. It is better to use \u0027try .. except\u0027 to wrap this function and write some log.","commit_id":"1755e2898d06aa2dddabac18c552deda2f8217f9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"d1d3f7536b12faa3b695bfd5bfd3ac4b50d21a0c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    try:"},{"line_number":46,"context_line":"        checkpoint_record \u003d objects.CheckpointRecord.get_by_id(context,"},{"line_number":47,"context_line":"                                                               checkpoint.id)"},{"line_number":48,"context_line":"        checkpoint_record.status \u003d status"},{"line_number":49,"context_line":"        checkpoint_record.save()"},{"line_number":50,"context_line":"    except Exception:"},{"line_number":51,"context_line":"        pass"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_a3ceecb1","line":49,"range":{"start_line":48,"start_character":0,"end_line":49,"end_character":32},"updated":"2017-03-09 03:14:39.000000000","message":"checkpoint_record maybe is None. So it is better to do that check before updating it.","commit_id":"1755e2898d06aa2dddabac18c552deda2f8217f9"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"d1d3f7536b12faa3b695bfd5bfd3ac4b50d21a0c","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        checkpoint_record.status \u003d status"},{"line_number":49,"context_line":"        checkpoint_record.save()"},{"line_number":50,"context_line":"    except Exception:"},{"line_number":51,"context_line":"        pass"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"class InitiateProtectTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_03c0987a","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":12},"updated":"2017-03-09 03:14:39.000000000","message":"It is better to write some log.","commit_id":"1755e2898d06aa2dddabac18c552deda2f8217f9"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"5bc2ff1862f2e5d297a9b880e65e85dd089a7c4d","unresolved":false,"context_lines":[{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def raise_unknown_exception(exception_instance):"},{"line_number":28,"context_line":"    LOG.exception(\u0027An unknown exception happened\u0027)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    value \u003d exception_instance.msg if isinstance("}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_44f36a74","line":27,"range":{"start_line":27,"start_character":4,"end_line":27,"end_character":27},"updated":"2017-11-01 08:14:17.000000000","message":"Why is this here again?","commit_id":"0c857086a7868b71c1ea3e0a3fa95b272467c69d"}]}
