{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/paas-billing/pulls/comments/186054420","pull_request_review_id":117557684,"id":186054420,"diff_hunk":"@@ -66,6 +66,30 @@ INSERT INTO events with\n \t\t\twhere\n \t\t\t\traw_message->>'service_instance_type' = 'managed_service_instance'\n \t\t\t\tand raw_message->>'space_name' !~ '^(SMOKE|ACC|CATS|PERF)-' -- FIXME: this is open to abuse\n+\t\t) union all (\n+\t\t\tselect\n+\t\t\t\tid as event_sequence,\n+\t\t\t\tguid::uuid as event_guid,\n+\t\t\t\tcreated_at,\n+\t\t\t\t(raw_message->>'task_guid')::uuid as resource_guid,\n+\t\t\t\t(raw_message->>'task_name') as resource_name,\n+\t\t\t\t'task'::text as resource_type,                              -- resource_type for compute resources\n+\t\t\t\t(raw_message->>'org_guid')::uuid as org_guid,\n+\t\t\t\t(raw_message->>'space_guid')::uuid as space_guid,\n+\t\t\t\t'ebfa9453-ef66-450c-8c37-d53dfd931038'::uuid as plan_guid,  -- plan guid for all compute resources\n+\t\t\t\t'task'::text as plan_name,                                  -- plan name for all compute resources","path":"eventstore/sql/create_events.sql","position":15,"original_position":15,"commit_id":"fc2fd71944463abd5f6f0b5405c039a6d1305418","original_commit_id":"fc2fd71944463abd5f6f0b5405c039a6d1305418","user":{"login":"dcarley","id":260438,"avatar_url":"https://avatars0.githubusercontent.com/u/260438?v=4","gravatar_id":"","url":"https://api.github.com/users/dcarley","html_url":"https://github.com/dcarley","followers_url":"https://api.github.com/users/dcarley/followers","following_url":"https://api.github.com/users/dcarley/following{/other_user}","gists_url":"https://api.github.com/users/dcarley/gists{/gist_id}","starred_url":"https://api.github.com/users/dcarley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcarley/subscriptions","organizations_url":"https://api.github.com/users/dcarley/orgs","repos_url":"https://api.github.com/users/dcarley/repos","events_url":"https://api.github.com/users/dcarley/events{/privacy}","received_events_url":"https://api.github.com/users/dcarley/received_events","type":"User","site_admin":false},"body":"Should these comments say `for all task resources`?","created_at":"2018-05-04T11:23:03Z","updated_at":"2018-05-04T11:34:41Z","html_url":"https://github.com/alphagov/paas-billing/pull/26#discussion_r186054420","pull_request_url":"https://api.github.com/repos/alphagov/paas-billing/pulls/26","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-billing/pulls/comments/186054420"},"html":{"href":"https://github.com/alphagov/paas-billing/pull/26#discussion_r186054420"},"pull_request":{"href":"https://api.github.com/repos/alphagov/paas-billing/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/paas-billing/pulls/26","id":185761642,"html_url":"https://github.com/alphagov/paas-billing/pull/26","diff_url":"https://github.com/alphagov/paas-billing/pull/26.diff","patch_url":"https://github.com/alphagov/paas-billing/pull/26.patch","issue_url":"https://api.github.com/repos/alphagov/paas-billing/issues/26","number":26,"state":"open","locked":false,"title":"[#156753589] Add tasks to the billable events","user":{"login":"paroxp","id":2418945,"avatar_url":"https://avatars3.githubusercontent.com/u/2418945?v=4","gravatar_id":"","url":"https://api.github.com/users/paroxp","html_url":"https://github.com/paroxp","followers_url":"https://api.github.com/users/paroxp/followers","following_url":"https://api.github.com/users/paroxp/following{/other_user}","gists_url":"https://api.github.com/users/paroxp/gists{/gist_id}","starred_url":"https://api.github.com/users/paroxp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paroxp/subscriptions","organizations_url":"https://api.github.com/users/paroxp/orgs","repos_url":"https://api.github.com/users/paroxp/repos","events_url":"https://api.github.com/users/paroxp/events{/privacy}","received_events_url":"https://api.github.com/users/paroxp/received_events","type":"User","site_admin":false},"body":"## What\r\n\r\nCurrently, the tasks are being ignored when it comes to converting data\r\ninto our defined standard. Tasks too cost money, therefore we'd like to\r\nmake sure those are standardised and counted towards any billing\r\ncalculations.\r\n\r\n## How to review\r\n\r\n- Run tests\r\n- Run application against your environment\r\n- Create and kill a task\r\n- Request and see data (tested myself)\r\n","created_at":"2018-05-03T15:53:03Z","updated_at":"2018-05-04T11:34:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f6a18d64f41a55a8ba3962d83540bbffbfefc36","assignee":{"login":"dcarley","id":260438,"avatar_url":"https://avatars0.githubusercontent.com/u/260438?v=4","gravatar_id":"","url":"https://api.github.com/users/dcarley","html_url":"https://github.com/dcarley","followers_url":"https://api.github.com/users/dcarley/followers","following_url":"https://api.github.com/users/dcarley/following{/other_user}","gists_url":"https://api.github.com/users/dcarley/gists{/gist_id}","starred_url":"https://api.github.com/users/dcarley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcarley/subscriptions","organizations_url":"https://api.github.com/users/dcarley/orgs","repos_url":"https://api.github.com/users/dcarley/repos","events_url":"https://api.github.com/users/dcarley/events{/privacy}","received_events_url":"https://api.github.com/users/dcarley/received_events","type":"User","site_admin":false},"assignees":[{"login":"dcarley","id":260438,"avatar_url":"https://avatars0.githubusercontent.com/u/260438?v=4","gravatar_id":"","url":"https://api.github.com/users/dcarley","html_url":"https://github.com/dcarley","followers_url":"https://api.github.com/users/dcarley/followers","following_url":"https://api.github.com/users/dcarley/following{/other_user}","gists_url":"https://api.github.com/users/dcarley/gists{/gist_id}","starred_url":"https://api.github.com/users/dcarley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcarley/subscriptions","organizations_url":"https://api.github.com/users/dcarley/orgs","repos_url":"https://api.github.com/users/dcarley/repos","events_url":"https://api.github.com/users/dcarley/events{/privacy}","received_events_url":"https://api.github.com/users/dcarley/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/paas-billing/pulls/26/commits","review_comments_url":"https://api.github.com/repos/alphagov/paas-billing/pulls/26/comments","review_comment_url":"https://api.github.com/repos/alphagov/paas-billing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/paas-billing/issues/26/comments","statuses_url":"https://api.github.com/repos/alphagov/paas-billing/statuses/fc2fd71944463abd5f6f0b5405c039a6d1305418","head":{"label":"alphagov:feature/add-billing-for-tasks-156753589","ref":"feature/add-billing-for-tasks-156753589","sha":"fc2fd71944463abd5f6f0b5405c039a6d1305418","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":106835027,"name":"paas-billing","full_name":"alphagov/paas-billing","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/paas-billing","description":"A Go app for polling the CF API for usage events","fork":false,"url":"https://api.github.com/repos/alphagov/paas-billing","forks_url":"https://api.github.com/repos/alphagov/paas-billing/forks","keys_url":"https://api.github.com/repos/alphagov/paas-billing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-billing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-billing/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-billing/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-billing/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-billing/events","assignees_url":"https://api.github.com/repos/alphagov/paas-billing/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-billing/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-billing/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-billing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-billing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-billing/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-billing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-billing/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-billing/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-billing/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-billing/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-billing/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-billing/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-billing/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-billing/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-billing/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-billing/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-billing/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-billing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-billing/merges","archive_url":"https://api.github.com/repos/alphagov/paas-billing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-billing/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-billing/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-billing/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-billing/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-billing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-billing/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-billing/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-billing/deployments","created_at":"2017-10-13T14:31:13Z","updated_at":"2018-05-01T08:54:40Z","pushed_at":"2018-05-03T15:53:04Z","git_url":"git://github.com/alphagov/paas-billing.git","ssh_url":"git@github.com:alphagov/paas-billing.git","clone_url":"https://github.com/alphagov/paas-billing.git","svn_url":"https://github.com/alphagov/paas-billing","homepage":null,"size":12320,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"d211e6495f40d70ca1f17e75159c4887434a4439","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":106835027,"name":"paas-billing","full_name":"alphagov/paas-billing","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/paas-billing","description":"A Go app for polling the CF API for usage events","fork":false,"url":"https://api.github.com/repos/alphagov/paas-billing","forks_url":"https://api.github.com/repos/alphagov/paas-billing/forks","keys_url":"https://api.github.com/repos/alphagov/paas-billing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-billing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-billing/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-billing/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-billing/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-billing/events","assignees_url":"https://api.github.com/repos/alphagov/paas-billing/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-billing/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-billing/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-billing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-billing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-billing/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-billing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-billing/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-billing/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-billing/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-billing/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-billing/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-billing/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-billing/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-billing/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-billing/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-billing/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-billing/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-billing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-billing/merges","archive_url":"https://api.github.com/repos/alphagov/paas-billing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-billing/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-billing/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-billing/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-billing/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-billing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-billing/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-billing/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-billing/deployments","created_at":"2017-10-13T14:31:13Z","updated_at":"2018-05-01T08:54:40Z","pushed_at":"2018-05-03T15:53:04Z","git_url":"git://github.com/alphagov/paas-billing.git","ssh_url":"git@github.com:alphagov/paas-billing.git","clone_url":"https://github.com/alphagov/paas-billing.git","svn_url":"https://github.com/alphagov/paas-billing","homepage":null,"size":12320,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-billing/pulls/26"},"html":{"href":"https://github.com/alphagov/paas-billing/pull/26"},"issue":{"href":"https://api.github.com/repos/alphagov/paas-billing/issues/26"},"comments":{"href":"https://api.github.com/repos/alphagov/paas-billing/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/paas-billing/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/paas-billing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/paas-billing/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/paas-billing/statuses/fc2fd71944463abd5f6f0b5405c039a6d1305418"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dcarley"}}