)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20146,"name":"yuyafei","email":"yu.yafei@foxmail.com","username":"yuyafei"},"change_message_id":"e8fc5a9793b7e9376632af719a6cbcb94397b8ae","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-05-23 10:48:54 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Minimize cost of DB exists decorator checks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We have 2 DB decorators, require_volume_exists and"},{"line_number":10,"context_line":"require_snapshot_exists, that rely on retrieving the resource from the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"bab6814e_ba49e790","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":43},"updated":"2016-05-25 04:54:13.000000000","message":"Where is the bug ID?","commit_id":"26ea387ff6766acf0c8125ad85ec04f2fbbcfca8"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"6254b5224a964ade105dae5fc301199669893269","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-05-23 10:48:54 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Minimize cost of DB exists decorator checks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We have 2 DB decorators, require_volume_exists and"},{"line_number":10,"context_line":"require_snapshot_exists, that rely on retrieving the resource from the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"bab6814e_f0cc23bd","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":43},"in_reply_to":"bab6814e_ba49e790","updated":"2016-05-25 18:16:29.000000000","message":"As I see it the code works just fine and this is just a performance improvement.\n\nThat\u0027s why I didn\u0027t create a bug.","commit_id":"26ea387ff6766acf0c8125ad85ec04f2fbbcfca8"}],"cinder/tests/unit/api/contrib/test_volume_actions.py":[{"author":{"_account_id":12732,"name":"Bin Zhou","email":"zhou.bin9@zte.com.cn","username":"BinZhou"},"change_message_id":"0e874a73414d07ef2f1aff70eb329c1a0003338f","unresolved":false,"context_lines":[{"line_number":501,"context_line":"            fake.USER_ID, fake.PROJECT_ID, auth_token\u003dTrue)"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"    @mock.patch(\u0027cinder.db.sqlalchemy.api.resource_exists\u0027, return_value\u003dTrue)"},{"line_number":504,"context_line":"    def _retype_volume_exec(self, expected_status, exists_mock,"},{"line_number":505,"context_line":"                            new_type\u003dfake.VOLUME_TYPE2_ID):"},{"line_number":506,"context_line":"        req \u003d webob.Request.blank(\u0027/v2/%s/volumes/%s/action\u0027 %"},{"line_number":507,"context_line":"                                  (fake.PROJECT_ID, fake.VOLUME_ID))"}],"source_content_type":"text/x-python","patch_set":4,"id":"bab6814e_c2791295","line":504,"range":{"start_line":504,"start_character":51,"end_line":504,"end_character":62},"updated":"2016-05-26 11:53:19.000000000","message":"The name of \"exists_mock\" should be optimized such as \"mock_exists\", following the name style of others.","commit_id":"dd38a02849063bf645ac403db157ca6305d6a6cc"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"5f821b457dc9b278c799a243d34176f6bd54841f","unresolved":false,"context_lines":[{"line_number":501,"context_line":"            fake.USER_ID, fake.PROJECT_ID, auth_token\u003dTrue)"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"    @mock.patch(\u0027cinder.db.sqlalchemy.api.resource_exists\u0027, return_value\u003dTrue)"},{"line_number":504,"context_line":"    def _retype_volume_exec(self, expected_status, exists_mock,"},{"line_number":505,"context_line":"                            new_type\u003dfake.VOLUME_TYPE2_ID):"},{"line_number":506,"context_line":"        req \u003d webob.Request.blank(\u0027/v2/%s/volumes/%s/action\u0027 %"},{"line_number":507,"context_line":"                                  (fake.PROJECT_ID, fake.VOLUME_ID))"}],"source_content_type":"text/x-python","patch_set":4,"id":"bab6814e_8b4f2533","line":504,"range":{"start_line":504,"start_character":51,"end_line":504,"end_character":62},"in_reply_to":"bab6814e_c2791295","updated":"2016-05-26 12:49:08.000000000","message":"In our code base we have both cases, mock_ as a prefix and _mock as a postfix in test variables.  One way emphasizes the fact that this is a mock, and the other emphasizes the method it is mocking.  Either way is fine.","commit_id":"dd38a02849063bf645ac403db157ca6305d6a6cc"}],"cinder/tests/unit/test_db_api.py":[{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"21f997b9552ffdae83969985f3509dfcb72182e4","unresolved":false,"context_lines":[{"line_number":2453,"context_line":"class DBAPIGenericTestCase(BaseTest):"},{"line_number":2454,"context_line":"    def test_resource_exists_volume(self):"},{"line_number":2455,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME_ID})"},{"line_number":2456,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME2_ID})"},{"line_number":2457,"context_line":"        model \u003d db.get_model_for_versioned_object(objects.Volume)"},{"line_number":2458,"context_line":"        res \u003d sqlalchemy_api.resource_exists(self.ctxt, model, fake.VOLUME_ID)"},{"line_number":2459,"context_line":"        self.assertTrue(res)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_664953b7","line":2456,"updated":"2016-05-20 16:05:37.000000000","message":"Why do you bother to create VOLUME2_ID? It doesn\u0027t seem to be used?","commit_id":"ae192c232c0f1fba4dae45e715905b6d6ca6a89c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"c2a4d10ba83e614115fbed4f4640df2e49531574","unresolved":false,"context_lines":[{"line_number":2453,"context_line":"class DBAPIGenericTestCase(BaseTest):"},{"line_number":2454,"context_line":"    def test_resource_exists_volume(self):"},{"line_number":2455,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME_ID})"},{"line_number":2456,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME2_ID})"},{"line_number":2457,"context_line":"        model \u003d db.get_model_for_versioned_object(objects.Volume)"},{"line_number":2458,"context_line":"        res \u003d sqlalchemy_api.resource_exists(self.ctxt, model, fake.VOLUME_ID)"},{"line_number":2459,"context_line":"        self.assertTrue(res)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_117cd1b3","line":2456,"in_reply_to":"bab6814e_3120f5f6","updated":"2016-05-23 08:39:43.000000000","message":"s/get_model/model_query","commit_id":"ae192c232c0f1fba4dae45e715905b6d6ca6a89c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7b8a7a30472d812fcced55cc520accd5a56ac0de","unresolved":false,"context_lines":[{"line_number":2453,"context_line":"class DBAPIGenericTestCase(BaseTest):"},{"line_number":2454,"context_line":"    def test_resource_exists_volume(self):"},{"line_number":2455,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME_ID})"},{"line_number":2456,"context_line":"        db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME2_ID})"},{"line_number":2457,"context_line":"        model \u003d db.get_model_for_versioned_object(objects.Volume)"},{"line_number":2458,"context_line":"        res \u003d sqlalchemy_api.resource_exists(self.ctxt, model, fake.VOLUME_ID)"},{"line_number":2459,"context_line":"        self.assertTrue(res)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_3120f5f6","line":2456,"in_reply_to":"bab6814e_664953b7","updated":"2016-05-23 08:34:08.000000000","message":"To confirm that the exists query only selects 1 entry and not both.  If the DB query was not properly formulated then the scalar call in resource_exists would raise an exception because multiple rows existed and scalar cannot convert them to a single element.\n\nThis would happen for example if instead of doing the get_session in resource_exists I used the get_model method as this:\n\n query \u003d get_model(context, model, sql.exists().where(and_(*conditions)))\n\nThat would suceed with only 1 element, but would fail with 2.\n\nI\u0027ll add a comment to the test explaining it.","commit_id":"ae192c232c0f1fba4dae45e715905b6d6ca6a89c"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"21f997b9552ffdae83969985f3509dfcb72182e4","unresolved":false,"context_lines":[{"line_number":2468,"context_line":"        vol \u003d db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME_ID})"},{"line_number":2469,"context_line":"        db.snapshot_create(self.ctxt, {\u0027id\u0027: fake.SNAPSHOT_ID,"},{"line_number":2470,"context_line":"                                       \u0027volume_id\u0027: vol.id})"},{"line_number":2471,"context_line":"        db.snapshot_create(self.ctxt, {\u0027id\u0027: fake.SNAPSHOT2_ID,"},{"line_number":2472,"context_line":"                                       \u0027volume_id\u0027: vol.id})"},{"line_number":2473,"context_line":"        model \u003d db.get_model_for_versioned_object(objects.Snapshot)"},{"line_number":2474,"context_line":"        res \u003d sqlalchemy_api.resource_exists(self.ctxt, model,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_e6d383d3","line":2471,"updated":"2016-05-20 16:05:37.000000000","message":"Why do you bother to create SNAPSHOT2_ID? It doesn\u0027t seem to be used?","commit_id":"ae192c232c0f1fba4dae45e715905b6d6ca6a89c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7b8a7a30472d812fcced55cc520accd5a56ac0de","unresolved":false,"context_lines":[{"line_number":2468,"context_line":"        vol \u003d db.volume_create(self.ctxt, {\u0027id\u0027: fake.VOLUME_ID})"},{"line_number":2469,"context_line":"        db.snapshot_create(self.ctxt, {\u0027id\u0027: fake.SNAPSHOT_ID,"},{"line_number":2470,"context_line":"                                       \u0027volume_id\u0027: vol.id})"},{"line_number":2471,"context_line":"        db.snapshot_create(self.ctxt, {\u0027id\u0027: fake.SNAPSHOT2_ID,"},{"line_number":2472,"context_line":"                                       \u0027volume_id\u0027: vol.id})"},{"line_number":2473,"context_line":"        model \u003d db.get_model_for_versioned_object(objects.Snapshot)"},{"line_number":2474,"context_line":"        res \u003d sqlalchemy_api.resource_exists(self.ctxt, model,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_111b31cb","line":2471,"in_reply_to":"bab6814e_e6d383d3","updated":"2016-05-23 08:34:08.000000000","message":"For the same reason.","commit_id":"ae192c232c0f1fba4dae45e715905b6d6ca6a89c"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"60c3e88f5e2faa1dbe6a401287e69417d499d7ff","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"bab6814e_ae308908","line":2504,"updated":"2016-05-25 07:32:45.000000000","message":"Should we add a unit test to check volumes or snapshots not exist in different projects?\n\nLike create fake.VOLUME_ID in context1, and check not exists in context2.","commit_id":"26ea387ff6766acf0c8125ad85ec04f2fbbcfca8"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"6254b5224a964ade105dae5fc301199669893269","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"bab6814e_8cf3e69e","line":2504,"in_reply_to":"bab6814e_ae308908","updated":"2016-05-25 18:16:29.000000000","message":"That\u0027s a good idea, as it would give us more confidence that this is not breaking anything.  ;-)","commit_id":"26ea387ff6766acf0c8125ad85ec04f2fbbcfca8"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"589435216c522d427932eb968ba0a6f08be91db6","unresolved":false,"context_lines":[{"line_number":2511,"context_line":"                                  {\u0027project_id\u0027: fake.PROJECT_ID})"},{"line_number":2512,"context_line":"        model \u003d db.get_model_for_versioned_object(objects.Volume)"},{"line_number":2513,"context_line":""},{"line_number":2514,"context_line":"        # Owner can find it"},{"line_number":2515,"context_line":"        res \u003d sqlalchemy_api.resource_exists(user_context, model, volume.id)"},{"line_number":2516,"context_line":"        self.assertTrue(res)"},{"line_number":2517,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9abb7d3a_00a682ad","line":2514,"updated":"2016-05-31 14:18:06.000000000","message":"You might consider passing in these comments as msg\u003d messages for the assertTrue calls instead.","commit_id":"dd38a02849063bf645ac403db157ca6305d6a6cc"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9a0960c2187f985568045a81f0a393c4bae9f904","unresolved":false,"context_lines":[{"line_number":2511,"context_line":"                                  {\u0027project_id\u0027: fake.PROJECT_ID})"},{"line_number":2512,"context_line":"        model \u003d db.get_model_for_versioned_object(objects.Volume)"},{"line_number":2513,"context_line":""},{"line_number":2514,"context_line":"        # Owner can find it"},{"line_number":2515,"context_line":"        res \u003d sqlalchemy_api.resource_exists(user_context, model, volume.id)"},{"line_number":2516,"context_line":"        self.assertTrue(res)"},{"line_number":2517,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9abb7d3a_8438bdf0","line":2514,"in_reply_to":"9abb7d3a_00a682ad","updated":"2016-05-31 16:27:07.000000000","message":"Yes, that would make sense.","commit_id":"dd38a02849063bf645ac403db157ca6305d6a6cc"}]}
