)]}'
{"mistral/api/controllers/v2/action.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    validate \u003d validation.SpecValidationController("},{"line_number":99,"context_line":"        spec_parser.get_action_list_spec_from_yaml)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _get_db_model(self, name):"},{"line_number":102,"context_line":"        \"\"\"Return the db_model using the action ID or action name"},{"line_number":103,"context_line":"        :param name: ID or name of the Action to get DB model."},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_f2d6f525","line":101,"range":{"start_line":101,"start_character":28,"end_line":101,"end_character":32},"updated":"2016-06-06 21:46:22.000000000","message":"It\u0027s not a name, rather identifier","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    validate \u003d validation.SpecValidationController("},{"line_number":99,"context_line":"        spec_parser.get_action_list_spec_from_yaml)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _get_db_model(self, name):"},{"line_number":102,"context_line":"        \"\"\"Return the db_model using the action ID or action name"},{"line_number":103,"context_line":"        :param name: ID or name of the Action to get DB model."},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_f4ca62a0","line":101,"range":{"start_line":101,"start_character":8,"end_line":101,"end_character":20},"updated":"2016-06-06 21:46:22.000000000","message":"This could be done in the DB API (which would be a better place for such logic IMHO). You can implement method \u0027get_action_definition_by_name_or_id\u0027 and implement all logic inside the DB API","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"9dde0be9b380c8e991b1de51b4e61f804e8c81a2","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    validate \u003d validation.SpecValidationController("},{"line_number":99,"context_line":"        spec_parser.get_action_list_spec_from_yaml)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _get_db_model(self, name):"},{"line_number":102,"context_line":"        \"\"\"Return the db_model using the action ID or action name"},{"line_number":103,"context_line":"        :param name: ID or name of the Action to get DB model."},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_a061a5aa","line":101,"range":{"start_line":101,"start_character":8,"end_line":101,"end_character":20},"in_reply_to":"7aa08908_f4ca62a0","updated":"2016-06-07 08:16:14.000000000","message":"Done","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        \"\"\"Return the db_model using the action ID or action name"},{"line_number":103,"context_line":"        :param name: ID or name of the Action to get DB model."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        \"\"\""},{"line_number":106,"context_line":"        db_model \u003d None"},{"line_number":107,"context_line":"        try:"},{"line_number":108,"context_line":"            db_model \u003d db_api.get_action_definition_by_id(name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_94d67e25","line":105,"range":{"start_line":105,"start_character":0,"end_line":105,"end_character":11},"updated":"2016-06-06 21:46:22.000000000","message":"Missing empty line after multi-line comment","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        \"\"\""},{"line_number":106,"context_line":"        db_model \u003d None"},{"line_number":107,"context_line":"        try:"},{"line_number":108,"context_line":"            db_model \u003d db_api.get_action_definition_by_id(name)"},{"line_number":109,"context_line":"        except exc.DBEntityNotFoundException:"},{"line_number":110,"context_line":"            db_model \u003d db_api.get_action_definition(name)"},{"line_number":111,"context_line":"        return db_model"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_329d1d5a","line":108,"range":{"start_line":108,"start_character":23,"end_line":108,"end_character":57},"updated":"2016-06-06 21:46:22.000000000","message":"if input parameter is a name, not an ID this could make a lot of unnecessary calls to DB. We should rather test if input parameter is an UUID and made a decision based on it.\n\nThis could be done using UUID https://docs.python.org/2/library/uuid.html#uuid.UUID\n\nBTW. Is there a possibility that action name was a valid UUID. If so, even after checking if input parameter is UUID there is still posibility that get_action_definition_by_id throws NotFoundExcepton and in such case we should try to use get_action_definition.","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"9dde0be9b380c8e991b1de51b4e61f804e8c81a2","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        \"\"\""},{"line_number":106,"context_line":"        db_model \u003d None"},{"line_number":107,"context_line":"        try:"},{"line_number":108,"context_line":"            db_model \u003d db_api.get_action_definition_by_id(name)"},{"line_number":109,"context_line":"        except exc.DBEntityNotFoundException:"},{"line_number":110,"context_line":"            db_model \u003d db_api.get_action_definition(name)"},{"line_number":111,"context_line":"        return db_model"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_c012f1b3","line":108,"range":{"start_line":108,"start_character":23,"end_line":108,"end_character":57},"in_reply_to":"7aa08908_329d1d5a","updated":"2016-06-07 08:16:14.000000000","message":"I moved the code to db/api.py and implemented the UUID check and try catch","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    @rest_utils.wrap_wsme_controller_exception"},{"line_number":114,"context_line":"    @wsme_pecan.wsexpose(Action, wtypes.text)"},{"line_number":115,"context_line":"    def get(self, name):"},{"line_number":116,"context_line":"        \"\"\"Return the named action.\"\"\""},{"line_number":117,"context_line":"        LOG.info(\"Fetch action [name\u003d%s]\" % name)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        db_model \u003d self._get_db_model(name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_f22f153c","line":116,"range":{"start_line":115,"start_character":4,"end_line":116,"end_character":38},"updated":"2016-06-06 21:46:22.000000000","message":"After this change it is not a name, it\u0027s rather identifier. It should be described in comment that this can be both ID and name of the action.","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    @wsme_pecan.wsexpose(Action, wtypes.text)"},{"line_number":115,"context_line":"    def get(self, name):"},{"line_number":116,"context_line":"        \"\"\"Return the named action.\"\"\""},{"line_number":117,"context_line":"        LOG.info(\"Fetch action [name\u003d%s]\" % name)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        db_model \u003d self._get_db_model(name)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_d2f2d9d1","line":117,"range":{"start_line":117,"start_character":32,"end_line":117,"end_character":36},"updated":"2016-06-06 21:46:22.000000000","message":"ditto","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        \"\"\"Return the named action.\"\"\""},{"line_number":117,"context_line":"        LOG.info(\"Fetch action [name\u003d%s]\" % name)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        db_model \u003d self._get_db_model(name)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        return Action.from_dict(db_model.to_dict())"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_b2ed8df1","line":119,"range":{"start_line":119,"start_character":38,"end_line":119,"end_character":42},"updated":"2016-06-06 21:46:22.000000000","message":"ditto","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    @rest_utils.wrap_wsme_controller_exception"},{"line_number":176,"context_line":"    @wsme_pecan.wsexpose(None, wtypes.text, status_code\u003d204)"},{"line_number":177,"context_line":"    def delete(self, name):"},{"line_number":178,"context_line":"        \"\"\"Delete the named action.\"\"\""},{"line_number":179,"context_line":"        LOG.info(\"Delete action [name\u003d%s]\" % name)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        with db_api.transaction():"},{"line_number":182,"context_line":"            db_model \u003d self._get_db_model(name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_74c95278","line":179,"range":{"start_line":177,"start_character":0,"end_line":179,"end_character":50},"updated":"2016-06-06 21:46:22.000000000","message":"ditto","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        LOG.info(\"Delete action [name\u003d%s]\" % name)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        with db_api.transaction():"},{"line_number":182,"context_line":"            db_model \u003d self._get_db_model(name)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            if db_model.is_system:"},{"line_number":185,"context_line":"                msg \u003d \"Attempt to delete a system action: %s\" % name"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_b4a1faab","line":182,"range":{"start_line":182,"start_character":42,"end_line":182,"end_character":46},"updated":"2016-06-06 21:46:22.000000000","message":"ditto","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            db_model \u003d self._get_db_model(name)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            if db_model.is_system:"},{"line_number":185,"context_line":"                msg \u003d \"Attempt to delete a system action: %s\" % name"},{"line_number":186,"context_line":"                raise exc.DataAccessException(msg)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            db_api.delete_action_definition(name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_d4ae4697","line":185,"range":{"start_line":185,"start_character":64,"end_line":185,"end_character":68},"updated":"2016-06-06 21:46:22.000000000","message":"ditto","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"9e6444b627091a8326b7eb1cc2048c6d452a179d","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                msg \u003d \"Attempt to delete a system action: %s\" % name"},{"line_number":186,"context_line":"                raise exc.DataAccessException(msg)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            db_api.delete_action_definition(name)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    @wsme_pecan.wsexpose(Actions, types.uuid, int, types.uniquelist,"},{"line_number":191,"context_line":"                         types.list)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_f499c26f","line":188,"range":{"start_line":188,"start_character":19,"end_line":188,"end_character":43},"updated":"2016-06-06 21:46:22.000000000","message":"If parameter \u0027name\u0027 can be both name and ID you no longer can use this method, since it only expecting name","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"9dde0be9b380c8e991b1de51b4e61f804e8c81a2","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                msg \u003d \"Attempt to delete a system action: %s\" % name"},{"line_number":186,"context_line":"                raise exc.DataAccessException(msg)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            db_api.delete_action_definition(name)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    @wsme_pecan.wsexpose(Actions, types.uuid, int, types.uniquelist,"},{"line_number":191,"context_line":"                         types.list)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_f0925c9e","line":188,"range":{"start_line":188,"start_character":19,"end_line":188,"end_character":43},"in_reply_to":"7aa08908_f499c26f","updated":"2016-06-07 08:16:14.000000000","message":"I think the change in \"delete\" function should be in other patchset, so I\u0027ll keep it as it is right now in upstream","commit_id":"425ec41cedbd69831bb27998e7e863db1943cab2"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"537321d799c7e7328ed60339dbe8bee42d3d6b35","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    @wsme_pecan.wsexpose(Action, wtypes.text)"},{"line_number":103,"context_line":"    def get(self, identifier):"},{"line_number":104,"context_line":"        \"\"\"Return the named action."},{"line_number":105,"context_line":"        :param name: ID or name of the Action to get."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_c9b776d6","line":105,"updated":"2016-06-08 07:15:53.000000000","message":"This should be\n\n    :param identifier:","commit_id":"3a1a431d6b151a1f2f364e60a2a181fc0cc83ad8"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"fc5f9c7b815320aff47d23d33eee09fdc6db248e","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    @rest_utils.wrap_wsme_controller_exception"},{"line_number":175,"context_line":"    @wsme_pecan.wsexpose(None, wtypes.text, status_code\u003d204)"},{"line_number":176,"context_line":"    def delete(self, name):"},{"line_number":177,"context_line":"        \"\"\"Delete the named action.\"\"\""},{"line_number":178,"context_line":"        acl.enforce(\u0027actions:delete\u0027, context.ctx())"},{"line_number":179,"context_line":"        LOG.info(\"Delete action [name\u003d%s]\" % name)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_e2aede2c","line":176,"range":{"start_line":176,"start_character":21,"end_line":176,"end_character":25},"updated":"2016-07-12 04:38:19.000000000","message":"Why did you revert to using name instead of identifier? I don\u0027t understand..","commit_id":"25ace1e2ab9c17ddc02feb2213719e59185bcc9a"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"7f06bdbc7c805367844ede65fb0567f2537a31bf","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                         types.uniquelist, wtypes.text, wtypes.text,"},{"line_number":190,"context_line":"                         wtypes.text, bool, wtypes.text)"},{"line_number":191,"context_line":"    def get_all(self, marker\u003dNone, limit\u003dNone, sort_keys\u003d\u0027name\u0027,"},{"line_number":192,"context_line":"                sort_dirs\u003d\u0027asc\u0027, fields\u003d\u0027\u0027, created_at\u003dNone, name\u003dNone,"},{"line_number":193,"context_line":"                scope\u003dNone, tag\u003dNone, tags\u003dNone, updated_at\u003dNone,"},{"line_number":194,"context_line":"                description\u003dNone, definition\u003dNone, is_system\u003dNone, input\u003dNone):"},{"line_number":195,"context_line":"        \"\"\"Return all actions."},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        :param marker: Optional. Pagination marker for large data sets."}],"source_content_type":"text/x-python","patch_set":19,"id":"dada55a8_2153bd6c","side":"PARENT","line":194,"range":{"start_line":192,"start_character":44,"end_line":194,"end_character":79},"updated":"2016-07-20 17:44:30.000000000","message":"Why this got deleted and changed to **filters? Due to discusson here: https://review.openstack.org/#/c/334311/ **filters is not working properly.","commit_id":"242cb41008bf77ecc8fd1a1a6c10c4d78969abeb"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"7f06bdbc7c805367844ede65fb0567f2537a31bf","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    def get(self, identifier):"},{"line_number":106,"context_line":"        \"\"\"Return the named action."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        :param name: ID or name of the Action to get."},{"line_number":109,"context_line":"        \"\"\""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        acl.enforce(\u0027actions:get\u0027, context.ctx())"}],"source_content_type":"text/x-python","patch_set":19,"id":"dada55a8_21cd7d85","line":108,"range":{"start_line":108,"start_character":15,"end_line":108,"end_character":19},"updated":"2016-07-20 17:44:30.000000000","message":"\u0027name\u0027 is not valid name of parameter; should be \u0027identifier\u0027","commit_id":"222010a8e5a06c1f969d3e908e80f65c9f5aecf6"}],"mistral/db/v2/api.py":[{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"b873e94a4709747b337d8fcd367a5541e3d1f6f7","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslo_db import api as db_api"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from uuid import UUID"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"_BACKEND_MAPPING \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_1343b243","line":22,"range":{"start_line":22,"start_character":0,"end_line":22,"end_character":21},"updated":"2016-06-07 08:31:47.000000000","message":"I will recommend yo to use from oslo_utils import uuidutils","commit_id":"3a1a431d6b151a1f2f364e60a2a181fc0cc83ad8"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"537321d799c7e7328ed60339dbe8bee42d3d6b35","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslo_db import api as db_api"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from uuid import UUID"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"_BACKEND_MAPPING \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_49d38604","line":22,"in_reply_to":"7aa08908_1343b243","updated":"2016-06-08 07:15:53.000000000","message":"(side note: I didn\u0027t know about this, I\u0027ll look into why it is useful - thanks!)","commit_id":"3a1a431d6b151a1f2f364e60a2a181fc0cc83ad8"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"b873e94a4709747b337d8fcd367a5541e3d1f6f7","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_action_definition(name):"},{"line_number":161,"context_line":"    return IMPL.get_action_definition(name)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"def get_action_definition_by_name_or_id(identifier):"},{"line_number":164,"context_line":"    \"\"\"Return the db_model using the action ID or action name"},{"line_number":165,"context_line":"    :param identifier: ID or name of the Action to get DB model."},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    \"\"\""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    try:"},{"line_number":170,"context_line":"        UUID(identifier)"},{"line_number":171,"context_line":"        return get_action_definition_by_id(identifier)"},{"line_number":172,"context_line":"    except ValueError, exc.DBEntityNotFoundException:"},{"line_number":173,"context_line":"        return get_action_definition(identifier)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"def load_action_definition(name):"},{"line_number":176,"context_line":"    \"\"\"Unlike get_action_definition this method is allowed to return None.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_133c52c7","line":173,"range":{"start_line":163,"start_character":0,"end_line":173,"end_character":48},"updated":"2016-06-07 08:31:47.000000000","message":"This is not right place for this method. This is implementation class. you should modify https://github.com/openstack/mistral/blob/master/mistral/db/v2/sqlalchemy/api.py#L459 method to check whether identifier is uuid like or not and according to that you have to fetch data from database.","commit_id":"3a1a431d6b151a1f2f364e60a2a181fc0cc83ad8"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1b5ad33a9f5842b6d77cd9c93b12e2116c85b962","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"def get_action_definition_by_name_or_id(identifier):"},{"line_number":161,"context_line":"    \"\"\"Return the db_model using the action ID or action name\"\"\""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    return IMPL.get_action_definition_by_name_or_id(identifier)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_84b35397","line":162,"updated":"2016-06-08 22:11:02.000000000","message":"Soft: if there is only return statement in the function, do not leave blank line before return statement (see next function for reference)","commit_id":"783007973096caf0d5b01a0b712b285bbf9b5246"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"62f1047d93c6040cc17d16722ee74e5b62cf9561","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    return IMPL.get_action_definition(name)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"def get_action_definition_by_name_or_id(identifier):"},{"line_number":169,"context_line":"    \"\"\"Return the db_model using the action ID or action name\"\"\""},{"line_number":170,"context_line":"    return IMPL.get_action_definition_by_name_or_id(identifier)"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_b2f0df67","line":168,"range":{"start_line":168,"start_character":25,"end_line":168,"end_character":39},"updated":"2016-07-11 04:53:31.000000000","message":"Please remove \"by_name_or_id\" and leave it just \"get_action_definition\", now it\u0027s inconsistent with get_workflow_definition.","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"6f4b919edf0154d7f68d7ffcacc13fe8be8a2664","unresolved":false,"context_lines":[{"line_number":165,"context_line":"    return IMPL.get_action_definition(name)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"def get_action_definition_by_name_or_id(identifier):"},{"line_number":169,"context_line":"    \"\"\"Return the db_model using the action ID or action name\"\"\""},{"line_number":170,"context_line":"    return IMPL.get_action_definition_by_name_or_id(identifier)"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_4d77593a","line":168,"range":{"start_line":168,"start_character":25,"end_line":168,"end_character":39},"in_reply_to":"1aa78d24_b2f0df67","updated":"2016-07-11 13:03:45.000000000","message":"Done","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"fc5f9c7b815320aff47d23d33eee09fdc6db248e","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    return IMPL.get_action_definition_by_id(id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"def get_action_definition_name(name):"},{"line_number":165,"context_line":"    return IMPL.get_action_definition_name(name)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_a2469678","line":164,"range":{"start_line":164,"start_character":4,"end_line":164,"end_character":30},"updated":"2016-07-12 04:38:19.000000000","message":"Why did you keep \"name\"?","commit_id":"25ace1e2ab9c17ddc02feb2213719e59185bcc9a"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"eebb2669aec65ce50a190ac28129478a7c662b6d","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    return IMPL.get_action_definition_by_id(id)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"def get_action_definition_name(name):"},{"line_number":165,"context_line":"    return IMPL.get_action_definition_name(name)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_3bb48833","line":164,"range":{"start_line":164,"start_character":4,"end_line":164,"end_character":30},"in_reply_to":"1aa78d24_a2469678","updated":"2016-07-12 08:01:26.000000000","message":"Done","commit_id":"25ace1e2ab9c17ddc02feb2213719e59185bcc9a"}],"mistral/db/v2/sqlalchemy/api.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"1b5ad33a9f5842b6d77cd9c93b12e2116c85b962","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        )"},{"line_number":187,"context_line":"    )"},{"line_number":188,"context_line":"    return query.first()"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"# Workbook definitions."},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"def get_workbook(name):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_e44fb78f","line":189,"updated":"2016-06-08 22:11:02.000000000","message":"Missing 2 blank lines before comment (this makes pep8 to fail)","commit_id":"783007973096caf0d5b01a0b712b285bbf9b5246"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"62f1047d93c6040cc17d16722ee74e5b62cf9561","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    return _secure_query(model).filter_by(id\u003did).first()"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"def _get_db_object_by_name_or_id(model, identifier):"},{"line_number":217,"context_line":"    query \u003d _secure_query(model)"},{"line_number":218,"context_line":"    query \u003d query.filter("},{"line_number":219,"context_line":"        sa.or_("}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_cdcfceb1","line":216,"range":{"start_line":216,"start_character":19,"end_line":216,"end_character":32},"updated":"2016-07-11 04:53:31.000000000","message":"For this internal method it\u0027s good that you use \"by_name_or_id\", we can be more precise here to understand the logic exactly.","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"62f1047d93c6040cc17d16722ee74e5b62cf9561","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"def _get_db_object_by_name_or_id(model, identifier):"},{"line_number":217,"context_line":"    query \u003d _secure_query(model)"},{"line_number":218,"context_line":"    query \u003d query.filter("},{"line_number":219,"context_line":"        sa.or_("},{"line_number":220,"context_line":"            model.id \u003d\u003d identifier,"},{"line_number":221,"context_line":"            model.name \u003d\u003d identifier"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_ad07e2c7","line":218,"range":{"start_line":218,"start_character":4,"end_line":218,"end_character":9},"updated":"2016-07-11 04:53:31.000000000","message":"This implementation is OK but it seems like algorithm in get_workflow_definition() is more efficient because it generates a simpler SQL by determining a field name in advance. I would suggest you change this method in a similar way and reuse it in both get_action_definition() and get_workflow_definition()","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"6f4b919edf0154d7f68d7ffcacc13fe8be8a2664","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"def _get_db_object_by_name_or_id(model, identifier):"},{"line_number":217,"context_line":"    query \u003d _secure_query(model)"},{"line_number":218,"context_line":"    query \u003d query.filter("},{"line_number":219,"context_line":"        sa.or_("},{"line_number":220,"context_line":"            model.id \u003d\u003d identifier,"},{"line_number":221,"context_line":"            model.name \u003d\u003d identifier"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_81b90ace","line":218,"range":{"start_line":218,"start_character":4,"end_line":218,"end_character":9},"in_reply_to":"1aa78d24_ad07e2c7","updated":"2016-07-11 13:03:45.000000000","message":"Done","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"62f1047d93c6040cc17d16722ee74e5b62cf9561","unresolved":false,"context_lines":[{"line_number":316,"context_line":"    \"\"\""},{"line_number":317,"context_line":"    wf_def \u003d (_get_workflow_definition_by_id(identifier)"},{"line_number":318,"context_line":"              if uuidutils.is_uuid_like(identifier)"},{"line_number":319,"context_line":"              else _get_workflow_definition(identifier))"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"    if not wf_def:"},{"line_number":322,"context_line":"        raise exc.DBEntityNotFoundError("}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_8d55c6c7","line":319,"range":{"start_line":319,"start_character":19,"end_line":319,"end_character":43},"updated":"2016-07-11 04:53:31.000000000","message":"(Not about this patch): Needs to add \"by_name\" at the end, otherwise it looks inconsistent.","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"62f1047d93c6040cc17d16722ee74e5b62cf9561","unresolved":false,"context_lines":[{"line_number":459,"context_line":"    return _delete_all(models.WorkflowDefinition, **kwargs)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"def _get_workflow_definition(name):"},{"line_number":463,"context_line":"    return _get_db_object_by_name(models.WorkflowDefinition, name)"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_d2300b0a","line":462,"range":{"start_line":462,"start_character":4,"end_line":462,"end_character":28},"updated":"2016-07-11 04:53:31.000000000","message":"Just a note (not related to this patch): this method should be called _get_workflow_definition_by_name(). Actually I would even remove this too methods _get_workflow_definition() and _get_workflow_definition_by_id(), I think they are redundant, we can easily use _get_db_object_by_id() and _get_db_object_by_id()","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"62f1047d93c6040cc17d16722ee74e5b62cf9561","unresolved":false,"context_lines":[{"line_number":531,"context_line":""},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"@b.session_aware()"},{"line_number":534,"context_line":"def update_action_definition(name, values, session\u003dNone):"},{"line_number":535,"context_line":"    a_def \u003d _get_action_definition(name)"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"    if not a_def:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_2dbf72fd","line":534,"range":{"start_line":534,"start_character":4,"end_line":534,"end_character":28},"updated":"2016-07-11 04:53:31.000000000","message":"This method needs to be refactored too because it takes action name.","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"6f4b919edf0154d7f68d7ffcacc13fe8be8a2664","unresolved":false,"context_lines":[{"line_number":531,"context_line":""},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"@b.session_aware()"},{"line_number":534,"context_line":"def update_action_definition(name, values, session\u003dNone):"},{"line_number":535,"context_line":"    a_def \u003d _get_action_definition(name)"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"    if not a_def:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_c10f9286","line":534,"range":{"start_line":534,"start_character":4,"end_line":534,"end_character":28},"in_reply_to":"1aa78d24_2dbf72fd","updated":"2016-07-11 13:03:45.000000000","message":"I would suggest to do it in other patch, since this change was raised because a current problem using Mistral from Horizon. Update Action Definition is working in Horizon","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"62f1047d93c6040cc17d16722ee74e5b62cf9561","unresolved":false,"context_lines":[{"line_number":545,"context_line":""},{"line_number":546,"context_line":""},{"line_number":547,"context_line":"@b.session_aware()"},{"line_number":548,"context_line":"def create_or_update_action_definition(name, values, session\u003dNone):"},{"line_number":549,"context_line":"    if not _get_action_definition(name):"},{"line_number":550,"context_line":"        return create_action_definition(values)"},{"line_number":551,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_cd36aeb3","line":548,"range":{"start_line":548,"start_character":4,"end_line":548,"end_character":38},"updated":"2016-07-11 04:53:31.000000000","message":"And this too.","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8533,"name":"Marcos Fermín Lobo","email":"lobo@lukos.org","username":"mlobo"},"change_message_id":"6f4b919edf0154d7f68d7ffcacc13fe8be8a2664","unresolved":false,"context_lines":[{"line_number":545,"context_line":""},{"line_number":546,"context_line":""},{"line_number":547,"context_line":"@b.session_aware()"},{"line_number":548,"context_line":"def create_or_update_action_definition(name, values, session\u003dNone):"},{"line_number":549,"context_line":"    if not _get_action_definition(name):"},{"line_number":550,"context_line":"        return create_action_definition(values)"},{"line_number":551,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_411c42c1","line":548,"range":{"start_line":548,"start_character":4,"end_line":548,"end_character":38},"in_reply_to":"1aa78d24_cd36aeb3","updated":"2016-07-11 13:03:45.000000000","message":"Same than before","commit_id":"8b86cb23275eccf810c67ccf1796acb19fde12ab"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"521201f9f46d5ccead40cf2d27d029a1ebae690a","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    return _get_collection(model, sort_keys\u003dsort_keys, **kwargs)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"def _get_db_object_by_name(model, name):"},{"line_number":220,"context_line":"    return _secure_query(model).filter_by(name\u003dname).first()"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"dada55a8_c1c9eaad","line":219,"range":{"start_line":219,"start_character":9,"end_line":219,"end_character":11},"updated":"2016-07-21 06:23:38.000000000","message":"A side note: we can remove \"db\" from method names safely because we\u0027re in the context related to DB operations. So \"db\" is redundant.","commit_id":"0d8a3a8c64561e48a32c99e066d04a6f0e22778f"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"521201f9f46d5ccead40cf2d27d029a1ebae690a","unresolved":false,"context_lines":[{"line_number":349,"context_line":"    return wf_def"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"def load_workflow_definition(name):"},{"line_number":353,"context_line":"    return _get_db_object_by_name(models.WorkflowDefinition, name)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"dada55a8_0176626f","line":352,"range":{"start_line":352,"start_character":29,"end_line":352,"end_character":33},"updated":"2016-07-21 06:23:38.000000000","message":"Soft: we need to make this method use \"identifier\" as well for consistency with other methods. Ok to address in a separate patch.","commit_id":"0d8a3a8c64561e48a32c99e066d04a6f0e22778f"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"521201f9f46d5ccead40cf2d27d029a1ebae690a","unresolved":false,"context_lines":[{"line_number":498,"context_line":"    return a_def"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"def load_action_definition(name):"},{"line_number":502,"context_line":"    return _get_db_object_by_name(models.ActionDefinition, name)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"dada55a8_a1df9638","line":501,"range":{"start_line":501,"start_character":27,"end_line":501,"end_character":31},"updated":"2016-07-21 06:23:38.000000000","message":"Soft: it should be identifier as well. Ok to address separately.","commit_id":"0d8a3a8c64561e48a32c99e066d04a6f0e22778f"}],"mistral/tests/unit/api/v2/test_actions.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"a657a1b95d8947f91fe81c34853b428d932b3893","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"class TestActionsController(base.APITest):"},{"line_number":127,"context_line":"    @mock.patch.object(db_api, \"get_action_definition\", MOCK_ACTION)"},{"line_number":128,"context_line":"    def test_get(self):"},{"line_number":129,"context_line":"        resp \u003d self.app.get(\u0027/v2/actions/my_action\u0027)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7aa08908_23e52308","line":127,"range":{"start_line":127,"start_character":32,"end_line":127,"end_character":53},"updated":"2016-06-09 09:05:27.000000000","message":"You need to change this in order to have py27/py34 test pass since you have change name of the method used in API to \u0027get_action_definition_by_name_or_id\u0027.\n\nSame appears to all other tests that calls actions API with GET.","commit_id":"05b4d64a3950d472afce24450f9e3e6af2422ec4"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"a657a1b95d8947f91fe81c34853b428d932b3893","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        resp \u003d self.app.get(url)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"        self.assertEqual(200, resp.status_int)"},{"line_number":146,"context_line":"        self.assertDictEqual(ACTION[\u0027id\u0027], resp.json[\u0027id\u0027])"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @mock.patch.object(db_api, \"get_action_definition\", MOCK_NOT_FOUND)"},{"line_number":149,"context_line":"    def test_get_by_id_not_found(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7aa08908_fea3b4fd","line":146,"range":{"start_line":146,"start_character":0,"end_line":146,"end_character":59},"updated":"2016-06-09 09:05:27.000000000","message":"assertDictEqual checks if two dictonaries are the same. Unfortunately, ACTION[\u0027id\u0027] is not a dict - it is a string. Please remove [\u0027id\u0027] from both parameters.\n\nIf you want to check if two strings are equal, use assertEqual method.","commit_id":"05b4d64a3950d472afce24450f9e3e6af2422ec4"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"class TestActionsController(base.APITest):"},{"line_number":127,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_id\", MOCK_ACTION)"},{"line_number":128,"context_line":"    def test_get(self):"},{"line_number":129,"context_line":"        resp \u003d self.app.get(\u0027/v2/actions/my_action\u0027)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_d3e5f1a8","line":127,"range":{"start_line":127,"start_character":0,"end_line":127,"end_character":82},"updated":"2016-06-20 12:24:37.000000000","message":"This line is over 80 chars long, which makes pep8 to fail. It should look like this:\n\n    @mock.patch.object(\n        db_api,\n        \"get_action_definition_by_name_or_id\",\n        MOCK_ACTION\n    )","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self.assertEqual(200, resp.status_int)"},{"line_number":132,"context_line":"        self.assertDictEqual(ACTION, resp.json)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_id\", MOCK_NOT_FOUND)"},{"line_number":135,"context_line":"    def test_get_not_found(self):"},{"line_number":136,"context_line":"        resp \u003d self.app.get(\u0027/v2/actions/my_action\u0027, expect_errors\u003dTrue)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_f3f2ad6e","line":134,"range":{"start_line":134,"start_character":0,"end_line":134,"end_character":85},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        self.assertEqual(404, resp.status_int)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_id\", MOCK_ACTION)"},{"line_number":141,"context_line":"    def test_get_by_id(self):"},{"line_number":142,"context_line":"        url \u003d \u0027/v2/actions/{0}\u0027.format(ACTION[\u0027id\u0027])"},{"line_number":143,"context_line":"        resp \u003d self.app.get(url)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_33ed558c","line":140,"range":{"start_line":140,"start_character":0,"end_line":140,"end_character":82},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        self.assertEqual(200, resp.status_int)"},{"line_number":146,"context_line":"        self.assertEqual(ACTION[\u0027id\u0027], resp.json[\u0027id\u0027])"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_id\", MOCK_NOT_FOUND)"},{"line_number":149,"context_line":"    def test_get_by_id_not_found(self):"},{"line_number":150,"context_line":"        url \u003d \u0027/v2/actions/1234\u0027"},{"line_number":151,"context_line":"        resp \u003d self.app.get(url, expect_errors\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_d39331f9","line":148,"range":{"start_line":148,"start_character":0,"end_line":148,"end_character":85},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        self.assertEqual(404, resp.status_int)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_id\", MOCK_ACTION)"},{"line_number":156,"context_line":"    @mock.patch.object("},{"line_number":157,"context_line":"        db_api, \"create_or_update_action_definition\", MOCK_UPDATED_ACTION"},{"line_number":158,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_53b6218b","line":155,"range":{"start_line":155,"start_character":0,"end_line":155,"end_character":82},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        self.assertEqual(404, resp.status_int)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_id\", MOCK_SYSTEM_ACTION)"},{"line_number":202,"context_line":"    def test_put_system(self):"},{"line_number":203,"context_line":"        resp \u003d self.app.put("},{"line_number":204,"context_line":"            \u0027/v2/actions\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_33bb9574","line":201,"range":{"start_line":201,"start_character":0,"end_line":201,"end_character":89},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        self.assertEqual(409, resp.status_int)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_id\", MOCK_ACTION)"},{"line_number":281,"context_line":"    @mock.patch.object(db_api, \"delete_action_definition\", MOCK_DELETE)"},{"line_number":282,"context_line":"    def test_delete(self):"},{"line_number":283,"context_line":"        resp \u003d self.app.delete(\u0027/v2/actions/my_action\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_93b0898d","line":280,"range":{"start_line":280,"start_character":0,"end_line":280,"end_character":82},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        self.assertIn(\u0027Attempt to delete a system action: std.echo\u0027,"},{"line_number":299,"context_line":"                      resp.json[\u0027faultstring\u0027])"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_ids\", MOCK_ACTIONS)"},{"line_number":302,"context_line":"    def test_get_all(self):"},{"line_number":303,"context_line":"        resp \u003d self.app.get(\u0027/v2/actions\u0027)"},{"line_number":304,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_73ad1d31","line":301,"range":{"start_line":301,"start_character":0,"end_line":301,"end_character":84},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        self.assertIn(\u0027Attempt to delete a system action: std.echo\u0027,"},{"line_number":299,"context_line":"                      resp.json[\u0027faultstring\u0027])"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_ids\", MOCK_ACTIONS)"},{"line_number":302,"context_line":"    def test_get_all(self):"},{"line_number":303,"context_line":"        resp \u003d self.app.get(\u0027/v2/actions\u0027)"},{"line_number":304,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_93d1a9fe","line":301,"range":{"start_line":301,"start_character":65,"end_line":301,"end_character":68},"updated":"2016-06-20 12:24:37.000000000","message":"id","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        self.assertEqual(1, len(resp.json[\u0027actions\u0027]))"},{"line_number":308,"context_line":"        self.assertDictEqual(ACTION, resp.json[\u0027actions\u0027][0])"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_ids\", MOCK_EMPTY)"},{"line_number":311,"context_line":"    def test_get_all_empty(self):"},{"line_number":312,"context_line":"        resp \u003d self.app.get(\u0027/v2/actions\u0027)"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_7374fdce","line":310,"range":{"start_line":310,"start_character":0,"end_line":310,"end_character":82},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        self.assertEqual(1, len(resp.json[\u0027actions\u0027]))"},{"line_number":308,"context_line":"        self.assertDictEqual(ACTION, resp.json[\u0027actions\u0027][0])"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_ids\", MOCK_EMPTY)"},{"line_number":311,"context_line":"    def test_get_all_empty(self):"},{"line_number":312,"context_line":"        resp \u003d self.app.get(\u0027/v2/actions\u0027)"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_b3d8251f","line":310,"range":{"start_line":310,"start_character":65,"end_line":310,"end_character":68},"updated":"2016-06-20 12:24:37.000000000","message":"id","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        self.assertEqual(0, len(resp.json[\u0027actions\u0027]))"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_ids\", MOCK_ACTIONS)"},{"line_number":319,"context_line":"    def test_get_all_pagination(self):"},{"line_number":320,"context_line":"        resp \u003d self.app.get("},{"line_number":321,"context_line":"            \u0027/v2/actions?limit\u003d1\u0026sort_keys\u003did,name\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_134ad983","line":318,"range":{"start_line":318,"start_character":0,"end_line":318,"end_character":84},"updated":"2016-06-20 12:24:37.000000000","message":"ditto","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"44ef4dfb199501fe147202a20593f9f0388973f9","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        self.assertEqual(0, len(resp.json[\u0027actions\u0027]))"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"    @mock.patch.object(db_api, \"get_action_definition_by_name_or_ids\", MOCK_ACTIONS)"},{"line_number":319,"context_line":"    def test_get_all_pagination(self):"},{"line_number":320,"context_line":"        resp \u003d self.app.get("},{"line_number":321,"context_line":"            \u0027/v2/actions?limit\u003d1\u0026sort_keys\u003did,name\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a9d85d2_1304997c","line":318,"range":{"start_line":318,"start_character":65,"end_line":318,"end_character":68},"updated":"2016-06-20 12:24:37.000000000","message":"id","commit_id":"609e3a6d512109f1cfbfc6b6a55e6c6df552ce83"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"521201f9f46d5ccead40cf2d27d029a1ebae690a","unresolved":false,"context_lines":[{"line_number":142,"context_line":"    @mock.patch.object(db_api, \"update_action_definition\", MOCK_UPDATED_ACTION)"},{"line_number":143,"context_line":"    @mock.patch.object("},{"line_number":144,"context_line":"        db_api, \"get_action_definition\", MOCK_ACTION)"},{"line_number":145,"context_line":"    def test_get_by_id(self):"},{"line_number":146,"context_line":"        url \u003d \u0027/v2/actions/{0}\u0027.format(ACTION[\u0027id\u0027])"},{"line_number":147,"context_line":"        resp \u003d self.app.get(url)"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"dada55a8_21a8c676","line":145,"range":{"start_line":145,"start_character":8,"end_line":145,"end_character":22},"updated":"2016-07-21 06:23:38.000000000","message":"IMO this test doesn\u0027t test much because the main difference between using just name and identifier is in db search. But we just mock DB search. It\u0027s not a critical comment, this is a problem of our API tests in general. In the beginning I was for decoupling API tests from DB operations by mocking DB ops but now I tend to change my opinion.","commit_id":"0d8a3a8c64561e48a32c99e066d04a6f0e22778f"}]}
