)]}'
{"mistral/api/controllers/v2/action_execution.py":[{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"c8e3b826ec000def647e588e6a2548e3528a1fd1","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        if action_ex.task_execution:"},{"line_number":209,"context_line":"            raise exc.NotAllowedException(\"Only ad-hoc action execution can \""},{"line_number":210,"context_line":"                                          \"be deleted.\")"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        return db_api.delete_action_execution(id)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_ed3f9f85","line":211,"updated":"2015-09-01 19:38:20.000000000","message":"Please also check that the action execution is in a completed state and throw exception if it\u0027s not. We shouldn\u0027t leave an action execution that is still running on the executor without a record in the database. If it\u0027s an orphaned execution that\u0027s stuck in RUNNING state, then that\u0027s a separate bug that should be fixed.","commit_id":"7668a5689d32c078ee4ceec9deeecd6ae3154589"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"54105610798e292e9a765a19111ac25ebaa1d9d4","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        if action_ex.task_execution:"},{"line_number":209,"context_line":"            raise exc.NotAllowedException(\"Only ad-hoc action execution can \""},{"line_number":210,"context_line":"                                          \"be deleted.\")"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        return db_api.delete_action_execution(id)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_f4d99584","line":211,"in_reply_to":"da20952f_ed3f9f85","updated":"2015-09-02 06:51:16.000000000","message":"Hi, Winson, yes, I agree with you time, what you said make sense to me. I will fix that.","commit_id":"7668a5689d32c078ee4ceec9deeecd6ae3154589"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"467d8a47f4acb7a794bba0e1f3725bb7dd5db8f7","unresolved":false,"context_lines":[{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        action_ex \u003d db_api.get_action_execution(id)"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        if action_ex.task_execution:"},{"line_number":209,"context_line":"            raise exc.NotAllowedException(\"Only ad-hoc action execution can \""},{"line_number":210,"context_line":"                                          \"be deleted.\")"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_0c6c359b","line":208,"updated":"2015-09-02 10:53:00.000000000","message":"Checking action_ex.task_execution_id would be more efficient because it would not require lazy loading.","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"7d1ecdcde5411d879594e534e9a560845a2e182d","unresolved":false,"context_lines":[{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        action_ex \u003d db_api.get_action_execution(id)"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        if action_ex.task_execution:"},{"line_number":209,"context_line":"            raise exc.NotAllowedException(\"Only ad-hoc action execution can \""},{"line_number":210,"context_line":"                                          \"be deleted.\")"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_20ac5a34","line":208,"in_reply_to":"da20952f_0c6c359b","updated":"2015-09-03 15:40:44.000000000","message":"good suggestion, thanks","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":5558,"name":"Winson Chan","email":"wcchan@stackstorm.com","username":"winson-c-chan"},"change_message_id":"ab520885b9d0706fb6384867942aba799e72d6a2","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            raise exc.NotAllowedException(\"Only ad-hoc action execution can \""},{"line_number":210,"context_line":"                                          \"be deleted.\")"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        if not states.is_completed(action_ex.state):"},{"line_number":213,"context_line":"            raise exc.NotAllowedException(\"Only completed action execution \""},{"line_number":214,"context_line":"                                          \"can be deleted.\")"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_ad5090d5","line":212,"updated":"2015-09-02 18:15:37.000000000","message":"Thanks for adding this.","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"7d1ecdcde5411d879594e534e9a560845a2e182d","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            raise exc.NotAllowedException(\"Only ad-hoc action execution can \""},{"line_number":210,"context_line":"                                          \"be deleted.\")"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        if not states.is_completed(action_ex.state):"},{"line_number":213,"context_line":"            raise exc.NotAllowedException(\"Only completed action execution \""},{"line_number":214,"context_line":"                                          \"can be deleted.\")"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_20853aac","line":212,"in_reply_to":"da20952f_ad5090d5","updated":"2015-09-03 15:40:44.000000000","message":":-)","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"}],"mistral/tests/unit/api/v2/test_action_executions.py":[{"author":{"_account_id":15426,"name":"Guy Paz","email":"guy.paz@alcatel-lucent.com","username":"gpaz"},"change_message_id":"712ec4faf97155837f64ba55dfd874d463adb557","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        self.assertEqual(len(resp.json[\u0027action_executions\u0027]), 0)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_AD_HOC_ACTION)"},{"line_number":287,"context_line":"    @mock.patch.object(db_api, \u0027delete_action_execution\u0027, MOCK_DELETE)"},{"line_number":288,"context_line":"    def test_delete(self):"},{"line_number":289,"context_line":"        cfg.CONF.set_default(\u0027allow_action_execution_deletion\u0027, True, \u0027api\u0027)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_c3f8514c","line":287,"updated":"2015-09-02 09:08:46.000000000","message":"Wondering if its matter that execution is from other tenant ?\nAlso if this operation is from Admin so we need to verify that he able OR able not to execute deletion.\n\nLike we did in test_expiration_policy (create some wfs from other tenants and delete from Admin by change the context)\n\nIn other words I wondering if this test covering cross tenants operations ?\nCreate by A delete by B (valid or negative scenario)","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"c64ac4608381e1b294a96586503e10753c902f30","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        self.assertEqual(len(resp.json[\u0027action_executions\u0027]), 0)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_AD_HOC_ACTION)"},{"line_number":287,"context_line":"    @mock.patch.object(db_api, \u0027delete_action_execution\u0027, MOCK_DELETE)"},{"line_number":288,"context_line":"    def test_delete(self):"},{"line_number":289,"context_line":"        cfg.CONF.set_default(\u0027allow_action_execution_deletion\u0027, True, \u0027api\u0027)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_46af6ee3","line":287,"in_reply_to":"da20952f_23d82c1d","updated":"2015-09-02 09:37:05.000000000","message":"Hi, Guy, I admit that there is a lack of such kind of tests not only for action_execution, but also for executions/workflows/etc. on **server** side.\n\nHowever, we have functional tests on **client** side for that purpose. I\u0027ll add some tests for action_execution deletion in python-mistralclient in a separate patch.\n\nAnyway, appreciate your suggestion! :-)","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"24911c6ef85100b6006b071723981a986911ad21","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        self.assertEqual(len(resp.json[\u0027action_executions\u0027]), 0)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_AD_HOC_ACTION)"},{"line_number":287,"context_line":"    @mock.patch.object(db_api, \u0027delete_action_execution\u0027, MOCK_DELETE)"},{"line_number":288,"context_line":"    def test_delete(self):"},{"line_number":289,"context_line":"        cfg.CONF.set_default(\u0027allow_action_execution_deletion\u0027, True, \u0027api\u0027)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_6c6ff192","line":287,"in_reply_to":"da20952f_46af6ee3","updated":"2015-09-02 10:28:27.000000000","message":"Guys, please take a look at https://github.com/openstack/mistral/blob/master/mistral/tests/unit/db/v2/test_sqlalchemy_db_api.py#L346-L363\n\nand see comments there. There are a few tests per entity in DB for accessing from other tenant.","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"5d114ae4e8551561b34042844b271b9bad7fd0cc","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        self.assertEqual(len(resp.json[\u0027action_executions\u0027]), 0)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_AD_HOC_ACTION)"},{"line_number":287,"context_line":"    @mock.patch.object(db_api, \u0027delete_action_execution\u0027, MOCK_DELETE)"},{"line_number":288,"context_line":"    def test_delete(self):"},{"line_number":289,"context_line":"        cfg.CONF.set_default(\u0027allow_action_execution_deletion\u0027, True, \u0027api\u0027)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_8c8125fe","line":287,"in_reply_to":"da20952f_6c6ff192","updated":"2015-09-02 10:32:09.000000000","message":"So, Lingxian, you could do the same for \u0027delete_action_execution\u0027 in DB tests.","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"7d1ecdcde5411d879594e534e9a560845a2e182d","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        self.assertEqual(len(resp.json[\u0027action_executions\u0027]), 0)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_AD_HOC_ACTION)"},{"line_number":287,"context_line":"    @mock.patch.object(db_api, \u0027delete_action_execution\u0027, MOCK_DELETE)"},{"line_number":288,"context_line":"    def test_delete(self):"},{"line_number":289,"context_line":"        cfg.CONF.set_default(\u0027allow_action_execution_deletion\u0027, True, \u0027api\u0027)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_20fe9a38","line":287,"in_reply_to":"da20952f_8c8125fe","updated":"2015-09-03 15:40:44.000000000","message":"thans for the guidance, Nikolay","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"571f1f4af144bbd172c43c9e5e58e94ce78a3d34","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        self.assertEqual(len(resp.json[\u0027action_executions\u0027]), 0)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_AD_HOC_ACTION)"},{"line_number":287,"context_line":"    @mock.patch.object(db_api, \u0027delete_action_execution\u0027, MOCK_DELETE)"},{"line_number":288,"context_line":"    def test_delete(self):"},{"line_number":289,"context_line":"        cfg.CONF.set_default(\u0027allow_action_execution_deletion\u0027, True, \u0027api\u0027)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_e3d47448","line":287,"in_reply_to":"da20952f_c3f8514c","updated":"2015-09-02 09:18:10.000000000","message":"please see \u0027_secure_query\u0027 method in sqlalchemy, tenant can only perform operations on their own resources, even if he has admin role in Keystone.\n\nIt\u0027s because for now, we don\u0027t support RBAC in Mistral, which may be landed in M dev cycle I think.","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":15426,"name":"Guy Paz","email":"guy.paz@alcatel-lucent.com","username":"gpaz"},"change_message_id":"6789b95f19a9b8d02539d6a042ddd6a334a8c6f8","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        self.assertEqual(len(resp.json[\u0027action_executions\u0027]), 0)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_AD_HOC_ACTION)"},{"line_number":287,"context_line":"    @mock.patch.object(db_api, \u0027delete_action_execution\u0027, MOCK_DELETE)"},{"line_number":288,"context_line":"    def test_delete(self):"},{"line_number":289,"context_line":"        cfg.CONF.set_default(\u0027allow_action_execution_deletion\u0027, True, \u0027api\u0027)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_23d82c1d","line":287,"in_reply_to":"da20952f_e3d47448","updated":"2015-09-02 09:28:21.000000000","message":"This is exactly what I meant.\nI expect to see some test that verifying that tenant will fail when he try to delete some other execution using this new option (delete_action_execution).\nAnd just failing on “non existing execution”.","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"467d8a47f4acb7a794bba0e1f3725bb7dd5db8f7","unresolved":false,"context_lines":[{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        resp \u003d self.app.delete(\u0027/v2/action_executions/123\u0027)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"        self.assertEqual(resp.status_int, 204)"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_NOT_FOUND)"},{"line_number":296,"context_line":"    def test_delete_not_found(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_9713720d","line":293,"updated":"2015-09-02 10:53:00.000000000","message":"Expected value should go first. Please fix it everywhere in the file.","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"7d1ecdcde5411d879594e534e9a560845a2e182d","unresolved":false,"context_lines":[{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        resp \u003d self.app.delete(\u0027/v2/action_executions/123\u0027)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"        self.assertEqual(resp.status_int, 204)"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    @mock.patch.object(db_api, \u0027get_action_execution\u0027, MOCK_NOT_FOUND)"},{"line_number":296,"context_line":"    def test_delete_not_found(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_e0f74257","line":293,"in_reply_to":"da20952f_9713720d","updated":"2015-09-03 15:40:44.000000000","message":"Done","commit_id":"64b39bd564c6a90baf45ec15432bcffeaea04c2a"}]}
