)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Jake Yip \u003cjake.yip@unimelb.edu.au\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-03-29 12:28:56 +1100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add --before option to db archive_deleted_rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a parameter to limit the archival of deleted rows by date. That is,"},{"line_number":10,"context_line":"only rows before --before will be archived, if it is specified."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bf659307_5a4d23c2","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":12},"updated":"2018-03-29 09:25:34.000000000","message":"documentation update for nova-manage is still missing","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Jake Yip \u003cjake.yip@unimelb.edu.au\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-03-29 12:28:56 +1100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add --before option to db archive_deleted_rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a parameter to limit the archival of deleted rows by date. That is,"},{"line_number":10,"context_line":"only rows before --before will be archived, if it is specified."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bf659307_7a4a67ac","line":7,"range":{"start_line":7,"start_character":23,"end_line":7,"end_character":25},"updated":"2018-03-29 09:25:34.000000000","message":"nit: nova-manage db archive_deleted_rows","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add --before option to db archive_deleted_rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a parameter to limit the archival of deleted rows by date. That is,"},{"line_number":10,"context_line":"only rows before --before will be archived, if it is specified."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This option works together with --max_rows, if both are specified both"},{"line_number":13,"context_line":"will take effect."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bf659307_dace132c","line":10,"range":{"start_line":10,"start_character":10,"end_line":10,"end_character":25},"updated":"2018-03-29 09:25:34.000000000","message":"maybe only rows before the provided date ?","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add a parameter to limit the archival of deleted rows by date. That is,"},{"line_number":10,"context_line":"only rows before --before will be archived, if it is specified."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This option works together with --max_rows, if both are specified both"},{"line_number":13,"context_line":"will take effect."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1751192"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bf659307_7a8d87d1","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":42},"updated":"2018-03-29 09:25:34.000000000","message":"so this makes me curious, how will this work together with --until-complete if both are specified ? Everything before this given date will be archived ? and by default if --until-complete is not specified, it would archive a single batch size of 1000 rows ?","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":8064,"name":"Jake Yip","email":"jake.yip@ardc.edu.au","username":"jake"},"change_message_id":"35e8400ce534154270a9d2cd921501c838aa33b0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add a parameter to limit the archival of deleted rows by date. That is,"},{"line_number":10,"context_line":"only rows before --before will be archived, if it is specified."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This option works together with --max_rows, if both are specified both"},{"line_number":13,"context_line":"will take effect."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1751192"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9f6a8fd7_79d2fa36","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":42},"in_reply_to":"bf659307_7a8d87d1","updated":"2018-07-06 07:05:01.000000000","message":"yes and yes.\n\n--max_rows is a SQL limit, --before is a SQL WHERE clause. until-completed just recursively calls itself with max_rows and/or before until there are no more rows to delete.\n\nwonder if that answers your question?","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"}],"doc/source/cli/nova-manage.rst":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"3ffd06523a71d499e0660b3d7c205b845c1b5167","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    --verbose will print the results of the archive operation for any tables that"},{"line_number":67,"context_line":"    were changed. Specifying --until-complete will make the command run"},{"line_number":68,"context_line":"    continuously until all deleted rows are archived. Use the --max_rows option,"},{"line_number":69,"context_line":"    which defaults to 1000, as a batch size for each iteration. Use --before to"},{"line_number":70,"context_line":"    archive instances deleted before this date. Specifying --purge will cause a"},{"line_number":71,"context_line":"    `full` DB purge to be completed after archival. If a date range is desired"},{"line_number":72,"context_line":"    for the purge, then run ``nova-manage db purge --before \u003cdate\u003e`` manually"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_ef54fd56","line":69,"range":{"start_line":69,"start_character":63,"end_line":69,"end_character":67},"updated":"2018-05-03 08:18:06.000000000","message":"could be better if using the word \"Specifying ...\" to keep consistancy with other params. And also, I think what you write in commit message is easier to understand about how this param works.","commit_id":"7adb00cbf5036be9242fdb27ba2057d5df66eca1"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"36329fec4b82c6145e76e87756457bc46f2f986c","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    were changed. Specifying --until-complete will make the command run"},{"line_number":68,"context_line":"    continuously until all deleted rows are archived. Use the --max_rows option,"},{"line_number":69,"context_line":"    which defaults to 1000, as a batch size for each iteration. Specifying --before"},{"line_number":70,"context_line":"    will archive only rows that were deleted before the date provided. Specifying "},{"line_number":71,"context_line":"    --purge will cause a `full` DB purge to be completed after archival. If a"},{"line_number":72,"context_line":"    date range is desired for the purge, then run ``nova-manage db purge"},{"line_number":73,"context_line":"    --before \u003cdate\u003e`` manually after archiving is complete."}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_f3b7d985","line":70,"range":{"start_line":70,"start_character":81,"end_line":70,"end_character":82},"updated":"2018-05-07 13:24:36.000000000","message":"It is not necessary. Remove it.","commit_id":"4fa720f9614192fc70ed3b68f35468233ac1da4f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0d44dc7c25f5a3a0345bed61b0614231fd97ef71","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    deleted rows are archived. Use the ``--max_rows`` option, which defaults to"},{"line_number":70,"context_line":"    1000, as a batch size for each iteration (note that the purged API database"},{"line_number":71,"context_line":"    table records are not included in this batch size). Specifying ``--before``"},{"line_number":72,"context_line":"    will archive only rows that were deleted before the date provided."},{"line_number":73,"context_line":"    Specifying ``--purge`` will cause a `full` DB purge to be completed after"},{"line_number":74,"context_line":"    archival. If a date range is desired for the purge, then run"},{"line_number":75,"context_line":"    ``nova-manage db purge --before \u003cdate\u003e`` manually after archiving is"}],"source_content_type":"text/x-rst","patch_set":13,"id":"bfb3d3c7_69bbd071","line":72,"range":{"start_line":72,"start_character":9,"end_line":72,"end_character":69},"updated":"2019-05-22 13:52:36.000000000","message":"I wonder if it makes sense to mention something in here about how some of the items won\u0027t be archived if the instance they came from wasn\u0027t also deleted before the same threshold?","commit_id":"1aec8c7465b11dff06ffee022e5b7925000f53af"}],"nova/cmd/manage.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ce987366d180c938bb4a0ce299cb556951ee80c7","unresolved":false,"context_lines":[{"line_number":482,"context_line":""},{"line_number":483,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":484,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000.\u0027)"},{"line_number":485,"context_line":"    @args(\u0027--until_deleted_at\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":486,"context_line":"            help\u003d\u0027Archive rows where deleted_at is before this date\u0027"},{"line_number":487,"context_line":"                \u0027(YYYY-MM-DD)\u0027)"},{"line_number":488,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_676f7992","line":485,"range":{"start_line":485,"start_character":13,"end_line":485,"end_character":29},"updated":"2018-03-27 08:57:37.000000000","message":"\"until_deleted_at\" along with the help description is confusing to me. I would prefer something similar to the \"db purge\" command option \"before\" in line 576","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ce987366d180c938bb4a0ce299cb556951ee80c7","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":484,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000.\u0027)"},{"line_number":485,"context_line":"    @args(\u0027--until_deleted_at\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":486,"context_line":"            help\u003d\u0027Archive rows where deleted_at is before this date\u0027"},{"line_number":487,"context_line":"                \u0027(YYYY-MM-DD)\u0027)"},{"line_number":488,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":489,"context_line":"          help\u003d\u0027Print how many rows were archived per table.\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_c72e8542","line":486,"range":{"start_line":486,"start_character":37,"end_line":486,"end_character":47},"updated":"2018-03-27 08:57:37.000000000","message":"deleted_at -\u003e column name ? I guess its better to write a generic help message (like \"Archive rows that have been deleted before this date\"), Since you have also used \"before this date\" in your description keeping the option as \"before/before_deleted_at\" is better than \"until_deleted_at\" IMHO like I have said in the previous comment.","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"240522049db47d8a3a3706a212712b6906b2b9e1","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":484,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000.\u0027)"},{"line_number":485,"context_line":"    @args(\u0027--until_deleted_at\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":486,"context_line":"            help\u003d\u0027Archive rows where deleted_at is before this date\u0027"},{"line_number":487,"context_line":"                \u0027(YYYY-MM-DD)\u0027)"},{"line_number":488,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":489,"context_line":"          help\u003d\u0027Print how many rows were archived per table.\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_4fd611c6","line":486,"updated":"2018-03-27 06:41:00.000000000","message":"need a blank","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"240522049db47d8a3a3706a212712b6906b2b9e1","unresolved":false,"context_lines":[{"line_number":495,"context_line":"          help\u003d\u0027Purge all data from shadow tables after archive completes\u0027)"},{"line_number":496,"context_line":"    def archive_deleted_rows(self, max_rows\u003d1000, verbose\u003dFalse,"},{"line_number":497,"context_line":"                             until_complete\u003dFalse, purge\u003dFalse,"},{"line_number":498,"context_line":"                             until_deleted_at\u003dNone):"},{"line_number":499,"context_line":"        \"\"\"Move deleted rows from production tables to shadow tables."},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"        Returns 0 if nothing was archived, 1 if some number of rows were"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_efab651a","line":498,"range":{"start_line":498,"start_character":29,"end_line":498,"end_character":45},"updated":"2018-03-27 06:41:00.000000000","message":"not sure whether some validation can be done such as this is a valid date time format?","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":8064,"name":"Jake Yip","email":"jake.yip@ardc.edu.au","username":"jake"},"change_message_id":"d23b3da38294ef79f2996468bf8d567f66f9e42a","unresolved":false,"context_lines":[{"line_number":495,"context_line":"          help\u003d\u0027Purge all data from shadow tables after archive completes\u0027)"},{"line_number":496,"context_line":"    def archive_deleted_rows(self, max_rows\u003d1000, verbose\u003dFalse,"},{"line_number":497,"context_line":"                             until_complete\u003dFalse, purge\u003dFalse,"},{"line_number":498,"context_line":"                             until_deleted_at\u003dNone):"},{"line_number":499,"context_line":"        \"\"\"Move deleted rows from production tables to shadow tables."},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"        Returns 0 if nothing was archived, 1 if some number of rows were"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_25bac0dd","line":498,"range":{"start_line":498,"start_character":29,"end_line":498,"end_character":45},"in_reply_to":"bf659307_67e21904","updated":"2018-03-27 23:46:57.000000000","message":"I was doing validation in `nova/db/sqlalchemy/api.py`, not sure if I should be doing it here instead? or both? what do you prefer?","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ce987366d180c938bb4a0ce299cb556951ee80c7","unresolved":false,"context_lines":[{"line_number":495,"context_line":"          help\u003d\u0027Purge all data from shadow tables after archive completes\u0027)"},{"line_number":496,"context_line":"    def archive_deleted_rows(self, max_rows\u003d1000, verbose\u003dFalse,"},{"line_number":497,"context_line":"                             until_complete\u003dFalse, purge\u003dFalse,"},{"line_number":498,"context_line":"                             until_deleted_at\u003dNone):"},{"line_number":499,"context_line":"        \"\"\"Move deleted rows from production tables to shadow tables."},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"        Returns 0 if nothing was archived, 1 if some number of rows were"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_67e21904","line":498,"range":{"start_line":498,"start_character":29,"end_line":498,"end_character":45},"in_reply_to":"bf659307_efab651a","updated":"2018-03-27 08:57:37.000000000","message":"++, would be nice to catch the invalid input values in an exception.","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":484,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000.\u0027)"},{"line_number":485,"context_line":"    @args(\u0027--before\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":486,"context_line":"          help\u003d(\u0027Archive rows that has been deleted before this date\u0027"},{"line_number":487,"context_line":"                \u0027(YYYY-MM-DD)\u0027))"},{"line_number":488,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":489,"context_line":"          help\u003d\u0027Print how many rows were archived per table.\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_3ac5cff1","line":486,"range":{"start_line":486,"start_character":37,"end_line":486,"end_character":38},"updated":"2018-03-29 09:25:34.000000000","message":"nit:have","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":495,"context_line":"          help\u003d\u0027Purge all data from shadow tables after archive completes\u0027)"},{"line_number":496,"context_line":"    def archive_deleted_rows(self, max_rows\u003d1000, verbose\u003dFalse,"},{"line_number":497,"context_line":"                             until_complete\u003dFalse, purge\u003dFalse,"},{"line_number":498,"context_line":"                             before\u003dNone):"},{"line_number":499,"context_line":"        \"\"\"Move deleted rows from production tables to shadow tables."},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"        Returns 0 if nothing was archived, 1 if some number of rows were"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_fda7510a","line":498,"updated":"2018-03-29 09:25:34.000000000","message":"The valid value check should be done here IMHO than in the db code, why would you go further in if the input value from the user is not compatible ?","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":533,"context_line":"            try:"},{"line_number":534,"context_line":"                run, deleted_instance_uuids \u003d db.archive_deleted_rows("},{"line_number":535,"context_line":"                                            max_rows,"},{"line_number":536,"context_line":"                                            before\u003dbefore)"},{"line_number":537,"context_line":"            except KeyboardInterrupt:"},{"line_number":538,"context_line":"                run \u003d {}"},{"line_number":539,"context_line":"                if until_complete and verbose:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_da6a93eb","line":536,"updated":"2018-03-29 09:25:34.000000000","message":"nit: check indent, pretty sure this can git in the previous line ?","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9e584a4ae92de418e1137afe75ecc4f7f82471c5","unresolved":false,"context_lines":[{"line_number":574,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":575,"context_line":"        return int(bool(table_to_rows_archived))"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"    @args(\u0027--before\u0027, dest\u003d\u0027before\u0027,"},{"line_number":578,"context_line":"          help\u003d\u0027If specified, purge rows from shadow tables that are older \u0027"},{"line_number":579,"context_line":"               \u0027than this. Fuzzy time specs are allowed\u0027)"},{"line_number":580,"context_line":"    @args(\u0027--all\u0027, dest\u003d\u0027purge_all\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":581,"context_line":"          help\u003d\u0027Purge all rows in the shadow tables\u0027)"},{"line_number":582,"context_line":"    @args(\u0027--verbose\u0027, dest\u003d\u0027verbose\u0027, action\u003d\u0027store_true\u0027, default\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_6183da57","line":579,"range":{"start_line":577,"start_character":4,"end_line":579,"end_character":57},"updated":"2018-04-09 14:24:31.000000000","message":"I would copy this exactly, including how it\u0027s implemented since we would want the behavior and user experience to be similar.","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"36329fec4b82c6145e76e87756457bc46f2f986c","unresolved":false,"context_lines":[{"line_number":506,"context_line":"                before_date \u003d dateutil_parser.parse(before, fuzzy\u003dTrue)"},{"line_number":507,"context_line":"            except ValueError as e:"},{"line_number":508,"context_line":"                print(_(\u0027Invalid value for --before: %s\u0027) % e)"},{"line_number":509,"context_line":"                return 2"},{"line_number":510,"context_line":"        else:"},{"line_number":511,"context_line":"            before_date \u003d None"},{"line_number":512,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_33beb165","line":509,"range":{"start_line":509,"start_character":23,"end_line":509,"end_character":24},"updated":"2018-05-07 13:24:36.000000000","message":"It is better to use another return code.\nAnd it would be better to mention the return code in doc/source/cli/nova-manage.rst .","commit_id":"4fa720f9614192fc70ed3b68f35468233ac1da4f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":499,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000.\u0027)"},{"line_number":500,"context_line":"    @args(\u0027--before\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":501,"context_line":"          help\u003d(\u0027Archive rows that have been deleted before this date\u0027"},{"line_number":502,"context_line":"                \u0027(YYYY-MM-DD)\u0027))"},{"line_number":503,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_94d055f7","line":500,"updated":"2018-11-07 17:35:20.000000000","message":"Why doesn\u0027t this use dest\u003d\u0027before\u0027? I think metavar is just for the docs. I think dest is important for the kwargs but I\u0027m not really sure. I know we\u0027ve had bugs before about kwargs being wrong. And I see dest\u003d\u0027before\u0027 is used in the purge command and the other options here.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":498,"context_line":"    @args(\u0027--max_rows\u0027, type\u003dint, metavar\u003d\u0027\u003cnumber\u003e\u0027, dest\u003d\u0027max_rows\u0027,"},{"line_number":499,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive. Defaults to 1000.\u0027)"},{"line_number":500,"context_line":"    @args(\u0027--before\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":501,"context_line":"          help\u003d(\u0027Archive rows that have been deleted before this date\u0027"},{"line_number":502,"context_line":"                \u0027(YYYY-MM-DD)\u0027))"},{"line_number":503,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":504,"context_line":"          help\u003d\u0027Print how many rows were archived per table.\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_b4cd515c","line":501,"range":{"start_line":501,"start_character":69,"end_line":501,"end_character":70},"updated":"2018-11-07 17:35:20.000000000","message":"need a space between words","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                  {\u0027max_value\u0027: db.MAX_INT})"},{"line_number":529,"context_line":"            return 2"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":"        if before:"},{"line_number":532,"context_line":"            try:"},{"line_number":533,"context_line":"                before_date \u003d dateutil_parser.parse(before, fuzzy\u003dTrue)"},{"line_number":534,"context_line":"            except ValueError as e:"},{"line_number":535,"context_line":"                print(_(\u0027Invalid value for --before: %s\u0027) % e)"},{"line_number":536,"context_line":"                return 4"},{"line_number":537,"context_line":"        else:"},{"line_number":538,"context_line":"            before_date \u003d None"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":541,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_34fb817a","line":538,"range":{"start_line":531,"start_character":0,"end_line":538,"end_character":30},"updated":"2018-11-07 17:35:20.000000000","message":"move this after the connection check below which returns code 3, so then we have rc 2, 3, 4 checks in order.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c99fe010bce21372221694014462fee1ac19ea8b","unresolved":false,"context_lines":[{"line_number":599,"context_line":"        if table_to_rows_archived and purge:"},{"line_number":600,"context_line":"            if verbose:"},{"line_number":601,"context_line":"                print(_(\u0027Rows were archived, running purge...\u0027))"},{"line_number":602,"context_line":"            self.purge(purge_all\u003dTrue, verbose\u003dverbose)"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"        # NOTE(danms): Return nonzero if we archived something"},{"line_number":605,"context_line":"        return int(bool(table_to_rows_archived))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_203edcb5","line":602,"range":{"start_line":602,"start_character":12,"end_line":602,"end_character":55},"updated":"2018-11-07 19:22:38.000000000","message":"Shouldn\u0027t we pass the --before value through to the purge command? Otherwise we could archive things before the given date but then purge stuff newer than that date, which would probably be unexpected.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b7ec3316baa494395e065db2a5fd2a1a4b5bf87e","unresolved":false,"context_lines":[{"line_number":488,"context_line":"               \u0027rows, if any, that are removed from the API database for \u0027"},{"line_number":489,"context_line":"               \u0027deleted instances.\u0027)"},{"line_number":490,"context_line":"    @args(\u0027--before\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":491,"context_line":"          help\u003d(\u0027Archive rows that have been deleted before this date\u0027"},{"line_number":492,"context_line":"                \u0027(YYYY-MM-DD)\u0027))"},{"line_number":493,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":494,"context_line":"          help\u003d\u0027Print how many rows were archived per table.\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"bfb3d3c7_ed00fd03","line":491,"range":{"start_line":491,"start_character":68,"end_line":491,"end_character":70},"updated":"2019-05-24 13:16:14.000000000","message":"could use a space here, but...","commit_id":"e822360b6696c492bb583240483ee9593d7d24e1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b7ec3316baa494395e065db2a5fd2a1a4b5bf87e","unresolved":false,"context_lines":[{"line_number":489,"context_line":"               \u0027deleted instances.\u0027)"},{"line_number":490,"context_line":"    @args(\u0027--before\u0027, metavar\u003d\u0027\u003cdate\u003e\u0027,"},{"line_number":491,"context_line":"          help\u003d(\u0027Archive rows that have been deleted before this date\u0027"},{"line_number":492,"context_line":"                \u0027(YYYY-MM-DD)\u0027))"},{"line_number":493,"context_line":"    @args(\u0027--verbose\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027verbose\u0027, default\u003dFalse,"},{"line_number":494,"context_line":"          help\u003d\u0027Print how many rows were archived per table.\u0027)"},{"line_number":495,"context_line":"    @args(\u0027--until-complete\u0027, action\u003d\u0027store_true\u0027, dest\u003d\u0027until_complete\u0027,"}],"source_content_type":"text/x-python","patch_set":14,"id":"bfb3d3c7_32051015","line":492,"range":{"start_line":492,"start_character":17,"end_line":492,"end_character":29},"updated":"2019-05-24 13:16:14.000000000","message":"...this is implying the parsing is stricter than it actually is. The other --before that\u0027s processed the same way says:\n\n\u0027If specified, purge rows from shadow tables that are older than this. Fuzzy time specs are allowed\u0027\n\nNot that \"Fuzzy time specs\" is especially descriptive, as made clear by the subsequent patch. Short of revealing implementation details to the user by linking to the dateutils.parser docs [1], perhaps we could say something like:\n\n\"Accepts date strings in the default format output by the ``date`` command, as well as ``YYYY-MM-DD [HH:mm:ss]``.\"\n\n(and the same for purge)\n\n[1] https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.parse","commit_id":"e822360b6696c492bb583240483ee9593d7d24e1"}],"nova/db/api.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ce987366d180c938bb4a0ce299cb556951ee80c7","unresolved":false,"context_lines":[{"line_number":1854,"context_line":""},{"line_number":1855,"context_line":"    \"\"\""},{"line_number":1856,"context_line":"    return IMPL.archive_deleted_rows(max_rows\u003dmax_rows,"},{"line_number":1857,"context_line":"                                        until_deleted_at\u003duntil_deleted_at)"},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":""},{"line_number":1860,"context_line":"def pcidevice_online_data_migration(context, max_count):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_c7a1a5ab","line":1857,"updated":"2018-03-27 08:57:37.000000000","message":"nit: correct the indent","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":1854,"context_line":""},{"line_number":1855,"context_line":"    \"\"\""},{"line_number":1856,"context_line":"    return IMPL.archive_deleted_rows(max_rows\u003dmax_rows,"},{"line_number":1857,"context_line":"                                     before\u003dbefore)"},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":""},{"line_number":1860,"context_line":"def pcidevice_online_data_migration(context, max_count):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_1a1c8b76","line":1857,"updated":"2018-03-29 09:25:34.000000000","message":"nit: indent, why a new line ?","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ce987366d180c938bb4a0ce299cb556951ee80c7","unresolved":false,"context_lines":[{"line_number":5518,"context_line":"        conn.execute(update_statement)"},{"line_number":5519,"context_line":""},{"line_number":5520,"context_line":"    if until_deleted_at is None:"},{"line_number":5521,"context_line":"        # NOTE(jake): until_deleted_at needs to be set to as close to as the"},{"line_number":5522,"context_line":"        # query as possible, as we are deleting rows before this query and"},{"line_number":5523,"context_line":"        # want those to be archived too"},{"line_number":5524,"context_line":"        until_deleted_at \u003d timeutils.utcnow()"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_aa87980f","line":5521,"range":{"start_line":5521,"start_character":58,"end_line":5521,"end_character":69},"updated":"2018-03-27 08:57:37.000000000","message":"no matter how much of real time you try to set this to, we are going to miss some records.","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ce987366d180c938bb4a0ce299cb556951ee80c7","unresolved":false,"context_lines":[{"line_number":5521,"context_line":"        # NOTE(jake): until_deleted_at needs to be set to as close to as the"},{"line_number":5522,"context_line":"        # query as possible, as we are deleting rows before this query and"},{"line_number":5523,"context_line":"        # want those to be archived too"},{"line_number":5524,"context_line":"        until_deleted_at \u003d timeutils.utcnow()"},{"line_number":5525,"context_line":"    else:"},{"line_number":5526,"context_line":"        until_deleted_at \u003d timeutils.parse_strtime(until_deleted_at,"},{"line_number":5527,"context_line":"                                                    \u0027%Y-%m-%d\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_0a9fa45f","line":5524,"updated":"2018-03-27 08:57:37.000000000","message":"I am not okay with this logic, \"until_deleted_at\" is an optional argument and if its not specified , this should not be used in the query for deletion, meaning it should not be a criteria.","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":8064,"name":"Jake Yip","email":"jake.yip@ardc.edu.au","username":"jake"},"change_message_id":"d23b3da38294ef79f2996468bf8d567f66f9e42a","unresolved":false,"context_lines":[{"line_number":5521,"context_line":"        # NOTE(jake): until_deleted_at needs to be set to as close to as the"},{"line_number":5522,"context_line":"        # query as possible, as we are deleting rows before this query and"},{"line_number":5523,"context_line":"        # want those to be archived too"},{"line_number":5524,"context_line":"        until_deleted_at \u003d timeutils.utcnow()"},{"line_number":5525,"context_line":"    else:"},{"line_number":5526,"context_line":"        until_deleted_at \u003d timeutils.parse_strtime(until_deleted_at,"},{"line_number":5527,"context_line":"                                                    \u0027%Y-%m-%d\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf659307_25af2095","line":5524,"in_reply_to":"bf659307_0a9fa45f","updated":"2018-03-27 23:46:57.000000000","message":"Ok. I was trying to save some code lines in _archive_if_instance_deleted() by setting until_deleted_at to now() here. We can pass the None values all the way down; the SQL if-else logic gets more complicated but it is cleaner operationally.","commit_id":"c9db25c3ecc989e0a6d1f4f52def6f686bf558ea"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":5595,"context_line":"                tablename.startswith(_SHADOW_TABLE_PREFIX)):"},{"line_number":5596,"context_line":"            continue"},{"line_number":5597,"context_line":"        (rows_archived, deleted_instance_uuid) \u003d ("},{"line_number":5598,"context_line":"            _archive_deleted_rows_for_table("},{"line_number":5599,"context_line":"                tablename,"},{"line_number":5600,"context_line":"                max_rows\u003dmax_rows - total_rows_archived,"},{"line_number":5601,"context_line":"                before\u003dbefore))"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_bd96b992","line":5598,"updated":"2018-03-29 09:25:34.000000000","message":"sorry, is this done to wrap the indentation to 80 chars or IMHO its becoming hard to read this part because of the white spaces wasting. However maybe its just me, you can wait for a second opinion if you want.","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":8064,"name":"Jake Yip","email":"jake.yip@ardc.edu.au","username":"jake"},"change_message_id":"35e8400ce534154270a9d2cd921501c838aa33b0","unresolved":false,"context_lines":[{"line_number":5595,"context_line":"                tablename.startswith(_SHADOW_TABLE_PREFIX)):"},{"line_number":5596,"context_line":"            continue"},{"line_number":5597,"context_line":"        (rows_archived, deleted_instance_uuid) \u003d ("},{"line_number":5598,"context_line":"            _archive_deleted_rows_for_table("},{"line_number":5599,"context_line":"                tablename,"},{"line_number":5600,"context_line":"                max_rows\u003dmax_rows - total_rows_archived,"},{"line_number":5601,"context_line":"                before\u003dbefore))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f6a8fd7_c4f8a8c5","line":5598,"in_reply_to":"bf659307_bd96b992","updated":"2018-07-06 07:05:01.000000000","message":"yeap. I though first line was easier to read this this way, and leaves more space for parameters to _archive_deleted_rows_for_table().\n\ncan always revert it to previous if you want.","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":23630,"name":"Tovin Seven","email":"tovin07@gmail.com","username":"tovin07"},"change_message_id":"2a7dd5f7968e387f1fa37165063a6f5c064e119d","unresolved":false,"context_lines":[{"line_number":5430,"context_line":"    query_insert \u003d shadow_table.insert(inline\u003dTrue).\\"},{"line_number":5431,"context_line":"        from_select([c.name for c in table.c], query_select)"},{"line_number":5432,"context_line":""},{"line_number":5433,"context_line":"    delete_statement \u003d DeleteFromSelect(table, query_select,"},{"line_number":5434,"context_line":"                                        table.c.id)"},{"line_number":5435,"context_line":""},{"line_number":5436,"context_line":"    try:"},{"line_number":5437,"context_line":"        with conn.begin():"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_a6f91d81","line":5434,"range":{"start_line":5433,"start_character":0,"end_line":5434,"end_character":51},"updated":"2018-05-07 13:43:56.000000000","message":"keep this in one line","commit_id":"4fa720f9614192fc70ed3b68f35468233ac1da4f"},{"author":{"_account_id":23630,"name":"Tovin Seven","email":"tovin07@gmail.com","username":"tovin07"},"change_message_id":"2a7dd5f7968e387f1fa37165063a6f5c064e119d","unresolved":false,"context_lines":[{"line_number":5445,"context_line":"        return 0"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":""},{"line_number":5448,"context_line":"def _archive_deleted_rows_for_table(tablename, max_rows,"},{"line_number":5449,"context_line":"                                    before):"},{"line_number":5450,"context_line":"    \"\"\"Move up to max_rows rows from one tables to the corresponding"},{"line_number":5451,"context_line":"    shadow table."},{"line_number":5452,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_66f305a0","line":5449,"range":{"start_line":5448,"start_character":0,"end_line":5449,"end_character":44},"updated":"2018-05-07 13:43:56.000000000","message":"ditto","commit_id":"4fa720f9614192fc70ed3b68f35468233ac1da4f"},{"author":{"_account_id":23630,"name":"Tovin Seven","email":"tovin07@gmail.com","username":"tovin07"},"change_message_id":"2a7dd5f7968e387f1fa37165063a6f5c064e119d","unresolved":false,"context_lines":[{"line_number":5593,"context_line":"        if (tablename \u003d\u003d \u0027migrate_version\u0027 or"},{"line_number":5594,"context_line":"                tablename.startswith(_SHADOW_TABLE_PREFIX)):"},{"line_number":5595,"context_line":"            continue"},{"line_number":5596,"context_line":"        (rows_archived, deleted_instance_uuid) \u003d ("},{"line_number":5597,"context_line":"            _archive_deleted_rows_for_table("},{"line_number":5598,"context_line":"                tablename,"},{"line_number":5599,"context_line":"                max_rows\u003dmax_rows - total_rows_archived,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_46304957","line":5596,"range":{"start_line":5596,"start_character":8,"end_line":5596,"end_character":9},"updated":"2018-05-07 13:43:56.000000000","message":"redundant","commit_id":"4fa720f9614192fc70ed3b68f35468233ac1da4f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c99fe010bce21372221694014462fee1ac19ea8b","unresolved":false,"context_lines":[{"line_number":5429,"context_line":"##################"},{"line_number":5430,"context_line":""},{"line_number":5431,"context_line":""},{"line_number":5432,"context_line":"def _archive_if_instance_deleted(table, shadow_table, instances, conn,"},{"line_number":5433,"context_line":"                                 max_rows, before):"},{"line_number":5434,"context_line":"    \"\"\"Look for records that pertain to deleted instances, but may not be"},{"line_number":5435,"context_line":"    deleted themselves. This catches cases where we delete an instance,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_403678ea","line":5432,"range":{"start_line":5432,"start_character":4,"end_line":5432,"end_character":32},"updated":"2018-11-07 19:22:38.000000000","message":"Seems weird to care about --before here, but I guess it makes sense if we also use max_rows.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c99fe010bce21372221694014462fee1ac19ea8b","unresolved":false,"context_lines":[{"line_number":5445,"context_line":"                 instances.c.uuid \u003d\u003d table.c.instance_uuid))"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":"    if before:"},{"line_number":5448,"context_line":"        query_select \u003d query_select.where(instances.c.deleted_at \u003c\u003d before)"},{"line_number":5449,"context_line":""},{"line_number":5450,"context_line":"    query_select \u003d query_select.order_by(table.c.id).limit(max_rows)"},{"line_number":5451,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_3d5a8550","line":5448,"range":{"start_line":5448,"start_character":65,"end_line":5448,"end_character":67},"updated":"2018-11-07 19:22:38.000000000","message":"This is different from the purge --before logic, in that this is archiving records before or equal to the given date, but --before in purge (and to me) means just before, not equal to. We should be consistent.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":5502,"context_line":"    deleted_column \u003d table.c.deleted"},{"line_number":5503,"context_line":"    columns \u003d [c.name for c in table.c]"},{"line_number":5504,"context_line":""},{"line_number":5505,"context_line":"    # NOTE(clecomte): Tables instance_actions and instances_actions_events"},{"line_number":5506,"context_line":"    # have to be manage differently so we soft-delete them here to let"},{"line_number":5507,"context_line":"    # the archive work the same for all tables"},{"line_number":5508,"context_line":"    # NOTE(takashin): The record in table migrations should be"},{"line_number":5509,"context_line":"    # soft deleted when the instance is deleted."},{"line_number":5510,"context_line":"    # This is just for upgrading."},{"line_number":5511,"context_line":"    instances \u003d models.BASE.metadata.tables[\"instances\"]"},{"line_number":5512,"context_line":"    deleted_instances \u003d sql.select([instances.c.uuid]).\\"},{"line_number":5513,"context_line":"        where(instances.c.deleted !\u003d instances.c.deleted.default.arg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_74efb985","line":5510,"range":{"start_line":5505,"start_character":4,"end_line":5510,"end_character":33},"updated":"2018-11-07 17:35:20.000000000","message":"These comments should move with this condition:\n\nif tablename in (\"instance_actions\", \"migrations\"):","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c99fe010bce21372221694014462fee1ac19ea8b","unresolved":false,"context_lines":[{"line_number":5514,"context_line":"    if before:"},{"line_number":5515,"context_line":"        deleted_instances \u003d \\"},{"line_number":5516,"context_line":"                deleted_instances.where(instances.c.deleted_at \u003c\u003d before)"},{"line_number":5517,"context_line":"    if tablename in (\"instance_actions\", \"migrations\"):"},{"line_number":5518,"context_line":"        update_statement \u003d table.update().values(deleted\u003dtable.c.id,"},{"line_number":5519,"context_line":"                                            deleted_at\u003dbefore).\\"},{"line_number":5520,"context_line":"            where(table.c.instance_uuid.in_(deleted_instances))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_7d0a3d29","line":5517,"range":{"start_line":5517,"start_character":21,"end_line":5517,"end_character":53},"updated":"2018-11-07 19:22:38.000000000","message":"These aren\u0027t covered in the test.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":5516,"context_line":"                deleted_instances.where(instances.c.deleted_at \u003c\u003d before)"},{"line_number":5517,"context_line":"    if tablename in (\"instance_actions\", \"migrations\"):"},{"line_number":5518,"context_line":"        update_statement \u003d table.update().values(deleted\u003dtable.c.id,"},{"line_number":5519,"context_line":"                                            deleted_at\u003dbefore).\\"},{"line_number":5520,"context_line":"            where(table.c.instance_uuid.in_(deleted_instances))"},{"line_number":5521,"context_line":""},{"line_number":5522,"context_line":"        conn.execute(update_statement)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_f4fae941","line":5519,"range":{"start_line":5519,"start_character":55,"end_line":5519,"end_character":61},"updated":"2018-11-07 17:35:20.000000000","message":"What if this is None? Won\u0027t that mess up this query?","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c99fe010bce21372221694014462fee1ac19ea8b","unresolved":false,"context_lines":[{"line_number":5521,"context_line":""},{"line_number":5522,"context_line":"        conn.execute(update_statement)"},{"line_number":5523,"context_line":""},{"line_number":5524,"context_line":"    elif tablename \u003d\u003d \"instance_actions_events\":"},{"line_number":5525,"context_line":"        # NOTE(clecomte): we have to grab all the relation from"},{"line_number":5526,"context_line":"        # instances because instance_actions_events rely on"},{"line_number":5527,"context_line":"        # action_id and not uuid"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_3d08452c","line":5524,"range":{"start_line":5524,"start_character":23,"end_line":5524,"end_character":46},"updated":"2018-11-07 19:22:38.000000000","message":"This table isn\u0027t covered in the test.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":5530,"context_line":"            where(instance_actions.c.instance_uuid.in_(deleted_instances))"},{"line_number":5531,"context_line":""},{"line_number":5532,"context_line":"        update_statement \u003d table.update().values(deleted\u003dtable.c.id,"},{"line_number":5533,"context_line":"                                            deleted_at\u003dbefore).\\"},{"line_number":5534,"context_line":"            where(table.c.action_id.in_(deleted_actions))"},{"line_number":5535,"context_line":""},{"line_number":5536,"context_line":"        conn.execute(update_statement)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_b4f0f161","line":5533,"range":{"start_line":5533,"start_character":55,"end_line":5533,"end_character":61},"updated":"2018-11-07 17:35:20.000000000","message":"same","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c99fe010bce21372221694014462fee1ac19ea8b","unresolved":false,"context_lines":[{"line_number":5538,"context_line":"    select \u003d sql.select([column],"},{"line_number":5539,"context_line":"                        deleted_column !\u003d deleted_column.default.arg)"},{"line_number":5540,"context_line":"    if before:"},{"line_number":5541,"context_line":"        select \u003d select.where(table.c.deleted_at \u003c\u003d before)"},{"line_number":5542,"context_line":""},{"line_number":5543,"context_line":"    select \u003d select.order_by(column).limit(max_rows)"},{"line_number":5544,"context_line":"    rows \u003d conn.execute(select).fetchall()"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_9d0f1937","line":5541,"range":{"start_line":5541,"start_character":49,"end_line":5541,"end_character":51},"updated":"2018-11-07 19:22:38.000000000","message":"same","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":5583,"context_line":"    return rows_archived, deleted_instance_uuids"},{"line_number":5584,"context_line":""},{"line_number":5585,"context_line":""},{"line_number":5586,"context_line":"def archive_deleted_rows(max_rows\u003dNone, before\u003dNone):"},{"line_number":5587,"context_line":"    \"\"\"Move up to max_rows rows from production tables to the corresponding"},{"line_number":5588,"context_line":"    shadow tables."},{"line_number":5589,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_f41e69ba","line":5586,"range":{"start_line":5586,"start_character":40,"end_line":5586,"end_character":46},"updated":"2018-11-07 17:35:20.000000000","message":"nit: I\u0027d prefer you use the same variable name as the purge method (before_date).","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b7ec3316baa494395e065db2a5fd2a1a4b5bf87e","unresolved":false,"context_lines":[{"line_number":5451,"context_line":"        from_select([c.name for c in table.c], query_select)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"    delete_statement \u003d DeleteFromSelect(table, query_select,"},{"line_number":5454,"context_line":"                                        table.c.id)"},{"line_number":5455,"context_line":""},{"line_number":5456,"context_line":"    try:"},{"line_number":5457,"context_line":"        with conn.begin():"}],"source_content_type":"text/x-python","patch_set":14,"id":"bfb3d3c7_b2b58080","line":5454,"updated":"2019-05-24 13:16:14.000000000","message":"nice DRYing here","commit_id":"e822360b6696c492bb583240483ee9593d7d24e1"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"36329fec4b82c6145e76e87756457bc46f2f986c","unresolved":false,"context_lines":[{"line_number":8193,"context_line":"                                                        table_name))"},{"line_number":8194,"context_line":"        self._assert_shadow_tables_empty_except()"},{"line_number":8195,"context_line":""},{"line_number":8196,"context_line":"    def test_archive_deleted_rows(self):"},{"line_number":8197,"context_line":"        # Add 6 rows to table"},{"line_number":8198,"context_line":"        for uuidstr in self.uuidstrs:"},{"line_number":8199,"context_line":"            ins_stmt \u003d self.instance_id_mappings.insert().values(uuid\u003duuidstr)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_e6f2b506","line":8196,"range":{"start_line":8196,"start_character":8,"end_line":8196,"end_character":33},"updated":"2018-05-07 13:24:36.000000000","message":"A test case that \u0027before\u0027 is not None is missing.","commit_id":"4fa720f9614192fc70ed3b68f35468233ac1da4f"}],"nova/tests/unit/test_nova_manage.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":490,"context_line":""},{"line_number":491,"context_line":"    def test_archive_deleted_rows_until_stopped_quiet(self):"},{"line_number":492,"context_line":"        self.test_archive_deleted_rows_until_stopped(verbose\u003dFalse)"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"    @mock.patch.object(db, \u0027archive_deleted_rows\u0027)"},{"line_number":495,"context_line":"    @mock.patch.object(objects.CellMappingList, \u0027get_all\u0027)"},{"line_number":496,"context_line":"    def test_archive_deleted_rows_before(self, mock_get_all, mock_db_archive):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_bdca394b","line":493,"updated":"2018-03-29 09:25:34.000000000","message":"a test case for invalid date is missing, please add it after you handle this portion in the code.","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"}],"releasenotes/notes/nova-manage-db-archive-before-option-8296af1c815f5f8a.yaml":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - A new option --before has been added to `nova db archive` command."},{"line_number":4,"context_line":"    This options limits archival of records to those deleted before"},{"line_number":5,"context_line":"    specified date."}],"source_content_type":"text/x-yaml","patch_set":2,"id":"bf659307_ddfdad6e","line":3,"range":{"start_line":3,"start_character":44,"end_line":3,"end_character":52},"updated":"2018-03-29 09:25:34.000000000","message":"nova-manage db archive_deleted_rows","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"23db8c4d05d89e0e4e658487e31d2a015d8dd6f8","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - A new option --before has been added to `nova db archive` command."},{"line_number":4,"context_line":"    This options limits archival of records to those deleted before"},{"line_number":5,"context_line":"    specified date."}],"source_content_type":"text/x-yaml","patch_set":2,"id":"bf659307_bdf8f97a","line":4,"range":{"start_line":4,"start_character":15,"end_line":4,"end_character":16},"updated":"2018-03-29 09:25:34.000000000","message":"nit: option","commit_id":"a362f6a54c5ab189b058487f6bc7225c004f581a"},{"author":{"_account_id":3031,"name":"Sam Morrison","email":"sorrison@gmail.com","username":"sorrison"},"change_message_id":"600af6f7da47289acf1a503c518df5d53a36c225","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - A new option --before has been added to `nova db archive` command."},{"line_number":4,"context_line":"    This options limits archival of records to those deleted before"},{"line_number":5,"context_line":"    specified date."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_1dd55747","line":3,"range":{"start_line":3,"start_character":45,"end_line":3,"end_character":49},"updated":"2018-07-30 06:50:37.000000000","message":"should be nova-manage","commit_id":"cecbdd9448e9d5254f7286993ca924992bbc2e8f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e7e88cdbb2b3193fc90133652897b56cc8971cd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - An option --before has been added to `nova-manage db archive_deleted_rows`"},{"line_number":4,"context_line":"    command. This options limits archival of records to those deleted before"},{"line_number":5,"context_line":"    specified date."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"3f79a3b5_947615d6","line":3,"range":{"start_line":3,"start_character":14,"end_line":3,"end_character":22},"updated":"2018-11-07 17:35:20.000000000","message":"``--before``","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c99fe010bce21372221694014462fee1ac19ea8b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - An option --before has been added to `nova-manage db archive_deleted_rows`"},{"line_number":4,"context_line":"    command. This options limits archival of records to those deleted before"},{"line_number":5,"context_line":"    specified date."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"3f79a3b5_a06bccb5","line":4,"range":{"start_line":4,"start_character":70,"end_line":4,"end_character":76},"updated":"2018-11-07 19:22:38.000000000","message":"As noted inline, it\u0027s actually doing before or equal to, which is misleading and inconsistent with --before on the purge command. We should make it behave the same way as the purge command.","commit_id":"8590e4720a100f26e9234182c52cbf2eb0256fd7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"05ee13fee2eece4e73e1e526826badcb7ba84e1d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - An option ``--before`` has been added to `nova-manage db archive_deleted_rows`"},{"line_number":4,"context_line":"    command. This options limits archival of records to those deleted before"},{"line_number":5,"context_line":"    specified date."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"5fc1f717_8daf422a","line":4,"range":{"start_line":4,"start_character":33,"end_line":4,"end_character":41},"updated":"2019-04-02 21:33:27.000000000","message":"archiving","commit_id":"190f169c5bea8a8760889eb321c930a6fa98204c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"05ee13fee2eece4e73e1e526826badcb7ba84e1d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - An option ``--before`` has been added to `nova-manage db archive_deleted_rows`"},{"line_number":4,"context_line":"    command. This options limits archival of records to those deleted before"},{"line_number":5,"context_line":"    specified date."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"5fc1f717_adac7e35","line":4,"range":{"start_line":4,"start_character":70,"end_line":4,"end_character":76},"updated":"2019-04-02 21:33:27.000000000","message":"before the","commit_id":"190f169c5bea8a8760889eb321c930a6fa98204c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0d44dc7c25f5a3a0345bed61b0614231fd97ef71","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - An option ``--before`` has been added to "},{"line_number":4,"context_line":"    `nova-manage db archive_deleted_rows` command. This options limits"},{"line_number":5,"context_line":"    archiving of records to  those deleted before the specified date."}],"source_content_type":"text/x-yaml","patch_set":13,"id":"bfb3d3c7_a998e81a","line":3,"range":{"start_line":3,"start_character":44,"end_line":3,"end_character":45},"updated":"2019-05-22 13:52:36.000000000","message":"trailing whitespace","commit_id":"1aec8c7465b11dff06ffee022e5b7925000f53af"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b7ec3316baa494395e065db2a5fd2a1a4b5bf87e","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - An option ``--before`` has been added to"},{"line_number":4,"context_line":"    `nova-manage db archive_deleted_rows` command. This options limits"},{"line_number":5,"context_line":"    archiving of records to  those deleted before the specified date."}],"source_content_type":"text/x-yaml","patch_set":14,"id":"bfb3d3c7_32a99023","line":5,"range":{"start_line":5,"start_character":27,"end_line":5,"end_character":29},"updated":"2019-05-24 13:16:14.000000000","message":"extra space","commit_id":"e822360b6696c492bb583240483ee9593d7d24e1"}]}
