)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"c293070c2c9fe53f2a95d2287b0c7366f4146b95","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Pending: namespace in actions [not in this patch yet], tests"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I2c66b3961915f0f35a9c468eb6dd0c0c70995234"},{"line_number":12,"context_line":"Implements: mistral-namespace-for-actions-workbooks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_3698b267","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":10},"updated":"2018-07-16 04:43:55.000000000","message":"-\u003e Implements blueprint","commit_id":"56858bb87636299d5cd56a5b56d05fd44a5025f2"}],"mistral/db/sqlalchemy/migration/alembic_migrations/versions/028_add_namespace_column_to_workbooks.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"5e5ae7e6b7c024794077af30cbe7aebf8d7290bd","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        inspect.get_unique_constraints(\u0027workbooks_v2\u0027)"},{"line_number":45,"context_line":"    ]"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    if \u0027name\u0027 in unique_constraints:"},{"line_number":48,"context_line":"        op.drop_index(\u0027name\u0027, table_name\u003d\u0027workbooks_v2\u0027)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    op.create_unique_constraint("},{"line_number":51,"context_line":"        None,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_a6434f6b","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":56},"updated":"2018-07-25 07:34:04.000000000","message":"So we don\u0027t need an index if the column participates in a unique constraint? In my understanding, if the constraint consists of multiple fields then the index will be composite too. But we also need to have a quick search by \"name\" column only.\n\nCan you please explain more detailed what\u0027s going on here? Please also keep in mind that we support Postgres and Mysql. Is it going to work for both?","commit_id":"3b91e831dececbc0a6c528c058fa9483251cc0dd"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"b75f19c377fe6f8cf754e1eedd33dff51a9f2919","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        inspect.get_unique_constraints(\u0027workbooks_v2\u0027)"},{"line_number":45,"context_line":"    ]"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    if \u0027name\u0027 in unique_constraints:"},{"line_number":48,"context_line":"        op.drop_index(\u0027name\u0027, table_name\u003d\u0027workbooks_v2\u0027)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    op.create_unique_constraint("},{"line_number":51,"context_line":"        None,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_283d9328","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":56},"in_reply_to":"5f7c97a3_6da65457","updated":"2018-07-27 07:09:08.000000000","message":"Perfect, thanks!\n\nI think fast lookup by name only is not required because we always use it in combination.","commit_id":"3b91e831dececbc0a6c528c058fa9483251cc0dd"},{"author":{"_account_id":27349,"name":"Hardik Jasani","email":"hardik.jasani@nokia.com","username":"hardikj"},"change_message_id":"298e80a1fd57f94deba5636f4aaa72f13f5b71b5","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        inspect.get_unique_constraints(\u0027workbooks_v2\u0027)"},{"line_number":45,"context_line":"    ]"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    if \u0027name\u0027 in unique_constraints:"},{"line_number":48,"context_line":"        op.drop_index(\u0027name\u0027, table_name\u003d\u0027workbooks_v2\u0027)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    op.create_unique_constraint("},{"line_number":51,"context_line":"        None,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_6da65457","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":56},"in_reply_to":"5f7c97a3_a6434f6b","updated":"2018-07-26 11:39:00.000000000","message":"A unique index is auto created for unique constraint.\nFor unique_constraint of (name, namespace, project_id), a unique index is auto-created.\n\nHere (L47), the index getting dropped is `CREATE UNIQUE INDEX name ON workbooks_v2 (name, project_id);`.\n\nAfter execution of create_unique_constraint, I see following unique index auto created `CREATE UNIQUE INDEX name ON workbooks_v2 (name, namespace, project_id);`.\n\nIf fast lookup on name only is desired, we can add an index on just name column, too. Regarding PostgreSQL compatibility, yes, I had to use this workaround of looping through constraints, as lookup by `constraint_name \u003d name` failed.\nSee https://review.openstack.org/#/c/582482/4..5/mistral/db/sqlalchemy/migration/alembic_migrations/versions/028_add_namespace_column_to_workbooks.py\n\nThis is migration flow is similar to how namespace column was added to workflow table.","commit_id":"3b91e831dececbc0a6c528c058fa9483251cc0dd"}],"mistral/db/v2/sqlalchemy/api.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"c293070c2c9fe53f2a95d2287b0c7366f4146b95","unresolved":false,"context_lines":[{"line_number":541,"context_line":"            namespace\u003dnamespace):"},{"line_number":542,"context_line":"        return create_workflow_definition(values)"},{"line_number":543,"context_line":"    else:"},{"line_number":544,"context_line":"        return update_workflow_definition(name, values, namespace\u003dnamespace)"},{"line_number":545,"context_line":""},{"line_number":546,"context_line":""},{"line_number":547,"context_line":"@b.session_aware()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_f6355a44","line":544,"range":{"start_line":544,"start_character":7,"end_line":544,"end_character":8},"updated":"2018-07-16 04:43:55.000000000","message":"Just a minor suggestion. It usually reads better if in such cases we just remove \"else\" and make the indent of the second \"return\" less.","commit_id":"56858bb87636299d5cd56a5b56d05fd44a5025f2"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"5e5ae7e6b7c024794077af30cbe7aebf8d7290bd","unresolved":false,"context_lines":[{"line_number":570,"context_line":""},{"line_number":571,"context_line":"@b.session_aware()"},{"line_number":572,"context_line":"def create_or_update_workflow_definition(name, values, session\u003dNone):"},{"line_number":573,"context_line":"    namespace \u003d values.get(\u0027namespace\u0027)"},{"line_number":574,"context_line":"    if _get_db_object_by_name_and_namespace_or_id("},{"line_number":575,"context_line":"            models.WorkflowDefinition,"},{"line_number":576,"context_line":"            name,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_06548321","line":573,"updated":"2018-07-25 07:34:04.000000000","message":"Soft: I\u0027d add an empty line before \"if\" and before the last \"return\".","commit_id":"3b91e831dececbc0a6c528c058fa9483251cc0dd"},{"author":{"_account_id":27349,"name":"Hardik Jasani","email":"hardik.jasani@nokia.com","username":"hardikj"},"change_message_id":"298e80a1fd57f94deba5636f4aaa72f13f5b71b5","unresolved":false,"context_lines":[{"line_number":570,"context_line":""},{"line_number":571,"context_line":"@b.session_aware()"},{"line_number":572,"context_line":"def create_or_update_workflow_definition(name, values, session\u003dNone):"},{"line_number":573,"context_line":"    namespace \u003d values.get(\u0027namespace\u0027)"},{"line_number":574,"context_line":"    if _get_db_object_by_name_and_namespace_or_id("},{"line_number":575,"context_line":"            models.WorkflowDefinition,"},{"line_number":576,"context_line":"            name,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_ad71cce1","line":573,"in_reply_to":"5f7c97a3_06548321","updated":"2018-07-26 11:39:00.000000000","message":"Will do, thanks.","commit_id":"3b91e831dececbc0a6c528c058fa9483251cc0dd"}]}
