)]}'
{"keystone/tests/unit/test_cli.py":[{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"8989a58d868d0a10dd7559c5598067af90f285e7","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        self.useFixture(fixtures.MockPatchObject("},{"line_number":1397,"context_line":"            CONF, \u0027command\u0027, self.FakeConfCommand(self)))"},{"line_number":1398,"context_line":""},{"line_number":1399,"context_line":"        def fake_load_backends():"},{"line_number":1400,"context_line":"            class Fake_MappingManager(object):"},{"line_number":1401,"context_line":"                def purge_mappings(self, purge_filter):"},{"line_number":1402,"context_line":"                    # CLI passes \u0027entity_type\u0027 to API instead of \u0027type\u0027"},{"line_number":1403,"context_line":"                    if \u0027entity_type\u0027 not in purge_filter:"},{"line_number":1404,"context_line":"                        raise KeyError"},{"line_number":1405,"context_line":"                    if purge_filter[\u0027entity_type\u0027] !\u003d \u0027user\u0027:"},{"line_number":1406,"context_line":"                        raise AttributeError"},{"line_number":1407,"context_line":""},{"line_number":1408,"context_line":"            return dict("},{"line_number":1409,"context_line":"                id_mapping_api\u003dFake_MappingManager(),"},{"line_number":1410,"context_line":"                resource_api\u003dNone)"},{"line_number":1411,"context_line":""},{"line_number":1412,"context_line":"        self.useFixture(fixtures.MockPatch("},{"line_number":1413,"context_line":"            \u0027keystone.server.backends.load_backends\u0027,"},{"line_number":1414,"context_line":"            side_effect\u003dfake_load_backends))"},{"line_number":1415,"context_line":""},{"line_number":1416,"context_line":"        cli.MappingPurge.main()"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_dd79892f","line":1414,"range":{"start_line":1399,"start_character":0,"end_line":1414,"end_character":44},"updated":"2018-03-20 07:09:36.000000000","message":"It works well, but a easier way is to mock \"purge_mappings\" in id_mapping_api, then just need to test mock_obj.assert_called_with()","commit_id":"1a41363dfc69cd3bfdfb90e3d9af882ae4833548"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"13db6fe56bb3c8175739549793b767b46f5c8209","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"        args.append(uuid.uuid4().hex)"},{"line_number":1387,"context_line":"        self.parser.parse_args(args)"},{"line_number":1388,"context_line":""},{"line_number":1389,"context_line":"    @mock.patch.object(keystone.identity.MappingManager, \u0027purge_mappings\u0027)"},{"line_number":1390,"context_line":"    def test_mapping_purge_type_user(self, purge_mock):"},{"line_number":1391,"context_line":"        # Make sure the logic in main() actually catches no argument error"},{"line_number":1392,"context_line":"        self.command_type \u003d \u0027user\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_30c88320","line":1389,"updated":"2018-04-11 18:42:28.000000000","message":"This change looks ok by tracing the code, but it would be nice to have a functional test of some sort to ensure purge_mappings is doing what it should for both `user` and `group` types.\n\nThis test case wouldn\u0027t necessarily catch the bug if it were reintroduced, because the issue was the \u0027type\u0027 was getting set in the purge_filter instead of \u0027entity_type\u0027. This resulted in all of the mappings getting purged since the query wasn\u0027t being built properly. Maybe was we can do is:\n\n - create an id mapping for a group\n - create an id mapping for a user\n - perform a mapping purge using the cli.py module with --type user\n - ensure the public id of the user is gone\n - ensure the public id for the group still exists\n\nWe could reverse that test case for group logic, too.","commit_id":"262c5e34e4ff7b68aaefde9b081ca9c33d3f0f3f"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"bd9f5b3206cf15272a87940c2b7f403278e7ef56","unresolved":false,"context_lines":[{"line_number":1397,"context_line":"        self.useFixture(fixtures.MockPatchObject("},{"line_number":1398,"context_line":"            CONF, \u0027command\u0027, self.FakeConfCommand(self)))"},{"line_number":1399,"context_line":""},{"line_number":1400,"context_line":"        def fake_load_backends():"},{"line_number":1401,"context_line":"            return dict("},{"line_number":1402,"context_line":"                id_mapping_api\u003dkeystone.identity.core.MappingManager,"},{"line_number":1403,"context_line":"                resource_api\u003dNone)"},{"line_number":1404,"context_line":""},{"line_number":1405,"context_line":"        self.useFixture(fixtures.MockPatch("},{"line_number":1406,"context_line":"            \u0027keystone.server.backends.load_backends\u0027,"},{"line_number":1407,"context_line":"            side_effect\u003dfake_load_backends))"},{"line_number":1408,"context_line":""},{"line_number":1409,"context_line":"        cli.MappingPurge.main()"},{"line_number":1410,"context_line":"        purge_mock.assert_called_with({\u0027entity_type\u0027: \u0027user\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_de85aa08","line":1407,"range":{"start_line":1400,"start_character":0,"end_line":1407,"end_character":44},"updated":"2018-04-11 09:02:38.000000000","message":"-1: these code can be removed totally.","commit_id":"262c5e34e4ff7b68aaefde9b081ca9c33d3f0f3f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"82c3ff043b193a946359042fea5ea713fa0adb72","unresolved":false,"context_lines":[{"line_number":1406,"context_line":"            \u0027keystone.server.backends.load_backends\u0027,"},{"line_number":1407,"context_line":"            side_effect\u003dfake_load_backends))"},{"line_number":1408,"context_line":""},{"line_number":1409,"context_line":"        cli.MappingPurge.main()"},{"line_number":1410,"context_line":"        purge_mock.assert_called_with({\u0027entity_type\u0027: \u0027user\u0027,"},{"line_number":1411,"context_line":"                                       \u0027local_id\u0027: self.command_local_id,"},{"line_number":1412,"context_line":"                                       \u0027public_id\u0027: self.command_public_id})"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f6a8fd7_44dbe67a","line":1409,"range":{"start_line":1409,"start_character":8,"end_line":1409,"end_character":31},"updated":"2018-04-23 14:36:37.000000000","message":"There aren\u0027t any assertions in this test that verify this is doing what it should outside of the the mock. I think need to amend this test or add other test cases that assert:\n\n  - a user and group exist in the mapping backend\n  - call MappingPurge.main() with --type user\n  - assert the user is gone\n  - assert the group still exists\n\nAnother possible permutation would be the same as above but calling MappingPurge.main() with --type group, assert the group is gone and the user exists.","commit_id":"920ec7af2b5feb5cc1fb5f805fd7f3713a578fba"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"7c8ef30239df0f6752ddfde9d5c451be9fd9e627","unresolved":false,"context_lines":[{"line_number":1406,"context_line":"            \u0027keystone.server.backends.load_backends\u0027,"},{"line_number":1407,"context_line":"            side_effect\u003dfake_load_backends))"},{"line_number":1408,"context_line":""},{"line_number":1409,"context_line":"        cli.MappingPurge.main()"},{"line_number":1410,"context_line":"        purge_mock.assert_called_with({\u0027entity_type\u0027: \u0027user\u0027,"},{"line_number":1411,"context_line":"                                       \u0027local_id\u0027: self.command_local_id,"},{"line_number":1412,"context_line":"                                       \u0027public_id\u0027: self.command_public_id})"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_d08d41d4","line":1409,"range":{"start_line":1409,"start_character":8,"end_line":1409,"end_character":31},"in_reply_to":"9f6a8fd7_44dbe67a","updated":"2018-06-26 19:15:54.000000000","message":"Done","commit_id":"920ec7af2b5feb5cc1fb5f805fd7f3713a578fba"},{"author":{"_account_id":16465,"name":"Kristi Nikolla","email":"knikolla@bu.edu","username":"knikolla"},"change_message_id":"7aa9f698a47668e6f42371de47b383e622effa4b","unresolved":false,"context_lines":[{"line_number":1446,"context_line":""},{"line_number":1447,"context_line":"    def test_purge_by_user_type(self):"},{"line_number":1448,"context_line":"        # Grab the list of the users from the backend directly to avoid"},{"line_number":1449,"context_line":"        # populating the public_ids for each user. We do this so we can grab"},{"line_number":1450,"context_line":"        # the local_id of a user before it\u0027s overwritten by the public_id."},{"line_number":1451,"context_line":"        hints \u003d None"},{"line_number":1452,"context_line":"        users \u003d PROVIDERS.identity_api.driver.list_users(hints)"},{"line_number":1453,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_8e5566fb","line":1450,"range":{"start_line":1449,"start_character":51,"end_line":1450,"end_character":74},"updated":"2018-06-26 20:28:06.000000000","message":"Interesting.","commit_id":"74684cf53bffb17af1012af30daf04abfdadc253"}],"releasenotes/notes/bug-1757022-664d0b0db1242bf8.yaml":[{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"bd9f5b3206cf15272a87940c2b7f403278e7ef56","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    [`bug 1757022 \u003chttps://bugs.launchpad.net/keystone/+bug/1757022\u003e`_]"},{"line_number":5,"context_line":"    In previous releases,  ``keystone-manage mapping_purge --type {user,group}``"},{"line_number":6,"context_line":"    command could purge all mappings instead of only purging the specified type"},{"line_number":7,"context_line":"    mappings. With this release, ``keystone-manage mapping_purge --type {user,group}``"},{"line_number":8,"context_line":"    now purges only specified type mappings as expected."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"bf659307_fe2bcee7","line":6,"range":{"start_line":6,"start_character":12,"end_line":6,"end_character":36},"updated":"2018-04-11 09:02:38.000000000","message":"....would purge all mapping incorrectly....","commit_id":"262c5e34e4ff7b68aaefde9b081ca9c33d3f0f3f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"13db6fe56bb3c8175739549793b767b46f5c8209","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    [`bug 1757022 \u003chttps://bugs.launchpad.net/keystone/+bug/1757022\u003e`_]"},{"line_number":5,"context_line":"    In previous releases,  ``keystone-manage mapping_purge --type {user,group}``"},{"line_number":6,"context_line":"    command could purge all mappings instead of only purging the specified type"},{"line_number":7,"context_line":"    mappings. With this release, ``keystone-manage mapping_purge --type {user,group}``"},{"line_number":8,"context_line":"    now purges only specified type mappings as expected."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"bf659307_dac92859","line":7,"range":{"start_line":7,"start_character":14,"end_line":7,"end_character":33},"updated":"2018-04-11 18:42:28.000000000","message":"This bit is somewhat implied since it will be published with the Rocky release notes.","commit_id":"262c5e34e4ff7b68aaefde9b081ca9c33d3f0f3f"}]}
