)]}'
{"masakari/cmd/manage.py":[{"author":{"_account_id":8988,"name":"Rikimaru Honjo","email":"honjo.rikimaru@ntt-tx.co.jp","username":"rikimaru.honjo","inactive":true},"change_message_id":"2c5364ba71c8bf171b25a6aef5e9d15f226e84d2","unresolved":false,"context_lines":[{"line_number":87,"context_line":"          help\u003d\u0027Limit number of records to delete.(default: %(default)d)\u0027)"},{"line_number":88,"context_line":"    def purge(self, age_in_days, max_rows):"},{"line_number":89,"context_line":"        \"\"\"Purge deleted rows older than a given age from notifications"},{"line_number":90,"context_line":"        tables."},{"line_number":91,"context_line":"        \"\"\""},{"line_number":92,"context_line":"        # check max_rows for its maximum limit"},{"line_number":93,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"df3967d1_93cb2052","line":90,"updated":"2017-07-31 09:38:36.000000000","message":"I think that this comment has two problems.\n\n1. This method will purge hosts table and segments table, too.\n2. Records of notifications table won\u0027t be deleted.","commit_id":"c6db28bde804c4927d859eafa234aa7ab680acea"},{"author":{"_account_id":8988,"name":"Rikimaru Honjo","email":"honjo.rikimaru@ntt-tx.co.jp","username":"rikimaru.honjo","inactive":true},"change_message_id":"2618ada7421149a62bc4ca812d27d20fe9dccbef","unresolved":false,"context_lines":[{"line_number":87,"context_line":"          help\u003d\u0027Limit number of records to delete.(default: %(default)d)\u0027)"},{"line_number":88,"context_line":"    def purge(self, age_in_days, max_rows):"},{"line_number":89,"context_line":"        \"\"\"Purge deleted rows older than a given age from notifications"},{"line_number":90,"context_line":"        tables."},{"line_number":91,"context_line":"        \"\"\""},{"line_number":92,"context_line":"        # check max_rows for its maximum limit"},{"line_number":93,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_77241fc7","line":90,"in_reply_to":"9f436f4f_257666a6","updated":"2017-08-09 07:32:53.000000000","message":"No, I want you to improve only this comment strings.\nImplementation is good.\n\nMy wishes are...\n\n1.\nPurging feature will purge deleted rows from not only notifications table but also hosts and segments tables.\nBut this comment strings aren\u0027t written about it.\nI want you to write about it.\n\n2.\nThis comment is written as \"Purge deleted rows older than a given age from notifications tables.\".\nHowever, notifications records won\u0027t be deleted.\nStatuses of notifications will be only changed to any of the following:\n\"finished\" or \"failed\" or \"ignore\"\n\nBelow is a my example about improvement of this comment.\n\nPurge deleted rows older than a given age from hosts table and segments table.\nAnd, purge rows which are specific statuses from notifications table, too.\nThe targeted statuses of purging are \"finished\" or \"failed\" or \"ignore\".","commit_id":"c6db28bde804c4927d859eafa234aa7ab680acea"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"570814db1c081f3de45348905f7149f039ee6631","unresolved":false,"context_lines":[{"line_number":87,"context_line":"          help\u003d\u0027Limit number of records to delete.(default: %(default)d)\u0027)"},{"line_number":88,"context_line":"    def purge(self, age_in_days, max_rows):"},{"line_number":89,"context_line":"        \"\"\"Purge deleted rows older than a given age from notifications"},{"line_number":90,"context_line":"        tables."},{"line_number":91,"context_line":"        \"\"\""},{"line_number":92,"context_line":"        # check max_rows for its maximum limit"},{"line_number":93,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_257666a6","line":90,"in_reply_to":"df3967d1_93cb2052","updated":"2017-08-09 04:49:13.000000000","message":"Are you suggesting that if host or failover segment is deleted, then all notifications irrespective of it\u0027s status for that particular host or failover segment should be deleted from the notifications db table?","commit_id":"c6db28bde804c4927d859eafa234aa7ab680acea"},{"author":{"_account_id":8988,"name":"Rikimaru Honjo","email":"honjo.rikimaru@ntt-tx.co.jp","username":"rikimaru.honjo","inactive":true},"change_message_id":"2c5364ba71c8bf171b25a6aef5e9d15f226e84d2","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        \"\"\""},{"line_number":92,"context_line":"        # check max_rows for its maximum limit"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            MAX_INT \u003d (2 ** 31) - 1"},{"line_number":95,"context_line":"            max_rows \u003d utils.validate_integer("},{"line_number":96,"context_line":"                max_rows, \u0027max_rows\u0027, None, MAX_INT)"},{"line_number":97,"context_line":"        except exception.Invalid as exc:"}],"source_content_type":"text/x-python","patch_set":2,"id":"df3967d1_d67d166f","line":94,"updated":"2017-07-31 09:38:36.000000000","message":"Could you write the reason of this calculation?\n\nIn my understanding, this limitation is introduced because databases stores INT in 4 bytes.","commit_id":"c6db28bde804c4927d859eafa234aa7ab680acea"},{"author":{"_account_id":8988,"name":"Rikimaru Honjo","email":"honjo.rikimaru@ntt-tx.co.jp","username":"rikimaru.honjo","inactive":true},"change_message_id":"2c5364ba71c8bf171b25a6aef5e9d15f226e84d2","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            max_rows \u003d utils.validate_integer("},{"line_number":96,"context_line":"                max_rows, \u0027max_rows\u0027, None, MAX_INT)"},{"line_number":97,"context_line":"        except exception.Invalid as exc:"},{"line_number":98,"context_line":"            sys.exit(exc.message)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        if age_in_days \u003c 0:"},{"line_number":101,"context_line":"            sys.exit(_(\"Must supply a non-negative value for age.\"))"}],"source_content_type":"text/x-python","patch_set":2,"id":"df3967d1_56bfe6fa","line":98,"updated":"2017-07-31 09:38:36.000000000","message":"message attribute will be deprecated.\n\nrefs:\nhttps://review.openstack.org/#/c/486576/","commit_id":"c6db28bde804c4927d859eafa234aa7ab680acea"},{"author":{"_account_id":8988,"name":"Rikimaru Honjo","email":"honjo.rikimaru@ntt-tx.co.jp","username":"rikimaru.honjo","inactive":true},"change_message_id":"2c5364ba71c8bf171b25a6aef5e9d15f226e84d2","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        try:"},{"line_number":107,"context_line":"            db_api.purge_deleted_rows(ctx, age_in_days, max_rows)"},{"line_number":108,"context_line":"        except exception.Invalid as exc:"},{"line_number":109,"context_line":"            sys.exit(exc.message)"},{"line_number":110,"context_line":"        except db_exc.DBReferenceError:"},{"line_number":111,"context_line":"            sys.exit(_(\"Purge command failed, check masakari-manage\""},{"line_number":112,"context_line":"                       \" logs for more details.\"))"}],"source_content_type":"text/x-python","patch_set":2,"id":"df3967d1_f63b7a99","line":109,"updated":"2017-07-31 09:38:36.000000000","message":"ditto","commit_id":"c6db28bde804c4927d859eafa234aa7ab680acea"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                                   db_migration.INIT_VERSION))"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    @args(\u0027--age_in_days\u0027, type\u003dint, default\u003d30,"},{"line_number":86,"context_line":"          help\u003d\u0027Purge deleted rows older than age in days.\u0027"},{"line_number":87,"context_line":"               \u0027(default: %(default)d)\u0027)"},{"line_number":88,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, default\u003d-1,"},{"line_number":89,"context_line":"          help\u003d\u0027Limit number of records to delete.(default: %(default)d)\u0027)"},{"line_number":90,"context_line":"    def purge(self, age_in_days, max_rows):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_9ada0de7","line":87,"range":{"start_line":86,"start_character":16,"end_line":87,"end_character":38},"updated":"2017-08-14 03:50:14.000000000","message":"Remove the period after days.\n\n\"Purge deleted rows older than age in days (default: %(default)d)\"","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":86,"context_line":"          help\u003d\u0027Purge deleted rows older than age in days.\u0027"},{"line_number":87,"context_line":"               \u0027(default: %(default)d)\u0027)"},{"line_number":88,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, default\u003d-1,"},{"line_number":89,"context_line":"          help\u003d\u0027Limit number of records to delete.(default: %(default)d)\u0027)"},{"line_number":90,"context_line":"    def purge(self, age_in_days, max_rows):"},{"line_number":91,"context_line":"        \"\"\"Purge deleted rows older than a given age from masakari tables."},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_5ae4a5ac","line":89,"range":{"start_line":89,"start_character":16,"end_line":89,"end_character":72},"updated":"2017-08-14 03:50:14.000000000","message":"Remove the period after delete.\n\n\"Limit number of records to delete (default: %(default)d)\"","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def purge(self, age_in_days, max_rows):"},{"line_number":91,"context_line":"        \"\"\"Purge deleted rows older than a given age from masakari tables."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        Deleted rows get purged from hosts and segment tables based on"},{"line_number":94,"context_line":"        deleted_at column, and rows get purged from notifications based"},{"line_number":95,"context_line":"        on last updated_at and status column."},{"line_number":96,"context_line":"        \"\"\""},{"line_number":97,"context_line":"        # Using db.MAX_INT to check max_rows for its maximum limit"},{"line_number":98,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_341b351c","line":95,"range":{"start_line":93,"start_character":8,"end_line":95,"end_character":45},"updated":"2017-08-14 03:50:14.000000000","message":"Please add this comment in sqlalchemy/api.py in purge_deleted_rows method.\nAlso, add a proper comment to explain why you are considering updated_at column for deleting rows from notification table.","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        deleted_at column, and rows get purged from notifications based"},{"line_number":95,"context_line":"        on last updated_at and status column."},{"line_number":96,"context_line":"        \"\"\""},{"line_number":97,"context_line":"        # Using db.MAX_INT to check max_rows for its maximum limit"},{"line_number":98,"context_line":"        try:"},{"line_number":99,"context_line":"            max_rows \u003d utils.validate_integer("},{"line_number":100,"context_line":"                max_rows, \u0027max_rows\u0027, None, db.MAX_INT)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_baeef185","line":97,"range":{"start_line":97,"start_character":8,"end_line":97,"end_character":66},"updated":"2017-08-14 03:50:14.000000000","message":"Remove this comment, The code is self explanatory.","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        # Using db.MAX_INT to check max_rows for its maximum limit"},{"line_number":98,"context_line":"        try:"},{"line_number":99,"context_line":"            max_rows \u003d utils.validate_integer("},{"line_number":100,"context_line":"                max_rows, \u0027max_rows\u0027, None, db.MAX_INT)"},{"line_number":101,"context_line":"        except exception.Invalid as exc:"},{"line_number":102,"context_line":"            sys.exit(six.text_type(exc))"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_f4b7edd7","line":100,"range":{"start_line":100,"start_character":38,"end_line":100,"end_character":42},"updated":"2017-08-14 03:50:14.000000000","message":"What if user passes max_rows as 0?\nIMO, you are considering 0 and -1 the same.\n\n-1, means, there is no restrictions on the count of records to be deleted from all db tables.\n\n0, shouldn\u0027t be allowed, But you are allowing it and you are treating 0 and -1 the same. This is incorrect.\n\nvalid values should be -1 or \u003e 0 but less \u003c db.MAX_INT.","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":26991,"name":"Louie Kwan","email":"louie.kwan@windriver.com","username":"lkwan"},"change_message_id":"d25808034a4a5374868946e6cd2d69152c96521d","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    @args(\u0027--age_in_days\u0027, type\u003dint, default\u003d30,"},{"line_number":85,"context_line":"          help\u003d\u0027Purge deleted rows older than age in days (default: \u0027"},{"line_number":86,"context_line":"               \u0027%(default)d)\u0027)"},{"line_number":87,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, default\u003d-1,"},{"line_number":88,"context_line":"          help\u003d\u0027Limit number of records to delete (default: %(default)d)\u0027)"},{"line_number":89,"context_line":"    def purge(self, age_in_days, max_rows):"},{"line_number":90,"context_line":"        \"\"\"Purge rows older than a given age from masakari tables.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_37004002","line":87,"updated":"2018-04-13 13:40:35.000000000","message":"comparing with line 183, should the max rows is zero instead?","commit_id":"7134d99a9765add1b08484492c434e060f84f618"},{"author":{"_account_id":24645,"name":"Pooja Jadhav","email":"pooja.jadhav@nttdata.com","username":"poojajadhav"},"change_message_id":"2e30f1b3f2b25d11e38dc1b2ceb73d1ea5604bb0","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    @args(\u0027--age_in_days\u0027, type\u003dint, default\u003d30,"},{"line_number":85,"context_line":"          help\u003d\u0027Purge deleted rows older than age in days (default: \u0027"},{"line_number":86,"context_line":"               \u0027%(default)d)\u0027)"},{"line_number":87,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, default\u003d-1,"},{"line_number":88,"context_line":"          help\u003d\u0027Limit number of records to delete (default: %(default)d)\u0027)"},{"line_number":89,"context_line":"    def purge(self, age_in_days, max_rows):"},{"line_number":90,"context_line":"        \"\"\"Purge rows older than a given age from masakari tables.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f6a8fd7_bfe13601","line":87,"in_reply_to":"bf659307_37004002","updated":"2018-04-17 07:45:34.000000000","message":"Hi Louie Kwan\n\nThanks for review,\n\nwhen max_rows \u003d -1 then all deleted rows will get purge older than given age_in_days.\n\nmax_rows \u003d 0, considered as invalid value.","commit_id":"7134d99a9765add1b08484492c434e060f84f618"}],"masakari/db/api.py":[{"author":{"_account_id":26991,"name":"Louie Kwan","email":"louie.kwan@windriver.com","username":"lkwan"},"change_message_id":"d25808034a4a5374868946e6cd2d69152c96521d","unresolved":false,"context_lines":[{"line_number":365,"context_line":""},{"line_number":366,"context_line":"def purge_deleted_rows(context, age_in_days, max_rows):"},{"line_number":367,"context_line":"    \"\"\"Purge the soft deleted rows."},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    Purge deleted rows older than a given age from db tables."},{"line_number":370,"context_line":"    \"\"\""},{"line_number":371,"context_line":"    return IMPL.purge_deleted_rows(context, age_in_days, max_rows)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_094f246b","line":368,"updated":"2018-04-13 13:40:35.000000000","message":"please comment on the parameters as well.\ne.g.\n    :param context: context to query under","commit_id":"7134d99a9765add1b08484492c434e060f84f618"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"ee8e8556af5e79ec71306ab6ca7ca523955e0f97","unresolved":false,"context_lines":[{"line_number":370,"context_line":"    :param age_in_days: Purge deleted rows older than age in days"},{"line_number":371,"context_line":"    :param max_rows: Limit number of records to delete"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    :returns: total number of deleted rows"},{"line_number":374,"context_line":"    \"\"\""},{"line_number":375,"context_line":"    return IMPL.purge_deleted_rows(context, age_in_days, max_rows)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f6a8fd7_c863f619","line":373,"range":{"start_line":373,"start_character":4,"end_line":373,"end_character":42},"updated":"2018-04-18 07:31:09.000000000","message":"You are not returning total deleted rows from the IMPL.purge_deleted_rows method. But since you are logging total deleted rows in IMPL.purge_deleted_rows method you don\u0027t need to return any value from this method.\n\nPlease remove this returns line.","commit_id":"af9821ad582a0d5e349761e429b88a742c0c0f06"}],"masakari/db/sqlalchemy/api.py":[{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":653,"context_line":"    metadata \u003d MetaData()"},{"line_number":654,"context_line":"    metadata.reflect(engine)"},{"line_number":655,"context_line":"    deleted_age \u003d timeutils.utcnow() - datetime.timedelta(days\u003dage_in_days)"},{"line_number":656,"context_line":"    total_rows_archived \u003d 0"},{"line_number":657,"context_line":"    current_max_rows \u003d max_rows"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    for table in reversed(metadata.sorted_tables):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_ba755e34","line":656,"range":{"start_line":656,"start_character":4,"end_line":656,"end_character":23},"updated":"2017-08-14 03:50:14.000000000","message":"Rename this local variable to total_rows_purged.","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":680,"context_line":"                deleted_at_column)"},{"line_number":681,"context_line":""},{"line_number":682,"context_line":"        if max_rows \u003e 0:"},{"line_number":683,"context_line":"            query_delete \u003d query_delete.limit(current_max_rows)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        delete_statement \u003d DeleteFromSelect(table, query_delete, column)"},{"line_number":686,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_c6b05246","line":683,"range":{"start_line":683,"start_character":46,"end_line":683,"end_character":62},"updated":"2017-08-14 03:50:14.000000000","message":"I think you can avoid creating \u0027current_max_rows\u0027 local variable.\n\nquery.delete.limit(max_rows - total_rows_archived)","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"529b56c748f14cb1511662e92a9116426b3f16fc","unresolved":false,"context_lines":[{"line_number":704,"context_line":"                 {\u0027rows\u0027: rows, \u0027tbl\u0027: table})"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"        total_rows_purged +\u003d rows"},{"line_number":707,"context_line":"        if total_rows_purged \u003d\u003d max_rows:"},{"line_number":708,"context_line":"            break"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_b47862f8","line":707,"range":{"start_line":707,"start_character":32,"end_line":707,"end_character":40},"updated":"2017-09-22 07:11:44.000000000","message":"If max_rows is -1, then this condition won\u0027t exit which is correct but still it doesn\u0027t make sense to check for total_rows_purged when max_rows\u003d-1.","commit_id":"31cf4a453443d909d34f2aed4b2aa4b90cece29f"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f4ff26687dbdd44550f4758b565f7c1dc649859a","unresolved":false,"context_lines":[{"line_number":657,"context_line":"    the notification records so rows get purged from notifications"},{"line_number":658,"context_line":"    based on last updated_at and status column."},{"line_number":659,"context_line":"    \"\"\""},{"line_number":660,"context_line":"    try:"},{"line_number":661,"context_line":"        age_in_days \u003d int(age_in_days)"},{"line_number":662,"context_line":"    except ValueError:"},{"line_number":663,"context_line":"        msg \u003d \u0027Invalid value for age, %(age)s\u0027 % {\u0027age\u0027: age_in_days}"},{"line_number":664,"context_line":"        LOG.exception(msg)"},{"line_number":665,"context_line":"        raise exception.InvalidInput(msg)"},{"line_number":666,"context_line":"    engine \u003d get_engine()"},{"line_number":667,"context_line":"    conn \u003d engine.connect()"},{"line_number":668,"context_line":"    metadata \u003d MetaData()"}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_e981414c","line":665,"range":{"start_line":660,"start_character":4,"end_line":665,"end_character":41},"updated":"2018-04-06 04:55:51.000000000","message":"You accept age_in_days in type integer [1] so you don\u0027t need to convert it to int again.\n\n[1]:https://review.openstack.org/#/c/487430/5/masakari/cmd/manage.py #line 85","commit_id":"1c9323afea02fe2666f192dba4688b77fcfa5e4f"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"b033537deed02ce50d2e845742771b33d5e3917b","unresolved":false,"context_lines":[{"line_number":657,"context_line":"    the notification records so rows get purged from notifications"},{"line_number":658,"context_line":"    based on last updated_at and status column."},{"line_number":659,"context_line":"    \"\"\""},{"line_number":660,"context_line":"    try:"},{"line_number":661,"context_line":"        age_in_days \u003d int(age_in_days)"},{"line_number":662,"context_line":"    except ValueError:"},{"line_number":663,"context_line":"        msg \u003d \u0027Invalid value for age, %(age)s\u0027 % {\u0027age\u0027: age_in_days}"},{"line_number":664,"context_line":"        LOG.exception(msg)"},{"line_number":665,"context_line":"        raise exception.InvalidInput(msg)"},{"line_number":666,"context_line":"    engine \u003d get_engine()"},{"line_number":667,"context_line":"    conn \u003d engine.connect()"},{"line_number":668,"context_line":"    metadata \u003d MetaData()"}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_5bf8307b","line":665,"range":{"start_line":660,"start_character":4,"end_line":665,"end_character":41},"in_reply_to":"bf659307_e981414c","updated":"2018-04-06 06:34:57.000000000","message":"I have confirmed age_in_days can be passed in string as well. \n\nfor example\n-- age_in_days. \"30\"\n\nSo you can convert age_in_days from string to int in manage.py before passing it to this method.","commit_id":"1c9323afea02fe2666f192dba4688b77fcfa5e4f"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"eb81e3b8d6d6c94748e102015550788ba91a10f8","unresolved":false,"context_lines":[{"line_number":647,"context_line":""},{"line_number":648,"context_line":"@oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":649,"context_line":"@main_context_manager.writer"},{"line_number":650,"context_line":"def purge_deleted_rows(context, age_in_days, max_rows):"},{"line_number":651,"context_line":"    \"\"\"Purges soft deleted rows"},{"line_number":652,"context_line":""},{"line_number":653,"context_line":"    Deleted rows get purged from hosts and segment tables based on"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f6a8fd7_721e750d","line":650,"range":{"start_line":650,"start_character":4,"end_line":650,"end_character":22},"updated":"2018-04-17 08:21:21.000000000","message":"This method should return total purged rows as mentioned in https://review.openstack.org/#/c/487430/8/masakari/db/api.py@373.","commit_id":"8f68499dac7ebc245263abee9373fd58ea079546"},{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"8a134c84fc7384d1534055944b7b46d462c8f08b","unresolved":false,"context_lines":[{"line_number":647,"context_line":""},{"line_number":648,"context_line":"@oslo_db_api.wrap_db_retry(max_retries\u003d5, retry_on_deadlock\u003dTrue)"},{"line_number":649,"context_line":"@main_context_manager.writer"},{"line_number":650,"context_line":"def purge_deleted_rows(context, age_in_days, max_rows):"},{"line_number":651,"context_line":"    \"\"\"Purges soft deleted rows"},{"line_number":652,"context_line":""},{"line_number":653,"context_line":"    Deleted rows get purged from hosts and segment tables based on"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f6a8fd7_d261813b","line":650,"range":{"start_line":650,"start_character":4,"end_line":650,"end_character":22},"in_reply_to":"9f6a8fd7_721e750d","updated":"2018-04-17 08:30:43.000000000","message":"If  max_rows is -1, there is no way to tell operator how many records were deleted. \nyou can do following two things:-\n\n1. Return total purged rows from this method\n\n2. Add log message after iterating all tables to log total purged records","commit_id":"8f68499dac7ebc245263abee9373fd58ea079546"}],"masakari/hacking/checks.py":[{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f4ff26687dbdd44550f4758b565f7c1dc649859a","unresolved":false,"context_lines":[{"line_number":320,"context_line":"    # all options that were impossible to move without doing a major impact"},{"line_number":321,"context_line":"    # on code. Add full path to a module or folder."},{"line_number":322,"context_line":"    conf_exceptions \u003d ["},{"line_number":323,"context_line":"        # CLI opts are allowed to be outside of nova/conf directory"},{"line_number":324,"context_line":"        \u0027masakari/cmd/manage.py\u0027,"},{"line_number":325,"context_line":"    ]"},{"line_number":326,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_49be2d00","line":323,"range":{"start_line":323,"start_character":48,"end_line":323,"end_character":52},"updated":"2018-04-06 04:55:51.000000000","message":"masakari","commit_id":"1c9323afea02fe2666f192dba4688b77fcfa5e4f"}],"masakari/tests/unit/db/test_purge.py":[{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f4ff26687dbdd44550f4758b565f7c1dc649859a","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from masakari import test"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class PurgeDeletedTest(test.TestCase):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def setUp(self):"},{"line_number":34,"context_line":"        super(PurgeDeletedTest, self).setUp()"}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_290979dc","line":31,"range":{"start_line":31,"start_character":6,"end_line":31,"end_character":22},"updated":"2018-04-06 04:55:51.000000000","message":"Also add one unit test to purge all records i.e. max_rows\u003d-1.","commit_id":"1c9323afea02fe2666f192dba4688b77fcfa5e4f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6a608703b490ec8d2c73d58f878533825264b162","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 NTT DATA"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_4bec37ba","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"updated":"2018-04-13 10:28:49.000000000","message":"2018?","commit_id":"7134d99a9765add1b08484492c434e060f84f618"},{"author":{"_account_id":24645,"name":"Pooja Jadhav","email":"pooja.jadhav@nttdata.com","username":"poojajadhav"},"change_message_id":"2e30f1b3f2b25d11e38dc1b2ceb73d1ea5604bb0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 NTT DATA"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f6a8fd7_3fbc4604","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"in_reply_to":"bf659307_4bec37ba","updated":"2018-04-17 07:45:34.000000000","message":"Since this patch is proposed in 2017, So haven\u0027t made changes to this year.","commit_id":"7134d99a9765add1b08484492c434e060f84f618"}],"masakari/tests/unit/test_masakari_manage.py":[{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"f704d637f4364105d8541fa936a519f1aa7771ac","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self.assertEqual(expected, ex.code)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @mock.patch(\u0027masakari.db.sqlalchemy.api.purge_deleted_rows\u0027)"},{"line_number":62,"context_line":"    def test_purge_command_fk_constraint_failure(self, purge_deleted_rows):"},{"line_number":63,"context_line":"        purge_deleted_rows.side_effect \u003d db_exception.DBReferenceError("},{"line_number":64,"context_line":"            \u0027fake_table\u0027, \u0027fake_constraint\u0027, \u0027fake_key\u0027, \u0027fake_key_table\u0027)"},{"line_number":65,"context_line":"        exit \u003d self.assertRaises(SystemExit, self.commands.purge, 10, 100)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f436f4f_3ab04edd","line":62,"range":{"start_line":62,"start_character":8,"end_line":62,"end_character":48},"updated":"2017-08-14 03:50:14.000000000","message":"I don\u0027t think db api purge will raise DBReferenceError anymore, so please remove this test.","commit_id":"d254fe1dc830162338ed1919c7fe1f6f4bc80f68"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6a608703b490ec8d2c73d58f878533825264b162","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 NTT DATA"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_eb2c2b03","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"updated":"2018-04-13 10:28:49.000000000","message":"ditto","commit_id":"7134d99a9765add1b08484492c434e060f84f618"}],"releasenotes/notes/add-db-purge-command-7a33e2ea5d2a624b.yaml":[{"author":{"_account_id":1011,"name":"Tushar Patil","email":"tushar.vitthal.patil@gmail.com","username":"tpatil"},"change_message_id":"529b56c748f14cb1511662e92a9116426b3f16fc","unresolved":false,"context_lines":[{"line_number":11,"context_line":"      --max_rows    : Limit number of records to delete.(default: -1)"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"    NOTE:"},{"line_number":14,"context_line":"    Notifications will be purged on the basis of days since it is last"},{"line_number":15,"context_line":"    updated by masakari."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f515b1d_b4306209","line":15,"range":{"start_line":14,"start_character":4,"end_line":15,"end_character":24},"updated":"2017-09-22 07:11:44.000000000","message":"Rephrase it to\n\nNotification db records will be purged on the basis of update_at and status fields (finished, ignored, failed) as these records will not be soft deleted by the system automatically after it is processed either successfully or with error.","commit_id":"31cf4a453443d909d34f2aed4b2aa4b90cece29f"}]}
