{"action":"created","issue":{"url":"https://api.github.com/repos/StackStorm/st2/issues/3108","repository_url":"https://api.github.com/repos/StackStorm/st2","labels_url":"https://api.github.com/repos/StackStorm/st2/issues/3108/labels{/name}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/3108/comments","events_url":"https://api.github.com/repos/StackStorm/st2/issues/3108/events","html_url":"https://github.com/StackStorm/st2/pull/3108","id":195190448,"number":3108,"title":"[WIP] Use the same registration order inside the packs register API as we do in st2-register-content","user":{"login":"Kami","id":125088,"avatar_url":"https://avatars.githubusercontent.com/u/125088?v=3","gravatar_id":"","url":"https://api.github.com/users/Kami","html_url":"https://github.com/Kami","followers_url":"https://api.github.com/users/Kami/followers","following_url":"https://api.github.com/users/Kami/following{/other_user}","gists_url":"https://api.github.com/users/Kami/gists{/gist_id}","starred_url":"https://api.github.com/users/Kami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kami/subscriptions","organizations_url":"https://api.github.com/users/Kami/orgs","repos_url":"https://api.github.com/users/Kami/repos","events_url":"https://api.github.com/users/Kami/events{/privacy}","received_events_url":"https://api.github.com/users/Kami/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-13T08:30:11Z","updated_at":"2016-12-13T08:42:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/3108","html_url":"https://github.com/StackStorm/st2/pull/3108","diff_url":"https://github.com/StackStorm/st2/pull/3108.diff","patch_url":"https://github.com/StackStorm/st2/pull/3108.patch"},"body":"This pull request fixes pack register API endpoint to register different resource type in the exact same order as we do in `st2-register-content`.\r\n\r\nNot registering it in the same order could cause different issue:\r\n\r\n1. Output which it not consistent with `st2-register-content`. This could be confusing because both scripts fail on failure on default, but they could fail with a different error in case a different resource is used (e.g. one fails with an error inside action metadata first and other fails with an error inside rule)\r\n2. Rules could get registered before sensors / triggers which would cause an error (trigger doesn't exist)\r\n\r\nThis addresses an issue indirectly reported in https://gist.github.com/lakshmi-kannan/6493c0d303df0622145730cf6b8e2b22. @lakshmi-kannan reported an issue, but it looks like a problem lied elsewhere (it was an \"old\" bug unrelated to my changes) which is nevertheless still a good catch :+1: \r\n\r\n## TODO\r\n\r\n- [ ] Tests"},"comment":{"url":"https://api.github.com/repos/StackStorm/st2/issues/comments/266679098","html_url":"https://github.com/StackStorm/st2/pull/3108#issuecomment-266679098","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/3108","id":266679098,"user":{"login":"Kami","id":125088,"avatar_url":"https://avatars.githubusercontent.com/u/125088?v=3","gravatar_id":"","url":"https://api.github.com/users/Kami","html_url":"https://github.com/Kami","followers_url":"https://api.github.com/users/Kami/followers","following_url":"https://api.github.com/users/Kami/following{/other_user}","gists_url":"https://api.github.com/users/Kami/gists{/gist_id}","starred_url":"https://api.github.com/users/Kami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kami/subscriptions","organizations_url":"https://api.github.com/users/Kami/orgs","repos_url":"https://api.github.com/users/Kami/repos","events_url":"https://api.github.com/users/Kami/events{/privacy}","received_events_url":"https://api.github.com/users/Kami/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T08:42:22Z","updated_at":"2016-12-13T08:42:22Z","body":"While working on this I encountered another \"issue\" - well, it's not an issue because the same behavior exists in register content and it has been then since the begining, but it's something we might need to document or similar.\r\n\r\nRight now, we only register \"dependent\" resources when registering actions and rules - we also register runners when user requests to register actions and we register rule types when user requests to register rules.\r\n\r\nKeep in mind that this only applies when user requests to register a single resource type.\r\n\r\nAnother thing we could do (but it's debatable and maybe current behavior is fine since it has been like that from the beginning) - when user requests to register just rules we could potentially also register other dependent types - notably sensors and triggers.\r\n\r\nImo though, this is not the best behavior, especially because sensors also contain actual sensors in additional to triggers."}}
{"actor":{"display_login":"Kami"}}