)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"6270fe907126276724a2781628500ac5320d8518","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     GeetikaBatra \u003cgeetika791@yahoo.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-11 23:37:00 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add a task_scrub function"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently there is no mechanism for deleting tasks on regular basis."},{"line_number":10,"context_line":"Task scrubber function is called in the tasks_get_all function, so that"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1a4dcd0f_4e4eed38","line":7,"updated":"2015-08-13 13:40:09.000000000","message":"Please change this to \"Add soft delete functionality for tasks\", since that\u0027s what you\u0027re actually doing.","commit_id":"451c6afcfac63b7df11f66a3cdc2c39c6a56234e"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"6270fe907126276724a2781628500ac5320d8518","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add a task_scrub function"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently there is no mechanism for deleting tasks on regular basis."},{"line_number":10,"context_line":"Task scrubber function is called in the tasks_get_all function, so that"},{"line_number":11,"context_line":"everytime tasks lists are called, the function checks if tasks in"},{"line_number":12,"context_line":"the database have surpassed the expired_at value. If that is the"},{"line_number":13,"context_line":"case, then it sets the delete value as 0 for all the expired tasks."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1a4dcd0f_aeda1149","line":10,"updated":"2015-08-13 13:40:09.000000000","message":"How about, \"This patch adds a new function that is called ...\"","commit_id":"451c6afcfac63b7df11f66a3cdc2c39c6a56234e"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cb6434dfa2e8f908e4cad0c51d0354a55cc2e0c3","unresolved":false,"context_lines":[{"line_number":10,"context_line":"This patch adds a new function that is called in the tasks_get_all"},{"line_number":11,"context_line":"function, so that everytime tasks lists are called, the function"},{"line_number":12,"context_line":"checks if tasks in the database have surpassed the expired_at value."},{"line_number":13,"context_line":"If that is the case, then it sets the delete value as 0 for all the"},{"line_number":14,"context_line":"expired tasks."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I0bde982de948901f6bfbfab9e57cf84891c22052"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa1b9901_64a3689f","line":13,"updated":"2015-08-24 19:43:24.000000000","message":"the proposed code set\u0027s it to 1.","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cb6434dfa2e8f908e4cad0c51d0354a55cc2e0c3","unresolved":false,"context_lines":[{"line_number":12,"context_line":"checks if tasks in the database have surpassed the expired_at value."},{"line_number":13,"context_line":"If that is the case, then it sets the delete value as 0 for all the"},{"line_number":14,"context_line":"expired tasks."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I0bde982de948901f6bfbfab9e57cf84891c22052"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa1b9901_5f3ab1ce","line":15,"updated":"2015-08-24 19:43:24.000000000","message":"I would expect us having spec for this, so we would need the flag for that as well.","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"daf0d9497d753f787e441a63d878c8da75502f5a","unresolved":false,"context_lines":[{"line_number":14,"context_line":"expired tasks."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Co-Authored-By: Mike Fedosin \u003cmfedosin@mirantis.com\u003e"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I0bde982de948901f6bfbfab9e57cf84891c22052"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"7aa08908_2c6312de","line":17,"updated":"2016-06-06 16:00:46.000000000","message":"add the link to the lite-spec\n\nImplements \u003clite-spec link\u003e","commit_id":"980adb6d95aedff1f741879a6d73d3170ec871fb"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6136036a27a24886e14822b6803b5865893e5589","unresolved":false,"context_lines":[{"line_number":10,"context_line":"This patch adds a new function that is called in the tasks_get_all"},{"line_number":11,"context_line":"function, so that everytime tasks lists are called, the function"},{"line_number":12,"context_line":"checks if tasks in the database have surpassed the expired_at value."},{"line_number":13,"context_line":"If that is the case, then it sets the delete value as 0 for all the"},{"line_number":14,"context_line":"expired tasks."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Co-Authored-By: Mike Fedosin \u003cmfedosin@mirantis.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"7aa08908_d1312d0d","line":13,"range":{"start_line":13,"start_character":38,"end_line":13,"end_character":44},"updated":"2016-06-07 04:07:37.000000000","message":"deleted?","commit_id":"756cb23402b3c54e9fd2d907b3b0a88e271abc15"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6136036a27a24886e14822b6803b5865893e5589","unresolved":false,"context_lines":[{"line_number":10,"context_line":"This patch adds a new function that is called in the tasks_get_all"},{"line_number":11,"context_line":"function, so that everytime tasks lists are called, the function"},{"line_number":12,"context_line":"checks if tasks in the database have surpassed the expired_at value."},{"line_number":13,"context_line":"If that is the case, then it sets the delete value as 0 for all the"},{"line_number":14,"context_line":"expired tasks."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Co-Authored-By: Mike Fedosin \u003cmfedosin@mirantis.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"7aa08908_7154b920","line":13,"range":{"start_line":13,"start_character":54,"end_line":13,"end_character":55},"updated":"2016-06-07 04:07:37.000000000","message":"this should be 1 IMO","commit_id":"756cb23402b3c54e9fd2d907b3b0a88e271abc15"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"76f9fd6845bf16a907e903e7c98d5cc5527e0bc6","unresolved":false,"context_lines":[{"line_number":10,"context_line":"This patch adds a new function that is called in the tasks_get_all"},{"line_number":11,"context_line":"function, so that everytime tasks lists are called, the function"},{"line_number":12,"context_line":"checks if tasks in the database have surpassed the expired_at value."},{"line_number":13,"context_line":"If that is the case, then it sets the delete value as 0 for all the"},{"line_number":14,"context_line":"expired tasks."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Co-Authored-By: Mike Fedosin \u003cmfedosin@mirantis.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"7aa08908_6f02100d","line":13,"range":{"start_line":13,"start_character":38,"end_line":13,"end_character":55},"updated":"2016-06-07 05:48:47.000000000","message":"needs to be changed to \"deleted value as 1\"","commit_id":"a0b0fe4b066541601dd3496b8fe009344de5ca8f"}],"glance/db/simple/api.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5a88d0da1a6df05d2712e95e285079b1627dbf5b","unresolved":false,"context_lines":[{"line_number":966,"context_line":"    tasks \u003d DATA[\u0027tasks\u0027].values()"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"    for task in tasks:"},{"line_number":969,"context_line":"        if task[\u0027owner\u0027] \u003d\u003d context.owner \\"},{"line_number":970,"context_line":"                and task[\u0027deleted\u0027] \u003d\u003d False and task[\u0027expires_at\u0027] \u003c\u003d now:"},{"line_number":971,"context_line":""},{"line_number":972,"context_line":"            task[\u0027deleted\u0027] \u003d True"}],"source_content_type":"text/x-python","patch_set":20,"id":"9abb7d3a_e2866b15","line":969,"range":{"start_line":969,"start_character":42,"end_line":969,"end_character":43},"updated":"2016-06-02 11:51:12.000000000","message":"nit:\navoid using \\ for continuing, please refer http://docs.openstack.org/developer/hacking/#general","commit_id":"887eed2f5fc5d82ce37724238af5aeb7e38c1c17"}],"glance/db/sqlalchemy/api.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"00642569db247adf83b6ec572502723d0e1ead54","unresolved":false,"context_lines":[{"line_number":1321,"context_line":"        sa_orm.joinedload(models.Task.info)"},{"line_number":1322,"context_line":"    ).filter_by(deleted\u003d0)"},{"line_number":1323,"context_line":" "},{"line_number":1324,"context_line":"    query \u003d query.filter_by(expired_at\u003c\u003dcurrent_date)"},{"line_number":1325,"context_line":"    "},{"line_number":1326,"context_line":"    for each_row in query:"},{"line_number":1327,"context_line":"        each_row.deleted\u003d1"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_c501ee07","line":1324,"updated":"2015-08-05 15:02:22.000000000","message":"this variable is \n\n\"expires_at\" . so you have a typo here for expired_at","commit_id":"59c4d8d8116ddea2837245a920e4584e100dc27b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"1288a2047967e8a50f5f379f9a2ea53ec876b990","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import threading"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import datetime"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"from oslo_config import cfg"},{"line_number":29,"context_line":"from oslo_db import exception as db_exception"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a4dcd0f_78b63dfa","line":26,"updated":"2015-08-06 17:11:37.000000000","message":"pep8 may fail here for not adhering to alphabetical ordering","commit_id":"12f1ac2104a7fe3613f46cc37e93c3676eaccc65"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"1288a2047967e8a50f5f379f9a2ea53ec876b990","unresolved":false,"context_lines":[{"line_number":1319,"context_line":"    query \u003d session.query(models.Task)"},{"line_number":1320,"context_line":"    query \u003d query.filter_by(deleted \u003d 0)"},{"line_number":1321,"context_line":"    current_date \u003d datetime.datetime.utcnow "},{"line_number":1322,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1323,"context_line":""},{"line_number":1324,"context_line":"    for each_row in query:"},{"line_number":1325,"context_line":"        each_row.deleted \u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a4dcd0f_58fd816c","line":1322,"updated":"2015-08-06 17:11:37.000000000","message":"Looks like we are trying to scrub tasks of all users here, is that the intention? I\u0027d imagine we\u0027d want to scrub tasks belonging only to the user in question, right?","commit_id":"12f1ac2104a7fe3613f46cc37e93c3676eaccc65"},{"author":{"_account_id":9096,"name":"Cindy Pallares","email":"u1@cindy.sh","username":"cpallares"},"change_message_id":"21a4f3ea21304bc8a041b7e65f48cfbaf64df01e","unresolved":false,"context_lines":[{"line_number":1322,"context_line":"    if not (context.is_admin or admin_as_user) and context.owner is not None:"},{"line_number":1323,"context_line":"        query \u003d query.filter(models.Task.owner \u003d\u003d context.owner)"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"    query \u003d query.filter_by(deleted \u003d 0)"},{"line_number":1326,"context_line":"    current_date \u003d datetime.datetime.utcnow() "},{"line_number":1327,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1328,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_1d68af86","line":1325,"updated":"2015-08-11 04:01:43.000000000","message":"deleted\u003d0 (there shouldn\u0027t be spaces)","commit_id":"4f4cab7ef01fb80cf3a95894fbbc6652c19ea9b8"},{"author":{"_account_id":9096,"name":"Cindy Pallares","email":"u1@cindy.sh","username":"cpallares"},"change_message_id":"21a4f3ea21304bc8a041b7e65f48cfbaf64df01e","unresolved":false,"context_lines":[{"line_number":1323,"context_line":"        query \u003d query.filter(models.Task.owner \u003d\u003d context.owner)"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"    query \u003d query.filter_by(deleted \u003d 0)"},{"line_number":1326,"context_line":"    current_date \u003d datetime.datetime.utcnow() "},{"line_number":1327,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1328,"context_line":""},{"line_number":1329,"context_line":"    for each_row in query:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_3d69ebbe","line":1326,"updated":"2015-08-11 04:01:43.000000000","message":"You should delete the trailing white space here to pass the tests.","commit_id":"4f4cab7ef01fb80cf3a95894fbbc6652c19ea9b8"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"85c63c9e8493d5d7c1ca0e28ba1cfb142da33faf","unresolved":false,"context_lines":[{"line_number":1327,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1328,"context_line":""},{"line_number":1329,"context_line":"    for each_row in query:"},{"line_number":1330,"context_line":"        each_row.deleted \u003d 1"},{"line_number":1331,"context_line":"    return"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_c8d81e21","line":1330,"updated":"2015-08-11 16:26:27.000000000","message":"Do we want to set deleted_at as well?","commit_id":"2ee5a3158d32721564ba942f03b7ab10767b3855"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"85c63c9e8493d5d7c1ca0e28ba1cfb142da33faf","unresolved":false,"context_lines":[{"line_number":1346,"context_line":"                      if it were a regular user"},{"line_number":1347,"context_line":"    :return: tasks set"},{"line_number":1348,"context_line":"    \"\"\""},{"line_number":1349,"context_line":"    task_soft_delete(context)"},{"line_number":1350,"context_line":""},{"line_number":1351,"context_line":"    filters \u003d filters or {}"},{"line_number":1352,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_486aceee","line":1349,"updated":"2015-08-11 16:26:27.000000000","message":"Since this has performance issues on listing tasks, I\u0027m wondering if there are any ways to do this after we return the tasks. I mean, we get all the tasks like we do now, but we filter out the ones that are expired and return the result to the user so that there is minimal impact on the list call. And, then, if we have any tasks to scrub, we do it after we return the result. \n\nCan you think on those lines? I\u0027ll give it more thought too.\n\nHow about making this configurable? Just to turn off the performance impact if I, as a deployer, don\u0027t care about scrubbing tasks or I probably have my own way of scrubbing tasks (I know, this is yet another configuration option!)","commit_id":"2ee5a3158d32721564ba942f03b7ab10767b3855"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"e996b580c5f0498d3f8ca0c5aa108db685bac4d9","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\"Defines interface for DB access.\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import datetime"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import threading"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_8a1b731c","line":24,"updated":"2015-08-13 17:45:59.000000000","message":"don\u0027t import here.\n\nuse the oslo_utils.timeutils module linked below. it will have a iso time method to give you current time in utc","commit_id":"b8b29803cf06f2dba89f84274aa0d1dcf56da243"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"e996b580c5f0498d3f8ca0c5aa108db685bac4d9","unresolved":false,"context_lines":[{"line_number":1313,"context_line":"    return _task_format(task_ref, task_ref.info)"},{"line_number":1314,"context_line":""},{"line_number":1315,"context_line":""},{"line_number":1316,"context_line":"def task_soft_delete(context, session\u003dNone, admin_as_user\u003dFalse):"},{"line_number":1317,"context_line":"    \"\"\"Scrubs task entity which are expired \"\"\""},{"line_number":1318,"context_line":"    expires_at \u003d models.Task.expires_at"},{"line_number":1319,"context_line":"    session \u003d session or get_session()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_6fae3931","line":1316,"updated":"2015-08-13 17:45:59.000000000","message":"make this private by prefixing method name with _\n\nit will look like:\n\n    def _task_soft_delete(...):","commit_id":"b8b29803cf06f2dba89f84274aa0d1dcf56da243"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bf15bf7634e6532a15cfda3c3333cd2435cbfb49","unresolved":false,"context_lines":[{"line_number":1316,"context_line":"def task_soft_delete(context, session\u003dNone, admin_as_user\u003dFalse):"},{"line_number":1317,"context_line":"    \"\"\"Scrubs task entity which are expired \"\"\""},{"line_number":1318,"context_line":"    expires_at \u003d models.Task.expires_at"},{"line_number":1319,"context_line":"    session \u003d session or get_session()"},{"line_number":1320,"context_line":"    query \u003d session.query(models.Task)"},{"line_number":1321,"context_line":""},{"line_number":1322,"context_line":"    if not (context.is_admin or admin_as_user) and context.owner is not None:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_739db665","line":1319,"updated":"2015-08-13 22:40:30.000000000","message":"If you are getting the session here, there is no use declaring it as a param.","commit_id":"b8b29803cf06f2dba89f84274aa0d1dcf56da243"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bf15bf7634e6532a15cfda3c3333cd2435cbfb49","unresolved":false,"context_lines":[{"line_number":1319,"context_line":"    session \u003d session or get_session()"},{"line_number":1320,"context_line":"    query \u003d session.query(models.Task)"},{"line_number":1321,"context_line":""},{"line_number":1322,"context_line":"    if not (context.is_admin or admin_as_user) and context.owner is not None:"},{"line_number":1323,"context_line":"        query \u003d query.filter(models.Task.owner \u003d\u003d context.owner)"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"    query \u003d query.filter_by(deleted\u003d0)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_73ab7676","line":1322,"updated":"2015-08-13 22:40:30.000000000","message":"There is something off here. I know that you are re-using the logic from tasks_get_all method, but looks like there maybe a bug in the logic around admin_as_user. \nWith admin_as_user, we want to list all the tasks of a particular user. But, when admin_as_user is set, the \u0027if\u0027 evaluates to false and we don\u0027t add the owner filter on the query. This fetches all the tasks, which is probably not the intended behavior. \n\nI have to double check this, though.","commit_id":"b8b29803cf06f2dba89f84274aa0d1dcf56da243"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"e996b580c5f0498d3f8ca0c5aa108db685bac4d9","unresolved":false,"context_lines":[{"line_number":1328,"context_line":""},{"line_number":1329,"context_line":"    for each_row in query:"},{"line_number":1330,"context_line":"        each_row.deleted \u003d 1"},{"line_number":1331,"context_line":"        each_row.deleted_at \u003d datetime.datetime.utcnow()"},{"line_number":1332,"context_line":"    return"},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_8a9e1353","line":1331,"updated":"2015-08-13 17:45:59.000000000","message":"Where are you updating this as a part of transaction? Please point out any obvious as I don\u0027t see the commits to the DB to delete the model.","commit_id":"b8b29803cf06f2dba89f84274aa0d1dcf56da243"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bf15bf7634e6532a15cfda3c3333cd2435cbfb49","unresolved":false,"context_lines":[{"line_number":1347,"context_line":"                      if it were a regular user"},{"line_number":1348,"context_line":"    :return: tasks set"},{"line_number":1349,"context_line":"    \"\"\""},{"line_number":1350,"context_line":"    task_soft_delete(context)"},{"line_number":1351,"context_line":""},{"line_number":1352,"context_line":"    filters \u003d filters or {}"},{"line_number":1353,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_73c6166a","line":1350,"updated":"2015-08-13 22:40:30.000000000","message":"We should pass admin_as_user param here.","commit_id":"b8b29803cf06f2dba89f84274aa0d1dcf56da243"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cb6434dfa2e8f908e4cad0c51d0354a55cc2e0c3","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\"Defines interface for DB access.\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"import threading"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_24ad7088","line":24,"updated":"2015-08-24 19:43:24.000000000","message":"Why?","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cb6434dfa2e8f908e4cad0c51d0354a55cc2e0c3","unresolved":false,"context_lines":[{"line_number":1323,"context_line":""},{"line_number":1324,"context_line":"    query \u003d query.filter_by(deleted\u003d0)"},{"line_number":1325,"context_line":"    current_date \u003d timeutils.utcnow()"},{"line_number":1326,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1327,"context_line":""},{"line_number":1328,"context_line":"    for each_row in query:"},{"line_number":1329,"context_line":"        each_row.deleted \u003d 1"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_e511b2b0","line":1326,"updated":"2015-08-24 19:43:24.000000000","message":"the \"current_date\" is bit misleading here as we get actual utc time instead of just a date from timeutils. We refer anything that has expired_at before or exactly moment ago, not before or exactly today.","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cb6434dfa2e8f908e4cad0c51d0354a55cc2e0c3","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"    current_date \u003d timeutils.utcnow()"},{"line_number":1326,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1327,"context_line":""},{"line_number":1328,"context_line":"    for each_row in query:"},{"line_number":1329,"context_line":"        each_row.deleted \u003d 1"},{"line_number":1330,"context_line":"        each_row.deleted_at \u003d timeutils.utcnow()"},{"line_number":1331,"context_line":"    return"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_a56c1a09","line":1328,"updated":"2015-08-24 19:43:24.000000000","message":"Consistency: row instead of each_row, please","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cb6434dfa2e8f908e4cad0c51d0354a55cc2e0c3","unresolved":false,"context_lines":[{"line_number":1327,"context_line":""},{"line_number":1328,"context_line":"    for each_row in query:"},{"line_number":1329,"context_line":"        each_row.deleted \u003d 1"},{"line_number":1330,"context_line":"        each_row.deleted_at \u003d timeutils.utcnow()"},{"line_number":1331,"context_line":"    return"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_057ce6e9","line":1330,"updated":"2015-08-24 19:43:24.000000000","message":"Why now rather than same time with expired_at?","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"459aae7c2fd372c250aff2c803399f40f82e7892","unresolved":false,"context_lines":[{"line_number":1346,"context_line":"                      if it were a regular user"},{"line_number":1347,"context_line":"    :return: tasks set"},{"line_number":1348,"context_line":"    \"\"\""},{"line_number":1349,"context_line":"    _task_soft_delete(context\u003dcontext, admin_as_user\u003dadmin_as_user)"},{"line_number":1350,"context_line":""},{"line_number":1351,"context_line":"    filters \u003d filters or {}"},{"line_number":1352,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_9959495e","line":1349,"updated":"2015-08-24 17:58:21.000000000","message":"Context is not a keyword argument for \u0027_task_soft_delete\u0027.","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"cb6434dfa2e8f908e4cad0c51d0354a55cc2e0c3","unresolved":false,"context_lines":[{"line_number":1346,"context_line":"                      if it were a regular user"},{"line_number":1347,"context_line":"    :return: tasks set"},{"line_number":1348,"context_line":"    \"\"\""},{"line_number":1349,"context_line":"    _task_soft_delete(context\u003dcontext, admin_as_user\u003dadmin_as_user)"},{"line_number":1350,"context_line":""},{"line_number":1351,"context_line":"    filters \u003d filters or {}"},{"line_number":1352,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_c5a10e48","line":1349,"in_reply_to":"fa1b9901_9959495e","updated":"2015-08-24 19:43:24.000000000","message":"Hemanth, that\u0027s not a problem, really. But consistency wise it would make sense to drop the context\u003d","commit_id":"856f3fcd1873ce0878946428a1bf775f026695ae"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"1bbd89f6052511212f706fa8461d897aa6b2df90","unresolved":false,"context_lines":[{"line_number":1321,"context_line":"    if not (context.is_admin or admin_as_user) and context.owner is not None:"},{"line_number":1322,"context_line":"        query \u003d query.filter(models.Task.owner \u003d\u003d context.owner)"},{"line_number":1323,"context_line":""},{"line_number":1324,"context_line":"    query \u003d query.filter_by(deleted\u003d0)"},{"line_number":1325,"context_line":"    current_date \u003d timeutils.utcnow()"},{"line_number":1326,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1327,"context_line":"    for each_row in query:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a26ad4f_85a0f244","line":1324,"updated":"2015-10-30 03:18:41.000000000","message":"\u0027deleted\u003dFalse\u0027 is more preferable.","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"1bbd89f6052511212f706fa8461d897aa6b2df90","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"    current_date \u003d timeutils.utcnow()"},{"line_number":1326,"context_line":"    query \u003d query.filter(expires_at \u003c\u003d current_date)"},{"line_number":1327,"context_line":"    for each_row in query:"},{"line_number":1328,"context_line":"        each_row.deleted \u003d 1"},{"line_number":1329,"context_line":"        each_row.deleted_at \u003d timeutils.utcnow()"},{"line_number":1330,"context_line":"    return"},{"line_number":1331,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1a26ad4f_c5bd8a69","line":1328,"updated":"2015-10-30 03:18:41.000000000","message":"\u0027deleted \u003d True\u0027","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a0769448627db0ea0bc14bf5decdcdc8c97d1ce0","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\"Defines interface for DB access.\"\"\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"import threading"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_cce92cb9","line":24,"updated":"2015-12-01 20:32:21.000000000","message":"unnecessary addition","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a0769448627db0ea0bc14bf5decdcdc8c97d1ce0","unresolved":false,"context_lines":[{"line_number":1328,"context_line":"    query \u003d session.query(models.Task)"},{"line_number":1329,"context_line":""},{"line_number":1330,"context_line":"    if not (context.is_admin or admin_as_user) and context.owner is not None:"},{"line_number":1331,"context_line":"        query \u003d query.filter(models.Task.owner \u003d\u003d context.owner)"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":"    query \u003d query.filter_by(deleted\u003d0)"},{"line_number":1334,"context_line":"    current_date \u003d timeutils.utcnow()"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_8c77a43a","line":1331,"updated":"2015-12-01 20:32:21.000000000","message":"if condition not needed, this method needs to be after the first check on line 1364 below.","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a0769448627db0ea0bc14bf5decdcdc8c97d1ce0","unresolved":false,"context_lines":[{"line_number":1336,"context_line":"    for each_row in query:"},{"line_number":1337,"context_line":"        each_row.deleted \u003d 1"},{"line_number":1338,"context_line":"        each_row.deleted_at \u003d timeutils.utcnow()"},{"line_number":1339,"context_line":"    return"},{"line_number":1340,"context_line":""},{"line_number":1341,"context_line":""},{"line_number":1342,"context_line":"def task_get_all(context, filters\u003dNone, marker\u003dNone, limit\u003dNone,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_0c8bb41f","line":1339,"updated":"2015-12-01 20:32:21.000000000","message":"python returns none by default, there\u0027s no explicit requirement for return. \n\nAlso, you don\u0027t need to return anything here. You need to pass the query object reference so the same query will be updated.","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a0769448627db0ea0bc14bf5decdcdc8c97d1ce0","unresolved":false,"context_lines":[{"line_number":1354,"context_line":"                      if it were a regular user"},{"line_number":1355,"context_line":"    :return: tasks set"},{"line_number":1356,"context_line":"    \"\"\""},{"line_number":1357,"context_line":"    _task_soft_delete(context, admin_as_user\u003dadmin_as_user)"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"    filters \u003d filters or {}"},{"line_number":1360,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_9b46fc1f","line":1357,"updated":"2015-12-01 20:32:21.000000000","message":"This logic is incorrect.\n\nYou need to move this method after you have \n\n    1. instantiated the session,\n    2. gotten a query (python object) instance,\n    3. verified the context.\n\nAlso, you need to pass the query object reference to the method. This would ensure the same query will be used to delete and list the tasks.","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a0769448627db0ea0bc14bf5decdcdc8c97d1ce0","unresolved":false,"context_lines":[{"line_number":1362,"context_line":"    query \u003d session.query(models.Task)"},{"line_number":1363,"context_line":""},{"line_number":1364,"context_line":"    if not (context.is_admin or admin_as_user) and context.owner is not None:"},{"line_number":1365,"context_line":"        query \u003d query.filter(models.Task.owner \u003d\u003d context.owner)"},{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"    showing_deleted \u003d False"},{"line_number":1368,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_5b6734b7","line":1365,"updated":"2015-12-01 20:32:21.000000000","message":"add the soft delete stuff here","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"1bae22ea4ee0edb3fbe50001149c6315e74b6258","unresolved":false,"context_lines":[{"line_number":1475,"context_line":"    session \u003d get_session()"},{"line_number":1476,"context_line":"    query \u003d session.query(models.Task)"},{"line_number":1477,"context_line":""},{"line_number":1478,"context_line":"    if not (context.is_admin or admin_as_user) and context.owner is not None:"},{"line_number":1479,"context_line":"        query \u003d query.filter(models.Task.owner \u003d\u003d context.owner)"},{"line_number":1480,"context_line":""},{"line_number":1481,"context_line":"    _task_soft_delete(context, session\u003dsession)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9abb7d3a_af451071","line":1478,"range":{"start_line":1478,"start_character":4,"end_line":1478,"end_character":77},"updated":"2016-05-30 19:31:24.000000000","message":"I think a part of this code isn\u0027t needed now that tasks are considered admin only but that can come as a part separate patch.","commit_id":"63346e2f2f3eb5fb4cc5980daae2500f7691a9c6"}],"glance/tests/functional/db/base.py":[{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"f781f3ebe570f6efc65a30692a83f95b3fc3a459","unresolved":false,"context_lines":[{"line_number":1750,"context_line":"        fixture3 \u003d build_task_fixture(id\u003d\u00273\u0027, expires_at\u003dthen,"},{"line_number":1751,"context_line":"                                      owner\u003dself.adm_context.owner)"},{"line_number":1752,"context_line":"        fixture4 \u003d build_task_fixture(id\u003d\u00274\u0027, expires_at\u003dthen,"},{"line_number":1753,"context_line":"                                      owner\u003dself.adm_context.owner)"},{"line_number":1754,"context_line":""},{"line_number":1755,"context_line":"        task1 \u003d self.db_api.task_create(self.adm_context, fixture1)"},{"line_number":1756,"context_line":"        task2 \u003d self.db_api.task_create(self.adm_context, fixture2)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9abb7d3a_036fe22b","line":1753,"updated":"2016-05-30 15:15:06.000000000","message":"Why are there four tests? Was it it check that the image would not get deleted if listed by a different owner? Becuase if so that would be a good test to add.","commit_id":"63346e2f2f3eb5fb4cc5980daae2500f7691a9c6"},{"author":{"_account_id":15062,"name":"GB21","email":"geetika791@gmail.com","username":"GB21"},"change_message_id":"634a807d81cf39ea50fe0fdffd82eb6a1a861d11","unresolved":false,"context_lines":[{"line_number":1750,"context_line":"        fixture3 \u003d build_task_fixture(id\u003d\u00273\u0027, expires_at\u003dthen,"},{"line_number":1751,"context_line":"                                      owner\u003dself.adm_context.owner)"},{"line_number":1752,"context_line":"        fixture4 \u003d build_task_fixture(id\u003d\u00274\u0027, expires_at\u003dthen,"},{"line_number":1753,"context_line":"                                      owner\u003dself.adm_context.owner)"},{"line_number":1754,"context_line":""},{"line_number":1755,"context_line":"        task1 \u003d self.db_api.task_create(self.adm_context, fixture1)"},{"line_number":1756,"context_line":"        task2 \u003d self.db_api.task_create(self.adm_context, fixture2)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9abb7d3a_52dd2e0d","line":1753,"in_reply_to":"9abb7d3a_036fe22b","updated":"2016-05-30 17:00:59.000000000","message":"Hi Niall, tasks are admin only ; these tests are for a particular subset of tasks which are checked for their expiry status and subsequent deletion on the basis of that; I don\u0027t think we need to check for different owners.","commit_id":"63346e2f2f3eb5fb4cc5980daae2500f7691a9c6"}],"glance/tests/unit/test_db.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6b8eda0920602d74ed1015e66d238fc88b8b2199","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import mock"},{"line_number":20,"context_line":"from oslo_config import cfg"},{"line_number":21,"context_line":"from oslo_db import exception as db_exc"},{"line_number":22,"context_line":"from oslo_utils import encodeutils"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from glance.common import crypt"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a2fa921_f902a10a","line":21,"updated":"2015-10-07 17:28:37.000000000","message":"you need to import oslo timeutils here to avoid current test failures.","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6b8eda0920602d74ed1015e66d238fc88b8b2199","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        \u0027owner\u0027: None,"},{"line_number":117,"context_line":"        \u0027message\u0027: None,"},{"line_number":118,"context_line":"        \u0027deleted\u0027: False,"},{"line_number":119,"context_line":"        \u0027expires_at\u0027: times.utilis.now(),        "},{"line_number":120,"context_line":"    }"},{"line_number":121,"context_line":"    obj.update(kwargs)"},{"line_number":122,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a2fa921_59b71586","line":119,"updated":"2015-10-07 17:28:37.000000000","message":"extra ws","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"1bbd89f6052511212f706fa8461d897aa6b2df90","unresolved":false,"context_lines":[{"line_number":610,"context_line":"                             result\u003d\u0027\u0027,"},{"line_number":611,"context_line":"                             owner\u003dTENANT1,"},{"line_number":612,"context_line":"                             message\u003d\u0027\u0027,"},{"line_number":613,"context_line":"                             expires_at\u003dtimeutils.set_time_override(override_time\u003ddatetime.datetime(2012, 9, 21, 22, 2, 52, 864317))"},{"line_number":614,"context_line":"                             ),"},{"line_number":615,"context_line":"            _db_task_fixture(UUID2, type\u003d\u0027import\u0027, status\u003d\u0027processing\u0027,"},{"line_number":616,"context_line":"                             input\u003dself.fake_task_input,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a26ad4f_f9514b0f","line":613,"updated":"2015-10-30 03:18:41.000000000","message":"These values are the same, so create a variable, please.","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6b8eda0920602d74ed1015e66d238fc88b8b2199","unresolved":false,"context_lines":[{"line_number":617,"context_line":"                             result\u003d\u0027\u0027,"},{"line_number":618,"context_line":"                             owner\u003dTENANT1,"},{"line_number":619,"context_line":"                             message\u003d\u0027\u0027,"},{"line_number":620,"context_line":"                             expires_at\u003dtimeutils.set_time_override(override_time\u003ddatetime.datetime(2012, 9, 21, 22, 2, 52, 864317))"},{"line_number":621,"context_line":"                             ),"},{"line_number":622,"context_line":"            _db_task_fixture(UUID3, type\u003d\u0027import\u0027, status\u003d\u0027failure\u0027,"},{"line_number":623,"context_line":"                             input\u003dself.fake_task_input,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a2fa921_19b2fd94","line":620,"updated":"2015-10-07 17:28:37.000000000","message":"these are pep8 failures","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6b8eda0920602d74ed1015e66d238fc88b8b2199","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                             result\u003d\u0027\u0027,"},{"line_number":625,"context_line":"                             owner\u003dTENANT1,"},{"line_number":626,"context_line":"                             message\u003d\u0027\u0027,"},{"line_number":627,"context_line":"                             expires_at\u003dtimeutils.set_time_override(override_time\u003ddatetime.datetime(2016, 9, 21, 22, 2, 52, 864317))"},{"line_number":628,"context_line":"                             ),"},{"line_number":629,"context_line":"            _db_task_fixture(UUID4, type\u003d\u0027import\u0027, status\u003d\u0027success\u0027,"},{"line_number":630,"context_line":"                             input\u003dself.fake_task_input,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a2fa921_d9ab251c","line":627,"updated":"2015-10-07 17:28:37.000000000","message":"ditto","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6b8eda0920602d74ed1015e66d238fc88b8b2199","unresolved":false,"context_lines":[{"line_number":631,"context_line":"                             result\u003d\u0027\u0027,"},{"line_number":632,"context_line":"                             owner\u003dTENANT2,"},{"line_number":633,"context_line":"                             message\u003d\u0027\u0027,"},{"line_number":634,"context_line":"                             expires_at\u003dtimeutils.set_time_override(override_time\u003ddatetime.datetime(2016, 9, 21, 22, 2, 52, 864317))"},{"line_number":635,"context_line":"                             ),"},{"line_number":636,"context_line":"        ]"},{"line_number":637,"context_line":"        [self.db.task_create(None, task) for task in self.tasks]"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a2fa921_f9a62152","line":634,"updated":"2015-10-07 17:28:37.000000000","message":"ditto","commit_id":"ffe8b5651aaca555e299b375467f0872e64adbfc"},{"author":{"_account_id":17976,"name":"Drew Varner","email":"avarner@linux.vnet.ibm.com","username":"avarner"},"change_message_id":"90d518c1555e4fd51cf1fd4d0aca0deddadbb8ac","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        \u0027owner\u0027: None,"},{"line_number":119,"context_line":"        \u0027message\u0027: None,"},{"line_number":120,"context_line":"        \u0027deleted\u0027: False,"},{"line_number":121,"context_line":"        \u0027expires_at\u0027: timeutils.now(),        "},{"line_number":122,"context_line":"    }"},{"line_number":123,"context_line":"    obj.update(kwargs)"},{"line_number":124,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba8a016a_ac1dfcbe","line":121,"updated":"2015-11-16 23:19:54.000000000","message":"Extra whitespace at the end of this line is causing the pep8 test to fail (as per Nikhil\u0027s previous comment).","commit_id":"4d3b541e9c02fb37d05c2129e12d94995e05b565"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a0769448627db0ea0bc14bf5decdcdc8c97d1ce0","unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import uuid"},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_2c49d8d0","line":18,"updated":"2015-12-01 20:32:21.000000000","message":"Remove this import. Why not just use the timeutils.isotime() below?","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":17976,"name":"Drew Varner","email":"avarner@linux.vnet.ibm.com","username":"avarner"},"change_message_id":"4fd7b775f16f38021d924dbcecb8332ac00b6705","unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import uuid"},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba8a016a_cf184787","line":18,"updated":"2015-11-17 16:43:51.000000000","message":"This line is causing a pep8 failure. If you run `tox -e pep8` on your own box, and fix all the bugs shown before submitting the next patchset, then the automated pep8 test here will pass too.","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a0769448627db0ea0bc14bf5decdcdc8c97d1ce0","unresolved":false,"context_lines":[{"line_number":612,"context_line":"                             result\u003d\u0027\u0027,"},{"line_number":613,"context_line":"                             owner\u003dTENANT1,"},{"line_number":614,"context_line":"                             message\u003d\u0027\u0027,"},{"line_number":615,"context_line":"                             expires_at\u003dtimeutils.set_time_override(override_time\u003ddatetime.datetime(2012, 9, 21, 22, 2, 52, 864317))"},{"line_number":616,"context_line":"                             ),"},{"line_number":617,"context_line":"            _db_task_fixture(UUID2, type\u003d\u0027import\u0027, status\u003d\u0027processing\u0027,"},{"line_number":618,"context_line":"                             input\u003dself.fake_task_input,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_8c21e4fe","line":615,"updated":"2015-12-01 20:32:21.000000000","message":"Any particular reason to use the datetime import here? See my comment on line 18.","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"4ef1472b001cfa7379cb6d784620bd1ce40da9e1","unresolved":false,"context_lines":[{"line_number":612,"context_line":"                             result\u003d\u0027\u0027,"},{"line_number":613,"context_line":"                             owner\u003dTENANT1,"},{"line_number":614,"context_line":"                             message\u003d\u0027\u0027,"},{"line_number":615,"context_line":"                             expires_at\u003dtimeutils.set_time_override(override_time\u003ddatetime.datetime(2012, 9, 21, 22, 2, 52, 864317))"},{"line_number":616,"context_line":"                             ),"},{"line_number":617,"context_line":"            _db_task_fixture(UUID2, type\u003d\u0027import\u0027, status\u003d\u0027processing\u0027,"},{"line_number":618,"context_line":"                             input\u003dself.fake_task_input,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba8a016a_b212c307","line":615,"updated":"2015-11-18 17:49:21.000000000","message":"Indentation sucks :(","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"4ef1472b001cfa7379cb6d784620bd1ce40da9e1","unresolved":false,"context_lines":[{"line_number":626,"context_line":"                             result\u003d\u0027\u0027,"},{"line_number":627,"context_line":"                             owner\u003dTENANT1,"},{"line_number":628,"context_line":"                             message\u003d\u0027\u0027,"},{"line_number":629,"context_line":"                             expires_at\u003dtimeutils.set_time_override(override_time\u003ddatetime.datetime(2016, 9, 21, 22, 2, 52, 864317))"},{"line_number":630,"context_line":"                             ),"},{"line_number":631,"context_line":"            _db_task_fixture(UUID4, type\u003d\u0027import\u0027, status\u003d\u0027success\u0027,"},{"line_number":632,"context_line":"                             input\u003dself.fake_task_input,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba8a016a_d260a7a7","line":629,"updated":"2015-11-18 17:49:21.000000000","message":"Will this test pass after 2016-9-21? :D","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"4ef1472b001cfa7379cb6d784620bd1ce40da9e1","unresolved":false,"context_lines":[{"line_number":700,"context_line":""},{"line_number":701,"context_line":"    def test_soft_delete_tasks(self):"},{"line_number":702,"context_line":"        tasks \u003d self.task_repo.list()"},{"line_number":703,"context_line":"        task_ids \u003d set([i.task_id for i in tasks])"},{"line_number":704,"context_line":"        self.assertEqual(set([UUID3, UUID4]), task_ids)"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def test_sorted_list(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba8a016a_4dc73c96","line":703,"updated":"2015-11-18 17:49:21.000000000","message":"By default task list is sorted by \u0027created_at\u0027 (https://github.com/openstack/glance/blob/master/glance/db/sqlalchemy/api.py#L1372), so its order is strict. So why just not:\n\nself.assertEqual([UUID3, UUID4], [i.task_id for i in tasks])\n\n?","commit_id":"4b2a0d88e4752a424a780bf255010fb227697601"}],"releasenotes/notes/soft_delete-tasks-43ea983695faa565.yaml":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"1bae22ea4ee0edb3fbe50001149c6315e74b6258","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    as 0 for all the expired tasks."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"},{"line_number":11,"context_line":"  - Only tasks are marked as deleted, and are not"},{"line_number":12,"context_line":"    really deleted, they still exist in the database."},{"line_number":13,"context_line":"    The tasks are not instantly deleted because there"},{"line_number":14,"context_line":"    may be information contained in tje task resource"},{"line_number":15,"context_line":"    that may not be available elsewhere."}],"source_content_type":"text/x-yaml","patch_set":19,"id":"9abb7d3a_e23bafcf","line":12,"range":{"start_line":11,"start_character":4,"end_line":12,"end_character":18},"updated":"2016-05-30 19:31:24.000000000","message":"I think you can rephrase this a bit:\n\nIn Glance you can soft-delete a resource in the Database table. Here, the same happens, the tasks are merely marked as deleted using a deleted flag in the Tasks table and they are not queried on a regular list or show call.","commit_id":"63346e2f2f3eb5fb4cc5980daae2500f7691a9c6"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"1bae22ea4ee0edb3fbe50001149c6315e74b6258","unresolved":false,"context_lines":[{"line_number":11,"context_line":"  - Only tasks are marked as deleted, and are not"},{"line_number":12,"context_line":"    really deleted, they still exist in the database."},{"line_number":13,"context_line":"    The tasks are not instantly deleted because there"},{"line_number":14,"context_line":"    may be information contained in tje task resource"},{"line_number":15,"context_line":"    that may not be available elsewhere."}],"source_content_type":"text/x-yaml","patch_set":19,"id":"9abb7d3a_825bc32d","line":14,"range":{"start_line":14,"start_character":4,"end_line":14,"end_character":22},"updated":"2016-05-30 19:31:24.000000000","message":"information like what? can you give an example?","commit_id":"63346e2f2f3eb5fb4cc5980daae2500f7691a9c6"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"1bae22ea4ee0edb3fbe50001149c6315e74b6258","unresolved":false,"context_lines":[{"line_number":11,"context_line":"  - Only tasks are marked as deleted, and are not"},{"line_number":12,"context_line":"    really deleted, they still exist in the database."},{"line_number":13,"context_line":"    The tasks are not instantly deleted because there"},{"line_number":14,"context_line":"    may be information contained in tje task resource"},{"line_number":15,"context_line":"    that may not be available elsewhere."}],"source_content_type":"text/x-yaml","patch_set":19,"id":"9abb7d3a_223657e6","line":14,"range":{"start_line":14,"start_character":36,"end_line":14,"end_character":39},"updated":"2016-05-30 19:31:24.000000000","message":"the","commit_id":"63346e2f2f3eb5fb4cc5980daae2500f7691a9c6"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"f6a25ff96a9005baa34e772015256e3ef42b1110","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    as 0 for all the expired tasks."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"},{"line_number":11,"context_line":"  - Tasks are soft deleted, in Glance, a resource can"},{"line_number":12,"context_line":"    be soft deleted in the Database Table, these resources"},{"line_number":13,"context_line":"    still exist in the database. The same thing happens"},{"line_number":14,"context_line":"    with tasks; they are marked as deleted using the"}],"source_content_type":"text/x-yaml","patch_set":20,"id":"9abb7d3a_4e4d423d","line":11,"range":{"start_line":11,"start_character":26,"end_line":11,"end_character":27},"updated":"2016-05-31 21:57:17.000000000","message":".","commit_id":"887eed2f5fc5d82ce37724238af5aeb7e38c1c17"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"f6a25ff96a9005baa34e772015256e3ef42b1110","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    as 0 for all the expired tasks."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"},{"line_number":11,"context_line":"  - Tasks are soft deleted, in Glance, a resource can"},{"line_number":12,"context_line":"    be soft deleted in the Database Table, these resources"},{"line_number":13,"context_line":"    still exist in the database. The same thing happens"},{"line_number":14,"context_line":"    with tasks; they are marked as deleted using the"}],"source_content_type":"text/x-yaml","patch_set":20,"id":"9abb7d3a_8e53aae1","line":11,"range":{"start_line":11,"start_character":28,"end_line":11,"end_character":30},"updated":"2016-05-31 21:57:17.000000000","message":"In","commit_id":"887eed2f5fc5d82ce37724238af5aeb7e38c1c17"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"f6a25ff96a9005baa34e772015256e3ef42b1110","unresolved":false,"context_lines":[{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"},{"line_number":11,"context_line":"  - Tasks are soft deleted, in Glance, a resource can"},{"line_number":12,"context_line":"    be soft deleted in the Database Table, these resources"},{"line_number":13,"context_line":"    still exist in the database. The same thing happens"},{"line_number":14,"context_line":"    with tasks; they are marked as deleted using the"},{"line_number":15,"context_line":"    delete flag in the Tasks table which are not queried"},{"line_number":16,"context_line":"    on the regular list or show call. The tasks are not"}],"source_content_type":"text/x-yaml","patch_set":20,"id":"9abb7d3a_2ef8bec2","line":13,"range":{"start_line":12,"start_character":4,"end_line":13,"end_character":32},"updated":"2016-05-31 21:57:17.000000000","message":"be soft deleted in the tables that remain the database.","commit_id":"887eed2f5fc5d82ce37724238af5aeb7e38c1c17"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"f6a25ff96a9005baa34e772015256e3ef42b1110","unresolved":false,"context_lines":[{"line_number":12,"context_line":"    be soft deleted in the Database Table, these resources"},{"line_number":13,"context_line":"    still exist in the database. The same thing happens"},{"line_number":14,"context_line":"    with tasks; they are marked as deleted using the"},{"line_number":15,"context_line":"    delete flag in the Tasks table which are not queried"},{"line_number":16,"context_line":"    on the regular list or show call. The tasks are not"},{"line_number":17,"context_line":"    instantly deleted because there may be information"},{"line_number":18,"context_line":"    contained in the task resource that may not be"}],"source_content_type":"text/x-yaml","patch_set":20,"id":"9abb7d3a_8e01eab1","line":15,"range":{"start_line":15,"start_character":4,"end_line":15,"end_character":10},"updated":"2016-05-31 21:57:17.000000000","message":"deleted","commit_id":"887eed2f5fc5d82ce37724238af5aeb7e38c1c17"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6136036a27a24886e14822b6803b5865893e5589","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    tasks_get_all function, so that everytime tasks"},{"line_number":5,"context_line":"    lists are called, the function checks if tasks in"},{"line_number":6,"context_line":"    the database have surpassed the expired_at value;"},{"line_number":7,"context_line":"    if that is the case, then it marks the delete value"},{"line_number":8,"context_line":"    as 0 for all the expired tasks."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"}],"source_content_type":"text/x-yaml","patch_set":22,"id":"7aa08908_318511ad","line":7,"range":{"start_line":7,"start_character":43,"end_line":7,"end_character":49},"updated":"2016-06-07 04:07:37.000000000","message":"deleted?","commit_id":"756cb23402b3c54e9fd2d907b3b0a88e271abc15"},{"author":{"_account_id":15062,"name":"GB21","email":"geetika791@gmail.com","username":"GB21"},"change_message_id":"1a9e5980b28792de015fcf22fde9f6fcf23a9164","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    tasks_get_all function, so that everytime tasks"},{"line_number":5,"context_line":"    lists are called, the function checks if tasks in"},{"line_number":6,"context_line":"    the database have surpassed the expired_at value;"},{"line_number":7,"context_line":"    if that is the case, then it marks the delete value"},{"line_number":8,"context_line":"    as 0 for all the expired tasks."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"}],"source_content_type":"text/x-yaml","patch_set":22,"id":"7aa08908_ef38c03f","line":7,"range":{"start_line":7,"start_character":43,"end_line":7,"end_character":49},"in_reply_to":"7aa08908_318511ad","updated":"2016-06-07 05:32:21.000000000","message":"Done","commit_id":"756cb23402b3c54e9fd2d907b3b0a88e271abc15"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6136036a27a24886e14822b6803b5865893e5589","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    lists are called, the function checks if tasks in"},{"line_number":6,"context_line":"    the database have surpassed the expired_at value;"},{"line_number":7,"context_line":"    if that is the case, then it marks the delete value"},{"line_number":8,"context_line":"    as 0 for all the expired tasks."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"},{"line_number":11,"context_line":"  - Tasks are soft deleted, in Glance, a resource can"}],"source_content_type":"text/x-yaml","patch_set":22,"id":"7aa08908_1145756f","line":8,"range":{"start_line":8,"start_character":7,"end_line":8,"end_character":8},"updated":"2016-06-07 04:07:37.000000000","message":"it should be 1 IMO","commit_id":"756cb23402b3c54e9fd2d907b3b0a88e271abc15"},{"author":{"_account_id":15062,"name":"GB21","email":"geetika791@gmail.com","username":"GB21"},"change_message_id":"1a9e5980b28792de015fcf22fde9f6fcf23a9164","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    lists are called, the function checks if tasks in"},{"line_number":6,"context_line":"    the database have surpassed the expired_at value;"},{"line_number":7,"context_line":"    if that is the case, then it marks the delete value"},{"line_number":8,"context_line":"    as 0 for all the expired tasks."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"other:"},{"line_number":11,"context_line":"  - Tasks are soft deleted, in Glance, a resource can"}],"source_content_type":"text/x-yaml","patch_set":22,"id":"7aa08908_2f3be839","line":8,"range":{"start_line":8,"start_character":7,"end_line":8,"end_character":8},"in_reply_to":"7aa08908_1145756f","updated":"2016-06-07 05:32:21.000000000","message":"Done","commit_id":"756cb23402b3c54e9fd2d907b3b0a88e271abc15"}]}
