)]}'
{"gnocchi/indexer/__init__.py":[{"author":{"_account_id":8358,"name":"zhangguoqing","email":"zhang.guoqing@99cloud.net","username":"zhangguoqing"},"change_message_id":"6e62b3145e057386ce9f4f34c5642c715737422f","unresolved":false,"context_lines":[{"line_number":146,"context_line":"    def __init__(self, resource_type, expected_state, state):"},{"line_number":147,"context_line":"        super(UnexpectedResourceTypeState, self).__init__("},{"line_number":148,"context_line":"            \"Resource type %s state is %s (expected: %s)\" % ("},{"line_number":149,"context_line":"                resource_type, state, expected_state))"},{"line_number":150,"context_line":"        self.resource_type \u003d resource_type"},{"line_number":151,"context_line":"        self.expected_state \u003d expected_state"},{"line_number":152,"context_line":"        self.state \u003d state"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_c0e522a9","line":149,"range":{"start_line":149,"start_character":12,"end_line":149,"end_character":16},"updated":"2016-07-03 02:50:27.000000000","message":"aligning","commit_id":"778affc1edbaebf8faddca2fcaac3aeca19f02d2"}],"gnocchi/indexer/sqlalchemy.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"24fc48cc28ca9f5624cea0c0c54d82965e8ab9dc","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            # the resource_type table is already cleaned and commited"},{"line_number":225,"context_line":"            # so this code cannot be triggerred anymore for this"},{"line_number":226,"context_line":"            # resource_type"},{"line_number":227,"context_line":"            for table in tables:"},{"line_number":228,"context_line":"                for fk in table.foreign_key_constraints:"},{"line_number":229,"context_line":"                    self._safe_execute("},{"line_number":230,"context_line":"                        connection,"},{"line_number":231,"context_line":"                        sqlalchemy.schema.DropConstraint(fk))"},{"line_number":232,"context_line":"            for table in tables:"},{"line_number":233,"context_line":"                self._safe_execute(connection,"},{"line_number":234,"context_line":"                                   sqlalchemy.schema.DropTable(table))"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        # TODO(sileht): Remove this resource on other workers"},{"line_number":237,"context_line":"        # by using expiration on cache ?"}],"source_content_type":"text/x-python","patch_set":13,"id":"9abb7d3a_c24ec795","line":234,"range":{"start_line":227,"start_character":12,"end_line":234,"end_character":70},"updated":"2016-05-27 11:35:33.000000000","message":"I\u0027m worried, what happens if that code is killed in the middle of it?","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"d8d909173e6dfb15974af8a72d17962fea516d68","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            # the resource_type table is already cleaned and commited"},{"line_number":225,"context_line":"            # so this code cannot be triggerred anymore for this"},{"line_number":226,"context_line":"            # resource_type"},{"line_number":227,"context_line":"            for table in tables:"},{"line_number":228,"context_line":"                for fk in table.foreign_key_constraints:"},{"line_number":229,"context_line":"                    self._safe_execute("},{"line_number":230,"context_line":"                        connection,"},{"line_number":231,"context_line":"                        sqlalchemy.schema.DropConstraint(fk))"},{"line_number":232,"context_line":"            for table in tables:"},{"line_number":233,"context_line":"                self._safe_execute(connection,"},{"line_number":234,"context_line":"                                   sqlalchemy.schema.DropTable(table))"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        # TODO(sileht): Remove this resource on other workers"},{"line_number":237,"context_line":"        # by using expiration on cache ?"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_4aa538a0","line":234,"range":{"start_line":227,"start_character":12,"end_line":234,"end_character":70},"in_reply_to":"9abb7d3a_c24ec795","updated":"2016-06-24 07:24:01.000000000","message":"As before this resource type is fucked, that we I want to expose the state of resource type to inform admin/user that something have failed.\n\nI written my plan to fix/improve the situation in a TODO.","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"24fc48cc28ca9f5624cea0c0c54d82965e8ab9dc","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    self._set_resource_type_state(rt.name, \"creation_error\")"},{"line_number":332,"context_line":"                    LOG.exception(\u0027Fail to create tables for \u0027"},{"line_number":333,"context_line":"                                  \u0027resource_type \"%s\"\u0027, rt.name)"},{"line_number":334,"context_line":"                    raise"},{"line_number":335,"context_line":"                    continue"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"            self._set_resource_type_state(rt.name, \"active\")"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9abb7d3a_a258e357","line":335,"range":{"start_line":334,"start_character":20,"end_line":335,"end_character":28},"updated":"2016-05-27 11:35:33.000000000","message":"pick one","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"d8d909173e6dfb15974af8a72d17962fea516d68","unresolved":false,"context_lines":[{"line_number":331,"context_line":"                    self._set_resource_type_state(rt.name, \"creation_error\")"},{"line_number":332,"context_line":"                    LOG.exception(\u0027Fail to create tables for \u0027"},{"line_number":333,"context_line":"                                  \u0027resource_type \"%s\"\u0027, rt.name)"},{"line_number":334,"context_line":"                    raise"},{"line_number":335,"context_line":"                    continue"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"            self._set_resource_type_state(rt.name, \"active\")"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_2aa26c99","line":335,"range":{"start_line":334,"start_character":20,"end_line":335,"end_character":28},"in_reply_to":"9abb7d3a_a258e357","updated":"2016-06-24 07:24:01.000000000","message":"Done","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"24fc48cc28ca9f5624cea0c0c54d82965e8ab9dc","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        resource_type.state \u003d \"active\""},{"line_number":382,"context_line":"        return resource_type"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def get_resource_type(self, name):"},{"line_number":385,"context_line":"        with self.facade.independent_reader() as session:"},{"line_number":386,"context_line":"            return self._get_resource_type(session, name)"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    def _get_resource_type(self, session, name):"},{"line_number":389,"context_line":"        resource_type \u003d session.query(ResourceType).get(name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9abb7d3a_620c3b43","line":386,"range":{"start_line":384,"start_character":4,"end_line":386,"end_character":57},"updated":"2016-05-27 11:35:33.000000000","message":"This might want to check the status","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"d8d909173e6dfb15974af8a72d17962fea516d68","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        resource_type.state \u003d \"active\""},{"line_number":382,"context_line":"        return resource_type"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def get_resource_type(self, name):"},{"line_number":385,"context_line":"        with self.facade.independent_reader() as session:"},{"line_number":386,"context_line":"            return self._get_resource_type(session, name)"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    def _get_resource_type(self, session, name):"},{"line_number":389,"context_line":"        resource_type \u003d session.query(ResourceType).get(name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_2ad0acf5","line":386,"range":{"start_line":384,"start_character":4,"end_line":386,"end_character":57},"in_reply_to":"9abb7d3a_620c3b43","updated":"2016-06-24 07:24:01.000000000","message":"status ?","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"},{"author":{"_account_id":8358,"name":"zhangguoqing","email":"zhang.guoqing@99cloud.net","username":"zhangguoqing"},"change_message_id":"6e62b3145e057386ce9f4f34c5642c715737422f","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    @retry_on_deadlock"},{"line_number":146,"context_line":"    def map_and_create_tables(self, resource_type, facade):"},{"line_number":147,"context_line":"        if resource_type.state !\u003d \"creating\":"},{"line_number":148,"context_line":"            raise RuntimeError(\"map_and_create_tables must be called in state \""},{"line_number":149,"context_line":"                               \"creating\")"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        mappers \u003d self.get_classes(resource_type)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_40e8127d","line":148,"range":{"start_line":148,"start_character":32,"end_line":148,"end_character":53},"updated":"2016-07-03 02:50:27.000000000","message":"how about using the __name__?","commit_id":"778affc1edbaebf8faddca2fcaac3aeca19f02d2"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b194f35436ca9f91e7754fce0d888fd46dc2c69d","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    @retry_on_deadlock"},{"line_number":146,"context_line":"    def map_and_create_tables(self, resource_type, facade):"},{"line_number":147,"context_line":"        if resource_type.state !\u003d \"creating\":"},{"line_number":148,"context_line":"            raise RuntimeError(\"map_and_create_tables must be called in state \""},{"line_number":149,"context_line":"                               \"creating\")"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        mappers \u003d self.get_classes(resource_type)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_2f304556","line":148,"range":{"start_line":148,"start_character":32,"end_line":148,"end_character":53},"in_reply_to":"1aa78d24_40e8127d","updated":"2016-07-04 07:20:51.000000000","message":"I don\u0027t get it, __name__ is \"gnocchi.indexer.sqlalchemy\" here.","commit_id":"778affc1edbaebf8faddca2fcaac3aeca19f02d2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"38fbf680a298dc8bea8bd0e9b916cae1779b1f2f","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            # TODO(sileht): The idea is to make the delete resource_type more"},{"line_number":211,"context_line":"            # like a cleanup method, I mean we should don\u0027t fail if the"},{"line_number":212,"context_line":"            # constraint have already been dropped or the table have already"},{"line_number":213,"context_line":"            # been deleted. So, when the superuser have fixed it\u0027s backend"},{"line_number":214,"context_line":"            # issue, it can rerun \u0027DELETE ../resource_type/foobar\u0027 even the"},{"line_number":215,"context_line":"            # state is already error and if we are sure all underlying"},{"line_number":216,"context_line":"            # resources have been cleaned we really deleted the resource_type."}],"source_content_type":"text/x-python","patch_set":15,"id":"3aaa91ec_68daaae9","line":213,"range":{"start_line":213,"start_character":62,"end_line":213,"end_character":66},"updated":"2016-06-24 14:28:13.000000000","message":"its or the","commit_id":"778affc1edbaebf8faddca2fcaac3aeca19f02d2"},{"author":{"_account_id":8358,"name":"zhangguoqing","email":"zhang.guoqing@99cloud.net","username":"zhangguoqing"},"change_message_id":"6e62b3145e057386ce9f4f34c5642c715737422f","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            q \u003d q.filter(ResourceType.name \u003d\u003d name)"},{"line_number":380,"context_line":"            update \u003d q.update({\u0027state\u0027: state})"},{"line_number":381,"context_line":"            if update \u003d\u003d 0:"},{"line_number":382,"context_line":"                raise indexer.IndexerException("},{"line_number":383,"context_line":"                    \"Fail to set resource type state of %s to %s\" %"},{"line_number":384,"context_line":"                    (name, state))"},{"line_number":385,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_40449273","line":382,"range":{"start_line":382,"start_character":30,"end_line":382,"end_character":46},"updated":"2016-07-03 02:50:27.000000000","message":"It\u0027s not good. :)","commit_id":"778affc1edbaebf8faddca2fcaac3aeca19f02d2"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b194f35436ca9f91e7754fce0d888fd46dc2c69d","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            q \u003d q.filter(ResourceType.name \u003d\u003d name)"},{"line_number":380,"context_line":"            update \u003d q.update({\u0027state\u0027: state})"},{"line_number":381,"context_line":"            if update \u003d\u003d 0:"},{"line_number":382,"context_line":"                raise indexer.IndexerException("},{"line_number":383,"context_line":"                    \"Fail to set resource type state of %s to %s\" %"},{"line_number":384,"context_line":"                    (name, state))"},{"line_number":385,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_4fddd113","line":382,"range":{"start_line":382,"start_character":30,"end_line":382,"end_character":46},"in_reply_to":"1aa78d24_40449273","updated":"2016-07-04 07:20:51.000000000","message":"Why, if this fail, we need to return a 500, no?","commit_id":"778affc1edbaebf8faddca2fcaac3aeca19f02d2"},{"author":{"_account_id":8358,"name":"zhangguoqing","email":"zhang.guoqing@99cloud.net","username":"zhangguoqing"},"change_message_id":"6e62b3145e057386ce9f4f34c5642c715737422f","unresolved":false,"context_lines":[{"line_number":465,"context_line":"        resource_type \u003d self._get_resource_type(session, name)"},{"line_number":466,"context_line":"        if resource_type.state !\u003d \"active\":"},{"line_number":467,"context_line":"            raise indexer.UnexpectedResourceTypeState("},{"line_number":468,"context_line":"                name, \"active\", resource_type.state)"},{"line_number":469,"context_line":"        return self._RESOURCE_TYPE_MANAGER.get_classes(resource_type)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def list_archive_policies(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_c081a291","line":468,"range":{"start_line":468,"start_character":16,"end_line":468,"end_character":20},"updated":"2016-07-03 02:50:27.000000000","message":"name or resource_type?","commit_id":"778affc1edbaebf8faddca2fcaac3aeca19f02d2"}],"gnocchi/tests/indexer/sqlalchemy/test_migrations.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"24fc48cc28ca9f5624cea0c0c54d82965e8ab9dc","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        return self.index.get_engine()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def db_sync(self, engine):"},{"line_number":62,"context_line":"        # NOTE(jd): Nothing to do here as setUp() in the base class is already"},{"line_number":63,"context_line":"        # creating table using upgrade"},{"line_number":64,"context_line":"        # NOTE(sileht): We ensure all resource type sqlalchemy model are loaded"},{"line_number":65,"context_line":"        # in this process"},{"line_number":66,"context_line":"        for rt in self.index.list_resource_types():"}],"source_content_type":"text/x-python","patch_set":13,"id":"9abb7d3a_3d3ed2b8","line":63,"range":{"start_line":62,"start_character":8,"end_line":63,"end_character":38},"updated":"2016-05-27 11:35:33.000000000","message":"This is wrong","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"d8d909173e6dfb15974af8a72d17962fea516d68","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        return self.index.get_engine()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def db_sync(self, engine):"},{"line_number":62,"context_line":"        # NOTE(jd): Nothing to do here as setUp() in the base class is already"},{"line_number":63,"context_line":"        # creating table using upgrade"},{"line_number":64,"context_line":"        # NOTE(sileht): We ensure all resource type sqlalchemy model are loaded"},{"line_number":65,"context_line":"        # in this process"},{"line_number":66,"context_line":"        for rt in self.index.list_resource_types():"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_4a437842","line":63,"range":{"start_line":62,"start_character":8,"end_line":63,"end_character":38},"in_reply_to":"9abb7d3a_3d3ed2b8","updated":"2016-06-24 07:24:01.000000000","message":"Done","commit_id":"8a22d07cd805d24c1f15a8a7f49a6e035ab4d878"}]}
