)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"d3cdbb1f6d89413d5698cfe8531aa178da822ed7","unresolved":false,"context_lines":[{"line_number":14,"context_line":"This patch reinforces GET API in cron-trigger controller. If the query"},{"line_number":15,"context_line":"key is uuid-like, we will try to retrieve cron-triger by id first, or"},{"line_number":16,"context_line":"we will fall back to retrieve by name."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I9ff657b2604647e734b5539e9bd6a524a3a20efb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7f287b81_b5317fef","line":17,"updated":"2017-08-22 13:10:48.000000000","message":"It would be good to have a bug to reference here.","commit_id":"51e5f8f08c37ca7bf2967f831c5c7f8e0e025b8a"}],"mistral/api/controllers/v2/cron_trigger.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"702acdf550b79d05c89d269560ec5e7e1fe1e4df","unresolved":false,"context_lines":[{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def is_uuid4(uuid):"},{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        UUID(uuid, version\u003d4)"},{"line_number":37,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_ca05d912","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":12},"updated":"2017-08-29 10:07:48.000000000","message":"Not a good place for this method. Look at utils/__init__.py, it has is_valid_uuid() method.","commit_id":"51e5f8f08c37ca7bf2967f831c5c7f8e0e025b8a"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"702acdf550b79d05c89d269560ec5e7e1fe1e4df","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        \"\"\""},{"line_number":50,"context_line":"        acl.enforce(\u0027cron_triggers:get\u0027, context.ctx())"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        db_model \u003d None"},{"line_number":53,"context_line":"        if is_uuid4(id_or_name):"},{"line_number":54,"context_line":"            LOG.info(\u0027Fetch cron trigger [id\u003d%s]\u0027, id_or_name)"},{"line_number":55,"context_line":"            try:"},{"line_number":56,"context_line":"                db_model \u003d db_api.get_cron_trigger_by_id(id_or_name)"},{"line_number":57,"context_line":"            except exc.DBEntityNotFoundError:"},{"line_number":58,"context_line":"                LOG.info((\"Fail to fetch cron trigger [id\u003d%s], \""},{"line_number":59,"context_line":"                          \"try to fetch by name\"), id_or_name)"},{"line_number":60,"context_line":"        if db_model is None:"},{"line_number":61,"context_line":"            LOG.info(\u0027Fetch cron trigger [name\u003d%s]\u0027, id_or_name)"},{"line_number":62,"context_line":"            db_model \u003d db_api.get_cron_trigger(id_or_name)"},{"line_number":63,"context_line":"        return resources.CronTrigger.from_db_model(db_model)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @rest_utils.wrap_wsme_controller_exception"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_2a333df8","line":62,"range":{"start_line":52,"start_character":9,"end_line":62,"end_character":58},"updated":"2017-08-29 10:07:48.000000000","message":"No-no, you should encapsulate how data is fetched from DB inside the DB layer itself. No need to re-invent the wheel, look at, for example, workflow controller and do exactly the same thing. It operated with the parameter \"identifier\" that can be either id or name.\n\nGeneral comment: we should always try to keep the code in controllers minimal and hide all complex logic related with data manipulations etc in underlying layers.","commit_id":"51e5f8f08c37ca7bf2967f831c5c7f8e0e025b8a"}]}
