{"action":"created","comment":{"url":"https://api.github.com/repos/cristim/autospotting/pulls/comments/171860018","pull_request_review_id":100789767,"id":171860018,"diff_hunk":"@@ -106,7 +106,7 @@ func Test_copyBlockDeviceMappings(t *testing.T) {\n \t}\n }\n \n-var testSecGroupRegex = regexp.MustCompile(`^sg-[a-f0-9]{8}$`)\n+var testSecGroupRegex = regexp.MustCompile(`^sg-[a-f0-9]{8,17}$`)","path":"core/launch_configuration_test.go","position":null,"original_position":5,"commit_id":"5a4d9fed1391d493fc676aa03c3e9b992f0af468","original_commit_id":"0875f9430823aa50c4de8871dd0daf611cce12f3","user":{"login":"cristim","id":95209,"avatar_url":"https://avatars1.githubusercontent.com/u/95209?v=4","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"body":"But why do we need it?\r\n\r\nThe tests should just hit the actual code that has the regex, unless I'm missing something.","created_at":"2018-03-02T14:27:05Z","updated_at":"2018-03-02T14:27:06Z","html_url":"https://github.com/cristim/autospotting/pull/227#discussion_r171860018","pull_request_url":"https://api.github.com/repos/cristim/autospotting/pulls/227","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/comments/171860018"},"html":{"href":"https://github.com/cristim/autospotting/pull/227#discussion_r171860018"},"pull_request":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/227"}},"in_reply_to_id":171840677},"pull_request":{"url":"https://api.github.com/repos/cristim/autospotting/pulls/227","id":172180444,"html_url":"https://github.com/cristim/autospotting/pull/227","diff_url":"https://github.com/cristim/autospotting/pull/227.diff","patch_url":"https://github.com/cristim/autospotting/pull/227.patch","issue_url":"https://api.github.com/repos/cristim/autospotting/issues/227","number":227,"state":"open","locked":false,"title":"Use Security Group IDs in all cases","user":{"login":"Shugyousha","id":500068,"avatar_url":"https://avatars3.githubusercontent.com/u/500068?v=4","gravatar_id":"","url":"https://api.github.com/users/Shugyousha","html_url":"https://github.com/Shugyousha","followers_url":"https://api.github.com/users/Shugyousha/followers","following_url":"https://api.github.com/users/Shugyousha/following{/other_user}","gists_url":"https://api.github.com/users/Shugyousha/gists{/gist_id}","starred_url":"https://api.github.com/users/Shugyousha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shugyousha/subscriptions","organizations_url":"https://api.github.com/users/Shugyousha/orgs","repos_url":"https://api.github.com/users/Shugyousha/repos","events_url":"https://api.github.com/users/Shugyousha/events{/privacy}","received_events_url":"https://api.github.com/users/Shugyousha/received_events","type":"User","site_admin":false},"body":"# Issue Type\r\n\r\n- Bugfix Pull Request for https://github.com/cristim/autospotting/issues/48.\r\n\r\n\r\n## Summary\r\n\r\nThis PR is one way to fix https://github.com/cristim/autospotting/issues/48.  (The first commit is just an unrelated cleanup commit however.)\r\n\r\nWe want to attach the correct SecurityGroups to newly created spot instances. For that we just reuse the SecurityGroup attached to the instances in the auto scaling group but it turns out that those Security Groups can either be mentioned by name (in the classic EC2 or the DefaultVPC case) or by id (in the Lunix/UNIX (VPC) case).\r\n\r\nIn order to make the handling of these different cases easier we try to use IDs in all cases. If a SecurityGroup string starts with \"sg-\" we assume it's an idea already and use it as is. Otherwise we search for the string as a group name using the AWS EC2 API and use its ID.\r\n\r\nI think this should also cover the case where the security groups of the instance are mentioned in a mixed way, containing both names and IDs (as long as the names don't start with \"sg-\").\r\n\r\nIn our environment I can only test the DefaultVPC case so we have to make sure that this approach still works for all of the other cases.","created_at":"2018-03-01T09:16:39Z","updated_at":"2018-03-02T14:27:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4d6006f7dd8cd4040279cccec1d2b8b1f3b1268","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cristim/autospotting/pulls/227/commits","review_comments_url":"https://api.github.com/repos/cristim/autospotting/pulls/227/comments","review_comment_url":"https://api.github.com/repos/cristim/autospotting/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cristim/autospotting/issues/227/comments","statuses_url":"https://api.github.com/repos/cristim/autospotting/statuses/5a4d9fed1391d493fc676aa03c3e9b992f0af468","head":{"label":"smallpdf:fixSecurityGroupIDs","ref":"fixSecurityGroupIDs","sha":"5a4d9fed1391d493fc676aa03c3e9b992f0af468","user":{"login":"smallpdf","id":12428361,"avatar_url":"https://avatars3.githubusercontent.com/u/12428361?v=4","gravatar_id":"","url":"https://api.github.com/users/smallpdf","html_url":"https://github.com/smallpdf","followers_url":"https://api.github.com/users/smallpdf/followers","following_url":"https://api.github.com/users/smallpdf/following{/other_user}","gists_url":"https://api.github.com/users/smallpdf/gists{/gist_id}","starred_url":"https://api.github.com/users/smallpdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smallpdf/subscriptions","organizations_url":"https://api.github.com/users/smallpdf/orgs","repos_url":"https://api.github.com/users/smallpdf/repos","events_url":"https://api.github.com/users/smallpdf/events{/privacy}","received_events_url":"https://api.github.com/users/smallpdf/received_events","type":"Organization","site_admin":false},"repo":{"id":123409580,"name":"autospotting","full_name":"smallpdf/autospotting","owner":{"login":"smallpdf","id":12428361,"avatar_url":"https://avatars3.githubusercontent.com/u/12428361?v=4","gravatar_id":"","url":"https://api.github.com/users/smallpdf","html_url":"https://github.com/smallpdf","followers_url":"https://api.github.com/users/smallpdf/followers","following_url":"https://api.github.com/users/smallpdf/following{/other_user}","gists_url":"https://api.github.com/users/smallpdf/gists{/gist_id}","starred_url":"https://api.github.com/users/smallpdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smallpdf/subscriptions","organizations_url":"https://api.github.com/users/smallpdf/orgs","repos_url":"https://api.github.com/users/smallpdf/repos","events_url":"https://api.github.com/users/smallpdf/events{/privacy}","received_events_url":"https://api.github.com/users/smallpdf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smallpdf/autospotting","description":"Automatically replace AWS EC2 instances in AutoScaling groups with identically configured but up to 90% cheaper spot instances","fork":true,"url":"https://api.github.com/repos/smallpdf/autospotting","forks_url":"https://api.github.com/repos/smallpdf/autospotting/forks","keys_url":"https://api.github.com/repos/smallpdf/autospotting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smallpdf/autospotting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smallpdf/autospotting/teams","hooks_url":"https://api.github.com/repos/smallpdf/autospotting/hooks","issue_events_url":"https://api.github.com/repos/smallpdf/autospotting/issues/events{/number}","events_url":"https://api.github.com/repos/smallpdf/autospotting/events","assignees_url":"https://api.github.com/repos/smallpdf/autospotting/assignees{/user}","branches_url":"https://api.github.com/repos/smallpdf/autospotting/branches{/branch}","tags_url":"https://api.github.com/repos/smallpdf/autospotting/tags","blobs_url":"https://api.github.com/repos/smallpdf/autospotting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smallpdf/autospotting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smallpdf/autospotting/git/refs{/sha}","trees_url":"https://api.github.com/repos/smallpdf/autospotting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smallpdf/autospotting/statuses/{sha}","languages_url":"https://api.github.com/repos/smallpdf/autospotting/languages","stargazers_url":"https://api.github.com/repos/smallpdf/autospotting/stargazers","contributors_url":"https://api.github.com/repos/smallpdf/autospotting/contributors","subscribers_url":"https://api.github.com/repos/smallpdf/autospotting/subscribers","subscription_url":"https://api.github.com/repos/smallpdf/autospotting/subscription","commits_url":"https://api.github.com/repos/smallpdf/autospotting/commits{/sha}","git_commits_url":"https://api.github.com/repos/smallpdf/autospotting/git/commits{/sha}","comments_url":"https://api.github.com/repos/smallpdf/autospotting/comments{/number}","issue_comment_url":"https://api.github.com/repos/smallpdf/autospotting/issues/comments{/number}","contents_url":"https://api.github.com/repos/smallpdf/autospotting/contents/{+path}","compare_url":"https://api.github.com/repos/smallpdf/autospotting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smallpdf/autospotting/merges","archive_url":"https://api.github.com/repos/smallpdf/autospotting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smallpdf/autospotting/downloads","issues_url":"https://api.github.com/repos/smallpdf/autospotting/issues{/number}","pulls_url":"https://api.github.com/repos/smallpdf/autospotting/pulls{/number}","milestones_url":"https://api.github.com/repos/smallpdf/autospotting/milestones{/number}","notifications_url":"https://api.github.com/repos/smallpdf/autospotting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smallpdf/autospotting/labels{/name}","releases_url":"https://api.github.com/repos/smallpdf/autospotting/releases{/id}","deployments_url":"https://api.github.com/repos/smallpdf/autospotting/deployments","created_at":"2018-03-01T09:03:36Z","updated_at":"2018-03-01T09:03:38Z","pushed_at":"2018-03-02T14:03:01Z","git_url":"git://github.com/smallpdf/autospotting.git","ssh_url":"git@github.com:smallpdf/autospotting.git","clone_url":"https://github.com/smallpdf/autospotting.git","svn_url":"https://github.com/smallpdf/autospotting","homepage":"https://autospotting.org/","size":18695,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cristim:master","ref":"master","sha":"4ff495c9cc0d4aeb0d6e2cfc031e0911090377bb","user":{"login":"cristim","id":95209,"avatar_url":"https://avatars1.githubusercontent.com/u/95209?v=4","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"repo":{"id":63696142,"name":"autospotting","full_name":"cristim/autospotting","owner":{"login":"cristim","id":95209,"avatar_url":"https://avatars1.githubusercontent.com/u/95209?v=4","gravatar_id":"","url":"https://api.github.com/users/cristim","html_url":"https://github.com/cristim","followers_url":"https://api.github.com/users/cristim/followers","following_url":"https://api.github.com/users/cristim/following{/other_user}","gists_url":"https://api.github.com/users/cristim/gists{/gist_id}","starred_url":"https://api.github.com/users/cristim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristim/subscriptions","organizations_url":"https://api.github.com/users/cristim/orgs","repos_url":"https://api.github.com/users/cristim/repos","events_url":"https://api.github.com/users/cristim/events{/privacy}","received_events_url":"https://api.github.com/users/cristim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cristim/autospotting","description":"Automatically replace AWS EC2 instances in AutoScaling groups with identically configured but up to 90% cheaper spot instances","fork":false,"url":"https://api.github.com/repos/cristim/autospotting","forks_url":"https://api.github.com/repos/cristim/autospotting/forks","keys_url":"https://api.github.com/repos/cristim/autospotting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cristim/autospotting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cristim/autospotting/teams","hooks_url":"https://api.github.com/repos/cristim/autospotting/hooks","issue_events_url":"https://api.github.com/repos/cristim/autospotting/issues/events{/number}","events_url":"https://api.github.com/repos/cristim/autospotting/events","assignees_url":"https://api.github.com/repos/cristim/autospotting/assignees{/user}","branches_url":"https://api.github.com/repos/cristim/autospotting/branches{/branch}","tags_url":"https://api.github.com/repos/cristim/autospotting/tags","blobs_url":"https://api.github.com/repos/cristim/autospotting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cristim/autospotting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cristim/autospotting/git/refs{/sha}","trees_url":"https://api.github.com/repos/cristim/autospotting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cristim/autospotting/statuses/{sha}","languages_url":"https://api.github.com/repos/cristim/autospotting/languages","stargazers_url":"https://api.github.com/repos/cristim/autospotting/stargazers","contributors_url":"https://api.github.com/repos/cristim/autospotting/contributors","subscribers_url":"https://api.github.com/repos/cristim/autospotting/subscribers","subscription_url":"https://api.github.com/repos/cristim/autospotting/subscription","commits_url":"https://api.github.com/repos/cristim/autospotting/commits{/sha}","git_commits_url":"https://api.github.com/repos/cristim/autospotting/git/commits{/sha}","comments_url":"https://api.github.com/repos/cristim/autospotting/comments{/number}","issue_comment_url":"https://api.github.com/repos/cristim/autospotting/issues/comments{/number}","contents_url":"https://api.github.com/repos/cristim/autospotting/contents/{+path}","compare_url":"https://api.github.com/repos/cristim/autospotting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cristim/autospotting/merges","archive_url":"https://api.github.com/repos/cristim/autospotting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cristim/autospotting/downloads","issues_url":"https://api.github.com/repos/cristim/autospotting/issues{/number}","pulls_url":"https://api.github.com/repos/cristim/autospotting/pulls{/number}","milestones_url":"https://api.github.com/repos/cristim/autospotting/milestones{/number}","notifications_url":"https://api.github.com/repos/cristim/autospotting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cristim/autospotting/labels{/name}","releases_url":"https://api.github.com/repos/cristim/autospotting/releases{/id}","deployments_url":"https://api.github.com/repos/cristim/autospotting/deployments","created_at":"2016-07-19T13:27:31Z","updated_at":"2018-03-02T09:31:20Z","pushed_at":"2018-03-02T14:03:02Z","git_url":"git://github.com/cristim/autospotting.git","ssh_url":"git@github.com:cristim/autospotting.git","clone_url":"https://github.com/cristim/autospotting.git","svn_url":"https://github.com/cristim/autospotting","homepage":"https://autospotting.org/","size":18683,"stargazers_count":668,"watchers_count":668,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":121,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":121,"open_issues":45,"watchers":668,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/227"},"html":{"href":"https://github.com/cristim/autospotting/pull/227"},"issue":{"href":"https://api.github.com/repos/cristim/autospotting/issues/227"},"comments":{"href":"https://api.github.com/repos/cristim/autospotting/issues/227/comments"},"review_comments":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/227/comments"},"review_comment":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cristim/autospotting/pulls/227/commits"},"statuses":{"href":"https://api.github.com/repos/cristim/autospotting/statuses/5a4d9fed1391d493fc676aa03c3e9b992f0af468"}},"author_association":"NONE"}}
{"actor":{"display_login":"cristim"}}