{"action":"created","comment":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/comments/71555413","id":71555413,"diff_hunk":"@@ -82,6 +82,14 @@ def register_opts(ignore_errors=False):\n     ]\n     do_register_opts(content_opts, 'content', ignore_errors)\n \n+    webui_opts = [\n+        cfg.StrOpt('webui_base_url', default='https://localhost',","path":"st2common/st2common/config.py","position":5,"original_position":5,"commit_id":"5dc4e7cb034465dd7d72cecf6a0be246293a8b71","original_commit_id":"5dc4e7cb034465dd7d72cecf6a0be246293a8b71","user":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"body":">Can we move this logic to st2chatops package / bot since it's ChatOps specific (user already needs to configure some environment variables to get bot to work)?\r\n\r\nIt was already there and there are two use cases one of them which it wasn't solving. I called it out in the description. ","created_at":"2016-07-20T16:08:05Z","updated_at":"2016-07-20T16:08:05Z","html_url":"https://github.com/StackStorm/st2/pull/2820#discussion_r71555413","pull_request_url":"https://api.github.com/repos/StackStorm/st2/pulls/2820","_links":{"self":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/comments/71555413"},"html":{"href":"https://github.com/StackStorm/st2/pull/2820#discussion_r71555413"},"pull_request":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2820"}}},"pull_request":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/2820","id":78089096,"html_url":"https://github.com/StackStorm/st2/pull/2820","diff_url":"https://github.com/StackStorm/st2/pull/2820.diff","patch_url":"https://github.com/StackStorm/st2/pull/2820.patch","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/2820","number":2820,"state":"open","locked":false,"title":"WIP: Execution model to contain web_url field for chatops sake","user":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"body":"## What? \r\n\r\nWe want to be able to display the execution history web url in chatops messages on ACK as well as after final results. \r\nhttps://github.com/StackStorm/hubot-stackstorm/issues/120\r\n\r\n## Context \r\n\r\n1. When an action is kicked off we do give out the execution id link. This is because https://github.com/StackStorm/hubot-stackstorm/blob/master/scripts/stackstorm.js#L245 but it unfortunately depends on an env variable https://github.com/StackStorm/st2chatops/blob/master/st2chatops.env#L36. So mostly we get “localhost” based URL. See  https://stackstorm.slack.com/archives/chatopsci/p1468963585000061 (private link). \r\n\r\n2. When an action completes, we don’t share the execution URL. This is obv looking at this https://github.com/StackStorm/st2/blob/master/contrib/chatops/actions/templates/default.j2#L15. \r\n\r\nSo it looks like we need two changes:\r\n\r\n1. A response for alias execution POST should include the history URL \r\n\r\n2. An execution model which is used in post_message should carry the URL with it for final result to show the URL. \r\n\r\nFor both, we need the web URL generated in backend. I have no good way to get the external IP of the box from within st2. So I rely on a config parameter which defaults to https://localhost but users can change it to point to Web UI host. The execution model is now changed to contain ``web_url`` field which will then be used in both hubot-stackstorm (See https://github.com/StackStorm/hubot-stackstorm/pull/122) and post_message. \r\n\r\n## TODO\r\n\r\n* [ ] Tests\r\n* [ ] Docs changes","created_at":"2016-07-20T05:03:08Z","updated_at":"2016-07-20T16:08:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed4edda2d34cc85e5df5e9483779e05cf277e2e7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/StackStorm/st2/pulls/2820/commits","review_comments_url":"https://api.github.com/repos/StackStorm/st2/pulls/2820/comments","review_comment_url":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/2820/comments","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/5dc4e7cb034465dd7d72cecf6a0be246293a8b71","head":{"label":"lakshmi-kannan:chatops_history_url","ref":"chatops_history_url","sha":"5dc4e7cb034465dd7d72cecf6a0be246293a8b71","user":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"repo":{"id":26183288,"name":"st2","full_name":"lakshmi-kannan/st2","owner":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lakshmi-kannan/st2","description":"Home of the StackStorm automation platform.","fork":true,"url":"https://api.github.com/repos/lakshmi-kannan/st2","forks_url":"https://api.github.com/repos/lakshmi-kannan/st2/forks","keys_url":"https://api.github.com/repos/lakshmi-kannan/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lakshmi-kannan/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lakshmi-kannan/st2/teams","hooks_url":"https://api.github.com/repos/lakshmi-kannan/st2/hooks","issue_events_url":"https://api.github.com/repos/lakshmi-kannan/st2/issues/events{/number}","events_url":"https://api.github.com/repos/lakshmi-kannan/st2/events","assignees_url":"https://api.github.com/repos/lakshmi-kannan/st2/assignees{/user}","branches_url":"https://api.github.com/repos/lakshmi-kannan/st2/branches{/branch}","tags_url":"https://api.github.com/repos/lakshmi-kannan/st2/tags","blobs_url":"https://api.github.com/repos/lakshmi-kannan/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lakshmi-kannan/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lakshmi-kannan/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/lakshmi-kannan/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lakshmi-kannan/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/lakshmi-kannan/st2/languages","stargazers_url":"https://api.github.com/repos/lakshmi-kannan/st2/stargazers","contributors_url":"https://api.github.com/repos/lakshmi-kannan/st2/contributors","subscribers_url":"https://api.github.com/repos/lakshmi-kannan/st2/subscribers","subscription_url":"https://api.github.com/repos/lakshmi-kannan/st2/subscription","commits_url":"https://api.github.com/repos/lakshmi-kannan/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/lakshmi-kannan/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/lakshmi-kannan/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/lakshmi-kannan/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/lakshmi-kannan/st2/contents/{+path}","compare_url":"https://api.github.com/repos/lakshmi-kannan/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lakshmi-kannan/st2/merges","archive_url":"https://api.github.com/repos/lakshmi-kannan/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lakshmi-kannan/st2/downloads","issues_url":"https://api.github.com/repos/lakshmi-kannan/st2/issues{/number}","pulls_url":"https://api.github.com/repos/lakshmi-kannan/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/lakshmi-kannan/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/lakshmi-kannan/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lakshmi-kannan/st2/labels{/name}","releases_url":"https://api.github.com/repos/lakshmi-kannan/st2/releases{/id}","deployments_url":"https://api.github.com/repos/lakshmi-kannan/st2/deployments","created_at":"2014-11-04T18:49:03Z","updated_at":"2016-01-20T00:30:02Z","pushed_at":"2016-07-20T04:57:51Z","git_url":"git://github.com/lakshmi-kannan/st2.git","ssh_url":"git@github.com:lakshmi-kannan/st2.git","clone_url":"https://github.com/lakshmi-kannan/st2.git","svn_url":"https://github.com/lakshmi-kannan/st2","homepage":"http://www.stackstorm.com/","size":15030,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"StackStorm:master","ref":"master","sha":"e48c8f3b20b11b00afd4cae15d1ec8c16348b847","user":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"repo":{"id":19051806,"name":"st2","full_name":"StackStorm/st2","owner":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackStorm/st2","description":"StackStorm (aka \"IFTTT for Ops\") is event-driven automation commonly used for auto-remediation, security responses, facilitated troubleshooting, complex deployments, and more. Includes rules engine, workflow,1800+ integrations (see /st2contrib), native ChatOps and so forth.  Installer available at http://docs.stackstorm.com/install/index.html. Ping us on slack - https://stackstorm-community.slack.com/. ","fork":false,"url":"https://api.github.com/repos/StackStorm/st2","forks_url":"https://api.github.com/repos/StackStorm/st2/forks","keys_url":"https://api.github.com/repos/StackStorm/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackStorm/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackStorm/st2/teams","hooks_url":"https://api.github.com/repos/StackStorm/st2/hooks","issue_events_url":"https://api.github.com/repos/StackStorm/st2/issues/events{/number}","events_url":"https://api.github.com/repos/StackStorm/st2/events","assignees_url":"https://api.github.com/repos/StackStorm/st2/assignees{/user}","branches_url":"https://api.github.com/repos/StackStorm/st2/branches{/branch}","tags_url":"https://api.github.com/repos/StackStorm/st2/tags","blobs_url":"https://api.github.com/repos/StackStorm/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackStorm/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackStorm/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackStorm/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/StackStorm/st2/languages","stargazers_url":"https://api.github.com/repos/StackStorm/st2/stargazers","contributors_url":"https://api.github.com/repos/StackStorm/st2/contributors","subscribers_url":"https://api.github.com/repos/StackStorm/st2/subscribers","subscription_url":"https://api.github.com/repos/StackStorm/st2/subscription","commits_url":"https://api.github.com/repos/StackStorm/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackStorm/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackStorm/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackStorm/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackStorm/st2/contents/{+path}","compare_url":"https://api.github.com/repos/StackStorm/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackStorm/st2/merges","archive_url":"https://api.github.com/repos/StackStorm/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackStorm/st2/downloads","issues_url":"https://api.github.com/repos/StackStorm/st2/issues{/number}","pulls_url":"https://api.github.com/repos/StackStorm/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/StackStorm/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/StackStorm/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackStorm/st2/labels{/name}","releases_url":"https://api.github.com/repos/StackStorm/st2/releases{/id}","deployments_url":"https://api.github.com/repos/StackStorm/st2/deployments","created_at":"2014-04-23T00:51:34Z","updated_at":"2016-07-20T05:43:06Z","pushed_at":"2016-07-20T05:03:08Z","git_url":"git://github.com/StackStorm/st2.git","ssh_url":"git@github.com:StackStorm/st2.git","clone_url":"https://github.com/StackStorm/st2.git","svn_url":"https://github.com/StackStorm/st2","homepage":"http://www.stackstorm.com/","size":17580,"stargazers_count":1458,"watchers_count":1458,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":160,"mirror_url":null,"open_issues_count":131,"forks":160,"open_issues":131,"watchers":1458,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2820"},"html":{"href":"https://github.com/StackStorm/st2/pull/2820"},"issue":{"href":"https://api.github.com/repos/StackStorm/st2/issues/2820"},"comments":{"href":"https://api.github.com/repos/StackStorm/st2/issues/2820/comments"},"review_comments":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2820/comments"},"review_comment":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2820/commits"},"statuses":{"href":"https://api.github.com/repos/StackStorm/st2/statuses/5dc4e7cb034465dd7d72cecf6a0be246293a8b71"}}}}
{"actor":{"display_login":"lakshmi-kannan"}}