)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"c65d76d9d99514c5f459ebeac2bf1bf0d4220e23","unresolved":false,"context_lines":[{"line_number":3367,"context_line":"    rows \u003d model_query(context, models.QuotaUsage,"},{"line_number":3368,"context_line":"                       read_deleted\u003d\"no\","},{"line_number":3369,"context_line":"                       session\u003dsession).\\"},{"line_number":3370,"context_line":"                   filter_by(project_id\u003dproject_id).order_by(asc(\"id\")).\\"},{"line_number":3371,"context_line":"                   with_lockmode(\u0027update\u0027).\\"},{"line_number":3372,"context_line":"                   all()"},{"line_number":3373,"context_line":"    proj_result \u003d dict()"}],"source_content_type":"text/x-python","patch_set":10,"id":"da20952f_e64e9095","line":3370,"updated":"2015-08-28 07:30:24.000000000","message":"Could we move it in separate line?","commit_id":"1e4e047c7b04f1411d3f07966aad1d7d39d929bd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"0389d5d2364e6c9def4c2285a9360119eb162696","unresolved":false,"context_lines":[{"line_number":3367,"context_line":"    rows \u003d model_query(context, models.QuotaUsage,"},{"line_number":3368,"context_line":"                       read_deleted\u003d\"no\","},{"line_number":3369,"context_line":"                       session\u003dsession).\\"},{"line_number":3370,"context_line":"                   filter_by(project_id\u003dproject_id).order_by(asc(\"id\")).\\"},{"line_number":3371,"context_line":"                   with_lockmode(\u0027update\u0027).\\"},{"line_number":3372,"context_line":"                   all()"},{"line_number":3373,"context_line":"    proj_result \u003d dict()"}],"source_content_type":"text/x-python","patch_set":10,"id":"da20952f_7c39ac40","line":3370,"in_reply_to":"da20952f_e64e9095","updated":"2015-08-28 09:59:06.000000000","message":"Done","commit_id":"1e4e047c7b04f1411d3f07966aad1d7d39d929bd"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"dd39f60b42b7d7c1b47525118eab08c4124b0ecf","unresolved":false,"context_lines":[{"line_number":3368,"context_line":"                       read_deleted\u003d\"no\","},{"line_number":3369,"context_line":"                       session\u003dsession).\\"},{"line_number":3370,"context_line":"        filter_by(project_id\u003dproject_id).\\"},{"line_number":3371,"context_line":"        order_by(asc(\"id\")).\\"},{"line_number":3372,"context_line":"        with_lockmode(\u0027update\u0027).\\"},{"line_number":3373,"context_line":"        all()"},{"line_number":3374,"context_line":"    proj_result \u003d dict()"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_6d4b2688","line":3371,"updated":"2015-08-28 15:26:27.000000000","message":"it\u0027s never a good idea to order by a string name like this, as \"id\" is very easily ambiguous depending on the query; while it works here, if the query ever changed elsewhere then it wouldn\u0027t, also it misleads other developers who might see this and think this is the way that\u0027s done.  This should likely be `models.QuotaUsage.id.asc()`.","commit_id":"30f6244627b09c6931e11c3e008d52370ffd38f7"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"059cb9367bdea7cbcc6f7b6e6927f825f124c511","unresolved":false,"context_lines":[{"line_number":3368,"context_line":"                       read_deleted\u003d\"no\","},{"line_number":3369,"context_line":"                       session\u003dsession).\\"},{"line_number":3370,"context_line":"        filter_by(project_id\u003dproject_id).\\"},{"line_number":3371,"context_line":"        order_by(models.QuotaUsage.id.asc()).\\"},{"line_number":3372,"context_line":"        with_lockmode(\u0027update\u0027).\\"},{"line_number":3373,"context_line":"        all()"},{"line_number":3374,"context_line":"    proj_result \u003d dict()"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_e75b41f5","line":3371,"updated":"2015-09-01 18:18:15.000000000","message":"I was sure FOR UPDATE locks all rows in atomic way once the SELECT is executed, but a simple test proved me wrong, turned out ORDER BY is actually needed here.","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"755b9ec0ae82f7f18a63cd222102aa0ef86af3c3","unresolved":false,"context_lines":[{"line_number":3368,"context_line":"                       read_deleted\u003d\"no\","},{"line_number":3369,"context_line":"                       session\u003dsession).\\"},{"line_number":3370,"context_line":"        filter_by(project_id\u003dproject_id).\\"},{"line_number":3371,"context_line":"        order_by(models.QuotaUsage.id.asc()).\\"},{"line_number":3372,"context_line":"        with_lockmode(\u0027update\u0027).\\"},{"line_number":3373,"context_line":"        all()"},{"line_number":3374,"context_line":"    proj_result \u003d dict()"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_7836e1b5","line":3371,"in_reply_to":"da20952f_e75b41f5","updated":"2015-09-02 01:24:39.000000000","message":"Yes it is, :-)","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"caa0def50185937c086582c45574e54d196a668b","unresolved":false,"context_lines":[{"line_number":6676,"context_line":"        self.assertEqual(expected, db.quota_usage_get_all_by_project_and_user("},{"line_number":6677,"context_line":"                         self.ctxt, \u0027p1\u0027, \u0027u1\u0027))"},{"line_number":6678,"context_line":""},{"line_number":6679,"context_line":"    def test_get_project_user_quota_usages_in_order(self):"},{"line_number":6680,"context_line":"        # Test if the result rows are ordered by id"},{"line_number":6681,"context_line":"        _quota_reserve(self.ctxt, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6682,"context_line":"        rows \u003d sqlalchemy_api.model_query(self.ctxt, models.QuotaUsage,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_55fec2ae","line":6679,"updated":"2015-08-20 07:20:23.000000000","message":"You modify _get_project_user_quota_usages(), so I think you should call it and assert the return value as your expected. This test case can\u0027t testify your modification take effect, it can pass even if your change is removed from api.py.","commit_id":"7906b7773fcdef133b935ae9e3ed525d339ce44a"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"4f9e5c6a1ee44074a927b16b1c66016c6a3b00cb","unresolved":false,"context_lines":[{"line_number":6682,"context_line":"            self.ctxt, None, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6683,"context_line":"        # order_by() is also called once in _quota_reserve()"},{"line_number":6684,"context_line":"        # so the total call_count is 2."},{"line_number":6685,"context_line":"        self.assertEqual(2, order_mock.call_count)"},{"line_number":6686,"context_line":""},{"line_number":6687,"context_line":"    def test_quota_usage_update_nonexistent(self):"},{"line_number":6688,"context_line":"        self.assertRaises(exception.QuotaUsageNotFound, db.quota_usage_update,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_cea1a795","line":6685,"updated":"2015-08-21 06:15:00.000000000","message":"I would like to see assert_call_with the expected argument asc(\"id\") rather than only call_count","commit_id":"0c07ce4b798f6db86939d06f09dd0bc2449d5795"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"059cb9367bdea7cbcc6f7b6e6927f825f124c511","unresolved":false,"context_lines":[{"line_number":6723,"context_line":"        with mock.patch.object(query.Query, \u0027order_by\u0027) as order_mock:"},{"line_number":6724,"context_line":"            sqlalchemy_api._get_project_user_quota_usages("},{"line_number":6725,"context_line":"                self.ctxt, None, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6726,"context_line":"        self.assertTrue(order_mock.called)"},{"line_number":6727,"context_line":""},{"line_number":6728,"context_line":"    def test_quota_usage_update_nonexistent(self):"},{"line_number":6729,"context_line":"        self.assertRaises(exception.QuotaUsageNotFound, db.quota_usage_update,"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_070435c4","line":6726,"updated":"2015-09-01 18:18:15.000000000","message":"nit: we could probably assert on the argument value here","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"a8263769cd67d1b09a4ba8a5acbb23d354f105a1","unresolved":false,"context_lines":[{"line_number":6723,"context_line":"        with mock.patch.object(query.Query, \u0027order_by\u0027) as order_mock:"},{"line_number":6724,"context_line":"            sqlalchemy_api._get_project_user_quota_usages("},{"line_number":6725,"context_line":"                self.ctxt, None, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6726,"context_line":"        self.assertTrue(order_mock.called)"},{"line_number":6727,"context_line":""},{"line_number":6728,"context_line":"    def test_quota_usage_update_nonexistent(self):"},{"line_number":6729,"context_line":"        self.assertRaises(exception.QuotaUsageNotFound, db.quota_usage_update,"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_fe8899c8","line":6726,"in_reply_to":"da20952f_070435c4","updated":"2015-09-02 02:58:18.000000000","message":"Hi, I have tried again, it is the same as before, it is like this:\n*** AssertionError: Expected call: order_by(\u003csqlalchemy.sql.elements.UnaryExpression object at 0x7fabff6d46d0\u003e)\nActual call: order_by(\u003csqlalchemy.sql.elements.UnaryExpression object at 0x7fabff304650\u003e)\n\nmaybe we can leave it like this or do you have any suggestion?","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"755b9ec0ae82f7f18a63cd222102aa0ef86af3c3","unresolved":false,"context_lines":[{"line_number":6723,"context_line":"        with mock.patch.object(query.Query, \u0027order_by\u0027) as order_mock:"},{"line_number":6724,"context_line":"            sqlalchemy_api._get_project_user_quota_usages("},{"line_number":6725,"context_line":"                self.ctxt, None, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6726,"context_line":"        self.assertTrue(order_mock.called)"},{"line_number":6727,"context_line":""},{"line_number":6728,"context_line":"    def test_quota_usage_update_nonexistent(self):"},{"line_number":6729,"context_line":"        self.assertRaises(exception.QuotaUsageNotFound, db.quota_usage_update,"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_181d650f","line":6726,"in_reply_to":"da20952f_070435c4","updated":"2015-09-02 01:24:39.000000000","message":"Hi, I have tried before, it turns out asc is an factory method, it was really hard to get the result we want. But since the code now is a little bit different, I will try again.","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"17ec2cdcf49e0b0bd8247db5353645b03002e808","unresolved":false,"context_lines":[{"line_number":6723,"context_line":"        with mock.patch.object(query.Query, \u0027order_by\u0027) as order_mock:"},{"line_number":6724,"context_line":"            sqlalchemy_api._get_project_user_quota_usages("},{"line_number":6725,"context_line":"                self.ctxt, None, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6726,"context_line":"        self.assertTrue(order_mock.called)"},{"line_number":6727,"context_line":""},{"line_number":6728,"context_line":"    def test_quota_usage_update_nonexistent(self):"},{"line_number":6729,"context_line":"        self.assertRaises(exception.QuotaUsageNotFound, db.quota_usage_update,"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_f14af1ab","line":6726,"in_reply_to":"da20952f_40098930","updated":"2015-09-02 14:56:20.000000000","message":"this is because when you call .asc(), you get a new object, so they don\u0027t compare in that way.   if you really wanted, you could stringify it (e.g. str(...)) and test for \"id ASC\".","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"269a5b2db5563546c60dba1d5a9c1f2538880332","unresolved":false,"context_lines":[{"line_number":6723,"context_line":"        with mock.patch.object(query.Query, \u0027order_by\u0027) as order_mock:"},{"line_number":6724,"context_line":"            sqlalchemy_api._get_project_user_quota_usages("},{"line_number":6725,"context_line":"                self.ctxt, None, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6726,"context_line":"        self.assertTrue(order_mock.called)"},{"line_number":6727,"context_line":""},{"line_number":6728,"context_line":"    def test_quota_usage_update_nonexistent(self):"},{"line_number":6729,"context_line":"        self.assertRaises(exception.QuotaUsageNotFound, db.quota_usage_update,"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_26fc24b7","line":6726,"in_reply_to":"da20952f_f14af1ab","updated":"2015-09-06 03:24:26.000000000","message":"I think it\u0027s ok for just test this, sqlalchemy will ensure the rest.","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"43ea7f0222cce40447a6cc06202dbb76dd30b3c7","unresolved":false,"context_lines":[{"line_number":6723,"context_line":"        with mock.patch.object(query.Query, \u0027order_by\u0027) as order_mock:"},{"line_number":6724,"context_line":"            sqlalchemy_api._get_project_user_quota_usages("},{"line_number":6725,"context_line":"                self.ctxt, None, \u0027p1\u0027, \u0027u1\u0027)"},{"line_number":6726,"context_line":"        self.assertTrue(order_mock.called)"},{"line_number":6727,"context_line":""},{"line_number":6728,"context_line":"    def test_quota_usage_update_nonexistent(self):"},{"line_number":6729,"context_line":"        self.assertRaises(exception.QuotaUsageNotFound, db.quota_usage_update,"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_40098930","line":6726,"in_reply_to":"da20952f_fe8899c8","updated":"2015-09-02 14:08:40.000000000","message":"I can\u0027t find a better way either... let\u0027s just leave it as is. thanks!","commit_id":"6f35a8429939ec0f80deb2a65050c4b56db79545"}]}
