)]}'
{"monasca_notification/common/repositories/orm/orm_repo.py":[{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a823b0e195a7735d83be2150473b31b9debd9d64","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            raise exc.DatabaseException(e)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def insert_notification_method_types(self, notification_types):"},{"line_number":92,"context_line":"        # This function can be called by multiple processes at same time."},{"line_number":93,"context_line":"        # In that case, only the first one will succeed and the others will fail."},{"line_number":94,"context_line":"        # We can ignore this error when the types have already been registered."},{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            with self._orm_engine.connect() as conn:"},{"line_number":97,"context_line":"                for notification_type in notification_types:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_871789a4","line":94,"range":{"start_line":92,"start_character":8,"end_line":94,"end_character":79},"updated":"2017-06-20 05:27:24.000000000","message":"It\u0027s better to split docstring and \u0027# NOTE(koji)\u0027.","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"b37cb1b088d56b7299820fdc92c8426809557f0d","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            raise exc.DatabaseException(e)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def insert_notification_method_types(self, notification_types):"},{"line_number":92,"context_line":"        # This function can be called by multiple processes at same time."},{"line_number":93,"context_line":"        # In that case, only the first one will succeed and the others will fail."},{"line_number":94,"context_line":"        # We can ignore this error when the types have already been registered."},{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            with self._orm_engine.connect() as conn:"},{"line_number":97,"context_line":"                for notification_type in notification_types:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_77341a4b","line":94,"range":{"start_line":92,"start_character":8,"end_line":94,"end_character":79},"in_reply_to":"7f231b9d_871789a4","updated":"2017-06-21 01:43:40.000000000","message":"At this moment, here is only note.\nI\u0027ll consider to add docstring to each function as another patch.","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"6cb472634595dff9267de19a8b199488e3c5229a","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    conn.execute(self._orm_add_notification_type, b_name\u003dnotification_type)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        except DatabaseError as e:"},{"line_number":101,"context_line":"            log.debug(\"Failed to insert notification types %s\", notification_types)"},{"line_number":102,"context_line":"            raise exc.DatabaseException(e)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def get_notification(self, notification_id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f201791_31f0d790","line":101,"range":{"start_line":101,"start_character":16,"end_line":101,"end_character":21},"updated":"2017-06-21 17:03:34.000000000","message":"It\u0027s better to keep \u0027exception\u0027 here.  Because \u0027exception\u0027 shows trace and it\u0027s useful for trouble shooting.","commit_id":"322d8d6fbb78fc2e28d3bc18db887fec3ebea204"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"00afe2ca72754b9768e64a6a57d6ef070c6e4360","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    conn.execute(self._orm_add_notification_type, b_name\u003dnotification_type)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        except DatabaseError as e:"},{"line_number":101,"context_line":"            log.debug(\"Failed to insert notification types %s\", notification_types)"},{"line_number":102,"context_line":"            raise exc.DatabaseException(e)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def get_notification(self, notification_id):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f201791_c10ae824","line":101,"range":{"start_line":101,"start_character":16,"end_line":101,"end_character":21},"in_reply_to":"5f201791_31f0d790","updated":"2017-06-22 00:04:51.000000000","message":"This function can fail even if this is called correctly.\nI don\u0027t think it\u0027s good for operators to see the error messages in the log file many times.\n\nThe error message and trace can be checked here.\nhttps://review.openstack.org/#/c/475632/5/monasca_notification/processors/notification_processor.py@60","commit_id":"322d8d6fbb78fc2e28d3bc18db887fec3ebea204"}],"monasca_notification/processors/notification_processor.py":[{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a823b0e195a7735d83be2150473b31b9debd9d64","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        configured_plugin_types \u003d notifiers.enabled_notifications()"},{"line_number":38,"context_line":"        persisted_plugin_types \u003d self._db_repo.fetch_notification_method_types()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        return set(configured_plugin_types) - set(persisted_plugin_types)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def insert_configured_plugins(self):"},{"line_number":43,"context_line":"        \"\"\"Persists configured plugin types in DB"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_277555cd","line":40,"range":{"start_line":40,"start_character":8,"end_line":40,"end_character":73},"updated":"2017-06-20 05:27:24.000000000","message":"A type of set() - set() should be \u0027set\u0027.  Shouldn\u0027t be \u0027list\u0027?  If so, you should cast as follows:\n\n  return  list(set(configured_plugin_types) - set(persisted_plugin_types))","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"b37cb1b088d56b7299820fdc92c8426809557f0d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        configured_plugin_types \u003d notifiers.enabled_notifications()"},{"line_number":38,"context_line":"        persisted_plugin_types \u003d self._db_repo.fetch_notification_method_types()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        return set(configured_plugin_types) - set(persisted_plugin_types)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def insert_configured_plugins(self):"},{"line_number":43,"context_line":"        \"\"\"Persists configured plugin types in DB"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_ac35c5f9","line":40,"range":{"start_line":40,"start_character":8,"end_line":40,"end_character":73},"in_reply_to":"7f231b9d_277555cd","updated":"2017-06-21 01:43:40.000000000","message":"The type should not be duplicated here, so I think \"set\" is suitable.","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a823b0e195a7735d83be2150473b31b9debd9d64","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            except exc.DatabaseException as e:"},{"line_number":57,"context_line":"                # There is a possibility the other process has already registered the type."},{"line_number":58,"context_line":"                remaining_plugin_types \u003d self._remaining_plugin_types()"},{"line_number":59,"context_line":"                if remaining_plugin_types and retry_count \u003e\u003d max_retry:"},{"line_number":60,"context_line":"                    log.exception(\"Couldn\u0027t insert notification types %s\", e)"},{"line_number":61,"context_line":"                    raise e"},{"line_number":62,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_e774fd00","line":59,"range":{"start_line":59,"start_character":19,"end_line":59,"end_character":70},"updated":"2017-06-20 05:27:24.000000000","message":"You mean as follows? It\u0027s better to read to adding \"(\", \")\".\n\n* remaining_plugin_types and (retry_count \u003e\u003d max_retry)","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"b37cb1b088d56b7299820fdc92c8426809557f0d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            except exc.DatabaseException as e:"},{"line_number":57,"context_line":"                # There is a possibility the other process has already registered the type."},{"line_number":58,"context_line":"                remaining_plugin_types \u003d self._remaining_plugin_types()"},{"line_number":59,"context_line":"                if remaining_plugin_types and retry_count \u003e\u003d max_retry:"},{"line_number":60,"context_line":"                    log.exception(\"Couldn\u0027t insert notification types %s\", e)"},{"line_number":61,"context_line":"                    raise e"},{"line_number":62,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_ac670526","line":59,"range":{"start_line":59,"start_character":19,"end_line":59,"end_character":70},"in_reply_to":"7f231b9d_e774fd00","updated":"2017-06-21 01:43:40.000000000","message":"Done","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"6cb472634595dff9267de19a8b199488e3c5229a","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        while remaining_plugin_types:"},{"line_number":51,"context_line":"            retry_count \u003d retry_count + 1"},{"line_number":52,"context_line":"            try:"},{"line_number":53,"context_line":"                log.info(\"New plugins detected: Adding new notification types {} to database\""},{"line_number":54,"context_line":"                         .format(remaining_plugin_types))"},{"line_number":55,"context_line":"                self._db_repo.insert_notification_method_types(remaining_plugin_types)"},{"line_number":56,"context_line":"            except exc.DatabaseException as e:"},{"line_number":57,"context_line":"                # There is a possibility the other process has already registered the type."}],"source_content_type":"text/x-python","patch_set":5,"id":"5f201791_f11edf6e","line":54,"range":{"start_line":53,"start_character":16,"end_line":54,"end_character":57},"updated":"2017-06-21 17:03:34.000000000","message":"\u0027.format()\u0027 or \"% {\u0027foo\u0027: foo, \u0027bar\u0027: bar}\" is better to use when multiple arguments exist.  In this case, only 1 argument.  What about specify as follows?\n\n  log.info(\"xxxxxx %s to database\", remaining_plugin_types)","commit_id":"322d8d6fbb78fc2e28d3bc18db887fec3ebea204"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"00afe2ca72754b9768e64a6a57d6ef070c6e4360","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        while remaining_plugin_types:"},{"line_number":51,"context_line":"            retry_count \u003d retry_count + 1"},{"line_number":52,"context_line":"            try:"},{"line_number":53,"context_line":"                log.info(\"New plugins detected: Adding new notification types {} to database\""},{"line_number":54,"context_line":"                         .format(remaining_plugin_types))"},{"line_number":55,"context_line":"                self._db_repo.insert_notification_method_types(remaining_plugin_types)"},{"line_number":56,"context_line":"            except exc.DatabaseException as e:"},{"line_number":57,"context_line":"                # There is a possibility the other process has already registered the type."}],"source_content_type":"text/x-python","patch_set":5,"id":"5f201791_7c197b77","line":54,"range":{"start_line":53,"start_character":16,"end_line":54,"end_character":57},"in_reply_to":"5f201791_f11edf6e","updated":"2017-06-22 00:04:51.000000000","message":"Done","commit_id":"322d8d6fbb78fc2e28d3bc18db887fec3ebea204"}],"tests/test_orm_repo.py":[{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a823b0e195a7735d83be2150473b31b9debd9d64","unresolved":false,"context_lines":[{"line_number":19,"context_line":"    @mock.patch(\u0027monasca_notification.common.repositories.orm.orm_repo.engine_from_config\u0027)"},{"line_number":20,"context_line":"    def setUp(self, mock_sql_engine_from_config):"},{"line_number":21,"context_line":"        super(TestOrmRepo, self).setUp()"},{"line_number":22,"context_line":"        config \u003d {\u0027database\u0027: "},{"line_number":23,"context_line":"                     {\u0027orm\u0027: "},{"line_number":24,"context_line":"                         {\u0027url\u0027: \u0027mysql+pymysql://user:password@hostname:3306/mon\u0027}}}"},{"line_number":25,"context_line":"        self._rep \u003d orm_repo.OrmRepo(config)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_a7c5e50c","line":22,"range":{"start_line":22,"start_character":29,"end_line":22,"end_character":30},"updated":"2017-06-20 05:27:24.000000000","message":"whitespace","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"b37cb1b088d56b7299820fdc92c8426809557f0d","unresolved":false,"context_lines":[{"line_number":19,"context_line":"    @mock.patch(\u0027monasca_notification.common.repositories.orm.orm_repo.engine_from_config\u0027)"},{"line_number":20,"context_line":"    def setUp(self, mock_sql_engine_from_config):"},{"line_number":21,"context_line":"        super(TestOrmRepo, self).setUp()"},{"line_number":22,"context_line":"        config \u003d {\u0027database\u0027: "},{"line_number":23,"context_line":"                     {\u0027orm\u0027: "},{"line_number":24,"context_line":"                         {\u0027url\u0027: \u0027mysql+pymysql://user:password@hostname:3306/mon\u0027}}}"},{"line_number":25,"context_line":"        self._rep \u003d orm_repo.OrmRepo(config)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_6c3fadd6","line":22,"range":{"start_line":22,"start_character":29,"end_line":22,"end_character":30},"in_reply_to":"7f231b9d_a7c5e50c","updated":"2017-06-21 01:43:40.000000000","message":"Done","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a823b0e195a7735d83be2150473b31b9debd9d64","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        self._rep.insert_notification_method_types(notification_types)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        self.assertEqual(self.mock_conn.execute.call_args_list[0][0],"},{"line_number":85,"context_line":"                         (self._rep._orm_add_notification_type,))"},{"line_number":86,"context_line":"        self.assertEqual(self.mock_conn.execute.call_args_list[0][1],"},{"line_number":87,"context_line":"                         {\u0027b_name\u0027: \u0027SLACK\u0027})"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_c299ef79","line":84,"range":{"start_line":84,"start_character":48,"end_line":84,"end_character":62},"updated":"2017-06-20 05:27:24.000000000","message":"call_args_list stores all of arguments for the method.  You\u0027d like to compare with 1st argument when called first time, wouldn\u0027t you?  If so, you should refer call_args_list[0][0][0].","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"b37cb1b088d56b7299820fdc92c8426809557f0d","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        self._rep.insert_notification_method_types(notification_types)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        self.assertEqual(self.mock_conn.execute.call_args_list[0][0],"},{"line_number":85,"context_line":"                         (self._rep._orm_add_notification_type,))"},{"line_number":86,"context_line":"        self.assertEqual(self.mock_conn.execute.call_args_list[0][1],"},{"line_number":87,"context_line":"                         {\u0027b_name\u0027: \u0027SLACK\u0027})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_4c24f1c6","line":84,"range":{"start_line":84,"start_character":48,"end_line":84,"end_character":62},"in_reply_to":"7f231b9d_c299ef79","updated":"2017-06-21 01:43:40.000000000","message":"Done","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"a823b0e195a7735d83be2150473b31b9debd9d64","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_get_notification_success(self):"},{"line_number":90,"context_line":"        notification_id \u003d \u0027notification-123\u0027"},{"line_number":91,"context_line":"        self.mock_conn.execute.return_value.fetchone.return_value \u003d \\"},{"line_number":92,"context_line":"            [\u0027notification-123\u0027,"},{"line_number":93,"context_line":"             \u0027email\u0027,"},{"line_number":94,"context_line":"             \u0027notification-name\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f231b9d_42b95fe7","line":91,"updated":"2017-06-20 05:27:24.000000000","message":"expect \u003d [\n    \u0027notification-123\u0027,\n    \u0027email\u0027,\n    \u0027notification-name\u0027,\n    \u0027testaddress\u0027,\n    0\n]\nself.mock_conn.execute.return_value.fetchone.return_value \u003d expect\nself.assertEqual(expect, self._rep.get_notification(notification_id)","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"},{"author":{"_account_id":17331,"name":"Koji Nakazono","email":"nakazono_0507@jp.fujitsu.com","username":"Koji_Nakazono"},"change_message_id":"b37cb1b088d56b7299820fdc92c8426809557f0d","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_get_notification_success(self):"},{"line_number":90,"context_line":"        notification_id \u003d \u0027notification-123\u0027"},{"line_number":91,"context_line":"        self.mock_conn.execute.return_value.fetchone.return_value \u003d \\"},{"line_number":92,"context_line":"            [\u0027notification-123\u0027,"},{"line_number":93,"context_line":"             \u0027email\u0027,"},{"line_number":94,"context_line":"             \u0027notification-name\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_0c2ef9a4","line":91,"in_reply_to":"7f231b9d_42b95fe7","updated":"2017-06-21 01:43:40.000000000","message":"Done","commit_id":"6afb02de81e9e176cc7fb977d3859844d6909807"}]}
