{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/reaper/pulls/comments/34295966","id":34295966,"diff_hunk":"@@ -132,157 +246,32 @@ func AllInstances() chan *Instance {\n \treturn ch\n }\n \n-func AllSnapshots() []filters.Filterable {\n-\tregions := config.Regions\n-\n-\t// waitgroup for goroutines\n-\tvar wg sync.WaitGroup\n-\n-\t// channel for creating SecurityGroups\n-\tin := make(chan *Snapshot)\n-\n-\tfor _, region := range regions {\n+func AllSecurityGroups() chan *SecurityGroup {\n+\tch := make(chan *SecurityGroup)\n+\t// waitgroup for all regions\n+\twg := sync.WaitGroup{}\n+\tfor _, region := range config.Regions {\n \t\twg.Add(1)\n-\n-\t\tsum := 0\n-\n-\t\t// goroutine per region to fetch all security groups\n \t\tgo func(region string) {\n-\t\t\tdefer wg.Done()\n+\t\t\t// add region to waitgroup\n \t\t\tapi := ec2.New(&aws.Config{Region: region})\n-\n-\t\t\t// TODO: nextToken paging\n-\t\t\tinput := &ec2.DescribeSnapshotsInput{}\n-\t\t\tresp, err := api.DescribeSnapshots(input)\n-\t\t\tif err != nil {\n-\t\t\t\t// TODO: wee\n-\t\t\t}\n-\n-\t\t\tfor _, v := range resp.Snapshots {\n-\t\t\t\tsum += 1\n-\t\t\t\tin <- NewSnapshot(region, v)\n+\t\t\tresp, err := api.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{})\n+\t\t\tfor _, sg := range resp.SecurityGroups {\n+\t\t\t\tch <- NewSecurityGroup(region, sg)\n \t\t\t}\n-\t\t}(region)\n-\t}\n-\t// aggregate\n-\tvar snapshots []filters.Filterable\n-\tgo func() {\n-\t\tfor s := range in {\n-\t\t\t// Reapables[s.Region][s.ID] = s\n-\t\t\tsnapshots = append(snapshots, s)\n-\t\t}\n-\t}()\n-\n-\t// synchronous wait for all goroutines in wg to be done\n-\twg.Wait()\n-\n-\t// done with the channel\n-\tclose(in)\n-\n-\tlog.Info(\"Found %d total snapshots.\", len(snapshots))\n-\treturn snapshots\n-}\n-func AllVolumes() Volumes {","path":"aws/aws.go","position":262,"original_position":262,"commit_id":"e29e76096da5ea8f6ab415511dce6e2ef7738764","original_commit_id":"e29e76096da5ea8f6ab415511dce6e2ef7738764","user":{"login":"milescrabill","id":4430892,"avatar_url":"https://avatars.githubusercontent.com/u/4430892?v=3","gravatar_id":"","url":"https://api.github.com/users/milescrabill","html_url":"https://github.com/milescrabill","followers_url":"https://api.github.com/users/milescrabill/followers","following_url":"https://api.github.com/users/milescrabill/following{/other_user}","gists_url":"https://api.github.com/users/milescrabill/gists{/gist_id}","starred_url":"https://api.github.com/users/milescrabill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milescrabill/subscriptions","organizations_url":"https://api.github.com/users/milescrabill/orgs","repos_url":"https://api.github.com/users/milescrabill/repos","events_url":"https://api.github.com/users/milescrabill/events{/privacy}","received_events_url":"https://api.github.com/users/milescrabill/received_events","type":"User","site_admin":false},"body":"Got rid of AllVolumes because I need to update them anyways","created_at":"2015-07-09T19:53:39Z","updated_at":"2015-07-09T19:53:39Z","html_url":"https://github.com/mozilla-services/reaper/pull/20#discussion_r34295966","pull_request_url":"https://api.github.com/repos/mozilla-services/reaper/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/reaper/pulls/comments/34295966"},"html":{"href":"https://github.com/mozilla-services/reaper/pull/20#discussion_r34295966"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/reaper/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/reaper/pulls/20","id":39535942,"html_url":"https://github.com/mozilla-services/reaper/pull/20","diff_url":"https://github.com/mozilla-services/reaper/pull/20.diff","patch_url":"https://github.com/mozilla-services/reaper/pull/20.patch","issue_url":"https://api.github.com/repos/mozilla-services/reaper/issues/20","number":20,"state":"open","locked":false,"title":"Working SecurityGroups and Cloudformations (and a lot of other changes snuck in)","user":{"login":"milescrabill","id":4430892,"avatar_url":"https://avatars.githubusercontent.com/u/4430892?v=3","gravatar_id":"","url":"https://api.github.com/users/milescrabill","html_url":"https://github.com/milescrabill","followers_url":"https://api.github.com/users/milescrabill/followers","following_url":"https://api.github.com/users/milescrabill/following{/other_user}","gists_url":"https://api.github.com/users/milescrabill/gists{/gist_id}","starred_url":"https://api.github.com/users/milescrabill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milescrabill/subscriptions","organizations_url":"https://api.github.com/users/milescrabill/orgs","repos_url":"https://api.github.com/users/milescrabill/repos","events_url":"https://api.github.com/users/milescrabill/events{/privacy}","received_events_url":"https://api.github.com/users/milescrabill/received_events","type":"User","site_admin":false},"body":"This rebase was hurting my brain.\r\nThis includes adding Cloudformations and associated changes, as well as a bunch of other stuff.","created_at":"2015-07-08T23:53:16Z","updated_at":"2015-07-09T19:53:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"540949ce880e25b2a45b001fdb61c811ce69e3eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/reaper/pulls/20/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/reaper/pulls/20/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/reaper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-services/reaper/issues/20/comments","statuses_url":"https://api.github.com/repos/mozilla-services/reaper/statuses/e29e76096da5ea8f6ab415511dce6e2ef7738764","head":{"label":"milescrabill:update-securitygroups","ref":"update-securitygroups","sha":"e29e76096da5ea8f6ab415511dce6e2ef7738764","user":{"login":"milescrabill","id":4430892,"avatar_url":"https://avatars.githubusercontent.com/u/4430892?v=3","gravatar_id":"","url":"https://api.github.com/users/milescrabill","html_url":"https://github.com/milescrabill","followers_url":"https://api.github.com/users/milescrabill/followers","following_url":"https://api.github.com/users/milescrabill/following{/other_user}","gists_url":"https://api.github.com/users/milescrabill/gists{/gist_id}","starred_url":"https://api.github.com/users/milescrabill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milescrabill/subscriptions","organizations_url":"https://api.github.com/users/milescrabill/orgs","repos_url":"https://api.github.com/users/milescrabill/repos","events_url":"https://api.github.com/users/milescrabill/events{/privacy}","received_events_url":"https://api.github.com/users/milescrabill/received_events","type":"User","site_admin":false},"repo":{"id":38334550,"name":"reaper","full_name":"milescrabill/reaper","owner":{"login":"milescrabill","id":4430892,"avatar_url":"https://avatars.githubusercontent.com/u/4430892?v=3","gravatar_id":"","url":"https://api.github.com/users/milescrabill","html_url":"https://github.com/milescrabill","followers_url":"https://api.github.com/users/milescrabill/followers","following_url":"https://api.github.com/users/milescrabill/following{/other_user}","gists_url":"https://api.github.com/users/milescrabill/gists{/gist_id}","starred_url":"https://api.github.com/users/milescrabill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milescrabill/subscriptions","organizations_url":"https://api.github.com/users/milescrabill/orgs","repos_url":"https://api.github.com/users/milescrabill/repos","events_url":"https://api.github.com/users/milescrabill/events{/privacy}","received_events_url":"https://api.github.com/users/milescrabill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/milescrabill/reaper","description":null,"fork":true,"url":"https://api.github.com/repos/milescrabill/reaper","forks_url":"https://api.github.com/repos/milescrabill/reaper/forks","keys_url":"https://api.github.com/repos/milescrabill/reaper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/milescrabill/reaper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/milescrabill/reaper/teams","hooks_url":"https://api.github.com/repos/milescrabill/reaper/hooks","issue_events_url":"https://api.github.com/repos/milescrabill/reaper/issues/events{/number}","events_url":"https://api.github.com/repos/milescrabill/reaper/events","assignees_url":"https://api.github.com/repos/milescrabill/reaper/assignees{/user}","branches_url":"https://api.github.com/repos/milescrabill/reaper/branches{/branch}","tags_url":"https://api.github.com/repos/milescrabill/reaper/tags","blobs_url":"https://api.github.com/repos/milescrabill/reaper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/milescrabill/reaper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/milescrabill/reaper/git/refs{/sha}","trees_url":"https://api.github.com/repos/milescrabill/reaper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/milescrabill/reaper/statuses/{sha}","languages_url":"https://api.github.com/repos/milescrabill/reaper/languages","stargazers_url":"https://api.github.com/repos/milescrabill/reaper/stargazers","contributors_url":"https://api.github.com/repos/milescrabill/reaper/contributors","subscribers_url":"https://api.github.com/repos/milescrabill/reaper/subscribers","subscription_url":"https://api.github.com/repos/milescrabill/reaper/subscription","commits_url":"https://api.github.com/repos/milescrabill/reaper/commits{/sha}","git_commits_url":"https://api.github.com/repos/milescrabill/reaper/git/commits{/sha}","comments_url":"https://api.github.com/repos/milescrabill/reaper/comments{/number}","issue_comment_url":"https://api.github.com/repos/milescrabill/reaper/issues/comments{/number}","contents_url":"https://api.github.com/repos/milescrabill/reaper/contents/{+path}","compare_url":"https://api.github.com/repos/milescrabill/reaper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/milescrabill/reaper/merges","archive_url":"https://api.github.com/repos/milescrabill/reaper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/milescrabill/reaper/downloads","issues_url":"https://api.github.com/repos/milescrabill/reaper/issues{/number}","pulls_url":"https://api.github.com/repos/milescrabill/reaper/pulls{/number}","milestones_url":"https://api.github.com/repos/milescrabill/reaper/milestones{/number}","notifications_url":"https://api.github.com/repos/milescrabill/reaper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/milescrabill/reaper/labels{/name}","releases_url":"https://api.github.com/repos/milescrabill/reaper/releases{/id}","created_at":"2015-06-30T21:40:58Z","updated_at":"2015-06-30T21:40:58Z","pushed_at":"2015-07-08T23:52:02Z","git_url":"git://github.com/milescrabill/reaper.git","ssh_url":"git@github.com:milescrabill/reaper.git","clone_url":"https://github.com/milescrabill/reaper.git","svn_url":"https://github.com/milescrabill/reaper","homepage":null,"size":3652,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"mozilla-services:master","ref":"master","sha":"e4250fa78d2bc2f117bf341a71260aad04fc7e4b","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":37093635,"name":"reaper","full_name":"mozilla-services/reaper","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/reaper","description":null,"fork":false,"url":"https://api.github.com/repos/mozilla-services/reaper","forks_url":"https://api.github.com/repos/mozilla-services/reaper/forks","keys_url":"https://api.github.com/repos/mozilla-services/reaper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/reaper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/reaper/teams","hooks_url":"https://api.github.com/repos/mozilla-services/reaper/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/reaper/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/reaper/events","assignees_url":"https://api.github.com/repos/mozilla-services/reaper/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/reaper/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/reaper/tags","blobs_url":"https://api.github.com/repos/mozilla-services/reaper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/reaper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/reaper/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/reaper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/reaper/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/reaper/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/reaper/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/reaper/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/reaper/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/reaper/subscription","commits_url":"https://api.github.com/repos/mozilla-services/reaper/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/reaper/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/reaper/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/reaper/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/reaper/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/reaper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/reaper/merges","archive_url":"https://api.github.com/repos/mozilla-services/reaper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/reaper/downloads","issues_url":"https://api.github.com/repos/mozilla-services/reaper/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/reaper/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/reaper/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/reaper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/reaper/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/reaper/releases{/id}","created_at":"2015-06-08T21:23:17Z","updated_at":"2015-07-03T05:50:18Z","pushed_at":"2015-07-08T23:53:16Z","git_url":"git://github.com/mozilla-services/reaper.git","ssh_url":"git@github.com:mozilla-services/reaper.git","clone_url":"https://github.com/mozilla-services/reaper.git","svn_url":"https://github.com/mozilla-services/reaper","homepage":null,"size":4445,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":21,"forks":1,"open_issues":21,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/reaper/pulls/20"},"html":{"href":"https://github.com/mozilla-services/reaper/pull/20"},"issue":{"href":"https://api.github.com/repos/mozilla-services/reaper/issues/20"},"comments":{"href":"https://api.github.com/repos/mozilla-services/reaper/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/reaper/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/reaper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/reaper/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/reaper/statuses/e29e76096da5ea8f6ab415511dce6e2ef7738764"}}}}