{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/samson/pulls/comments/80154717","id":80154717,"diff_hunk":"@@ -34,17 +34,42 @@ def post_event(deploy)\n \n       def build_event(deploy)\n         event = {\n-          id:           deploy.id,\n-          name:         deploy.project.name,\n-          actor:        deploy.user.name,\n-          status:       deploy.status,\n-          started_at:   deploy.created_at.iso8601,\n-          summary:      deploy.summary,\n-          environment:  deploy.stage.deploy_groups.map(&:environment).uniq.map(&:permalink).map(&:downcase).join(\",\"),\n-          url:          deploy.url,\n-          pods:         deploy.stage.deploy_groups.map(&:env_value)\n+          id:            deploy.id,\n+          name:          deploy.project.name,\n+          actor:         deploy.user.name,\n+          status:        deploy.status,\n+          started_at:    deploy.updated_at.iso8601,\n+          summary:       deploy.summary,\n+          environment:   deploy.stage.deploy_groups.map(&:environment).uniq.map(&:permalink).map(&:downcase).join(\",\"),\n+          url:           deploy.url,\n+          pods:          pods(deploy.stage.deploy_groups),\n+          pull_requests: pull_requests(deploy.changeset)\n         }\n-        { \"events\": [event] }\n+        {\"events\": [event]}\n+      end\n+\n+      def pods(deploy_groups)\n+        deploy_groups.map { |dg| dg.env_value.match(/^pod(\\d+).*/) }.compact.map { |m| m[1].to_i }","path":"plugins/samson_ledger/lib/samson_ledger/client.rb","position":29,"original_position":29,"commit_id":"8063415815ae46b236dc8b745a3df2e81aa89ccf","original_commit_id":"8063415815ae46b236dc8b745a3df2e81aa89ccf","user":{"login":"neroleung","id":1371882,"avatar_url":"https://avatars.githubusercontent.com/u/1371882?v=3","gravatar_id":"","url":"https://api.github.com/users/neroleung","html_url":"https://github.com/neroleung","followers_url":"https://api.github.com/users/neroleung/followers","following_url":"https://api.github.com/users/neroleung/following{/other_user}","gists_url":"https://api.github.com/users/neroleung/gists{/gist_id}","starred_url":"https://api.github.com/users/neroleung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neroleung/subscriptions","organizations_url":"https://api.github.com/users/neroleung/orgs","repos_url":"https://api.github.com/users/neroleung/repos","events_url":"https://api.github.com/users/neroleung/events{/privacy}","received_events_url":"https://api.github.com/users/neroleung/received_events","type":"User","site_admin":false},"body":"In production, the examples are like `pod2`, `staging101`, `master99`, and `us-west-1`. I don't want `us-west-1` though. I will change the regex to: \r\n`dg.env_value[/^(pod|staging|master)(\\d+).*/, 2]`","created_at":"2016-09-22T23:02:41Z","updated_at":"2016-09-22T23:02:41Z","html_url":"https://github.com/zendesk/samson/pull/1305#discussion_r80154717","pull_request_url":"https://api.github.com/repos/zendesk/samson/pulls/1305","_links":{"self":{"href":"https://api.github.com/repos/zendesk/samson/pulls/comments/80154717"},"html":{"href":"https://github.com/zendesk/samson/pull/1305#discussion_r80154717"},"pull_request":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1305"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/samson/pulls/1305","id":86414864,"html_url":"https://github.com/zendesk/samson/pull/1305","diff_url":"https://github.com/zendesk/samson/pull/1305.diff","patch_url":"https://github.com/zendesk/samson/pull/1305.patch","issue_url":"https://api.github.com/repos/zendesk/samson/issues/1305","number":1305,"state":"open","locked":false,"title":"Add more info for ledger","user":{"login":"neroleung","id":1371882,"avatar_url":"https://avatars.githubusercontent.com/u/1371882?v=3","gravatar_id":"","url":"https://api.github.com/users/neroleung","html_url":"https://github.com/neroleung","followers_url":"https://api.github.com/users/neroleung/followers","following_url":"https://api.github.com/users/neroleung/following{/other_user}","gists_url":"https://api.github.com/users/neroleung/gists{/gist_id}","starred_url":"https://api.github.com/users/neroleung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neroleung/subscriptions","organizations_url":"https://api.github.com/users/neroleung/orgs","repos_url":"https://api.github.com/users/neroleung/repos","events_url":"https://api.github.com/users/neroleung/events{/privacy}","received_events_url":"https://api.github.com/users/neroleung/received_events","type":"User","site_admin":false},"body":"Add pod ids and pull requests. Use `deploy.updated_at` instead of `created_at` for ledger's started_at.\r\n\r\n/cc @zendesk/samson, @irwaters, @grosser \r\n\r\n### Risks\r\n- Level: Low\r\n","created_at":"2016-09-22T21:08:22Z","updated_at":"2016-09-22T23:02:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24a10e7db14a2afe51c57e611c8d108440656c85","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/samson/pulls/1305/commits","review_comments_url":"https://api.github.com/repos/zendesk/samson/pulls/1305/comments","review_comment_url":"https://api.github.com/repos/zendesk/samson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/samson/issues/1305/comments","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/8063415815ae46b236dc8b745a3df2e81aa89ccf","head":{"label":"zendesk:neroleung/more-info-for-ledger","ref":"neroleung/more-info-for-ledger","sha":"8063415815ae46b236dc8b745a3df2e81aa89ccf","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":20208662,"name":"samson","full_name":"zendesk/samson","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/samson","description":"Web interface for deployments","fork":false,"url":"https://api.github.com/repos/zendesk/samson","forks_url":"https://api.github.com/repos/zendesk/samson/forks","keys_url":"https://api.github.com/repos/zendesk/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/samson/teams","hooks_url":"https://api.github.com/repos/zendesk/samson/hooks","issue_events_url":"https://api.github.com/repos/zendesk/samson/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/samson/events","assignees_url":"https://api.github.com/repos/zendesk/samson/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/samson/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/samson/tags","blobs_url":"https://api.github.com/repos/zendesk/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/samson/languages","stargazers_url":"https://api.github.com/repos/zendesk/samson/stargazers","contributors_url":"https://api.github.com/repos/zendesk/samson/contributors","subscribers_url":"https://api.github.com/repos/zendesk/samson/subscribers","subscription_url":"https://api.github.com/repos/zendesk/samson/subscription","commits_url":"https://api.github.com/repos/zendesk/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/samson/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/samson/merges","archive_url":"https://api.github.com/repos/zendesk/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/samson/downloads","issues_url":"https://api.github.com/repos/zendesk/samson/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/samson/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/samson/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/samson/deployments","created_at":"2014-05-27T05:55:57Z","updated_at":"2016-09-22T19:15:41Z","pushed_at":"2016-09-22T22:56:08Z","git_url":"git://github.com/zendesk/samson.git","ssh_url":"git@github.com:zendesk/samson.git","clone_url":"https://github.com/zendesk/samson.git","svn_url":"https://github.com/zendesk/samson","homepage":null,"size":210580,"stargazers_count":742,"watchers_count":742,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":147,"mirror_url":null,"open_issues_count":65,"forks":147,"open_issues":65,"watchers":742,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"95ff449cb5345d59fb03fde7f6546e34e451c821","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":20208662,"name":"samson","full_name":"zendesk/samson","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/samson","description":"Web interface for deployments","fork":false,"url":"https://api.github.com/repos/zendesk/samson","forks_url":"https://api.github.com/repos/zendesk/samson/forks","keys_url":"https://api.github.com/repos/zendesk/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/samson/teams","hooks_url":"https://api.github.com/repos/zendesk/samson/hooks","issue_events_url":"https://api.github.com/repos/zendesk/samson/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/samson/events","assignees_url":"https://api.github.com/repos/zendesk/samson/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/samson/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/samson/tags","blobs_url":"https://api.github.com/repos/zendesk/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/samson/languages","stargazers_url":"https://api.github.com/repos/zendesk/samson/stargazers","contributors_url":"https://api.github.com/repos/zendesk/samson/contributors","subscribers_url":"https://api.github.com/repos/zendesk/samson/subscribers","subscription_url":"https://api.github.com/repos/zendesk/samson/subscription","commits_url":"https://api.github.com/repos/zendesk/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/samson/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/samson/merges","archive_url":"https://api.github.com/repos/zendesk/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/samson/downloads","issues_url":"https://api.github.com/repos/zendesk/samson/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/samson/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/samson/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/samson/deployments","created_at":"2014-05-27T05:55:57Z","updated_at":"2016-09-22T19:15:41Z","pushed_at":"2016-09-22T22:56:08Z","git_url":"git://github.com/zendesk/samson.git","ssh_url":"git@github.com:zendesk/samson.git","clone_url":"https://github.com/zendesk/samson.git","svn_url":"https://github.com/zendesk/samson","homepage":null,"size":210580,"stargazers_count":742,"watchers_count":742,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":147,"mirror_url":null,"open_issues_count":65,"forks":147,"open_issues":65,"watchers":742,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1305"},"html":{"href":"https://github.com/zendesk/samson/pull/1305"},"issue":{"href":"https://api.github.com/repos/zendesk/samson/issues/1305"},"comments":{"href":"https://api.github.com/repos/zendesk/samson/issues/1305/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1305/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/samson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1305/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/samson/statuses/8063415815ae46b236dc8b745a3df2e81aa89ccf"}}}}
{"actor":{"display_login":"neroleung"}}