{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/ssm-scala/pulls/comments/169930461","pull_request_review_id":98530934,"id":169930461,"diff_hunk":"@@ -38,7 +38,7 @@ object Logic {\n       Left(FailedAttempt(Failure(s\"Unable to identify a single instance\", s\"Could not find any instance\", UnhandledError, None, None)))\n     } else {\n       val validInstancesWithOrder = instances\n-        .filter(_.publicIpAddressOpt.isDefined)\n+        .filter(i => i.publicIpAddressOpt.isDefined || i.privateIpAddressOpt.isDefined)","path":"src/main/scala/com/gu/ssm/Logic.scala","position":5,"original_position":5,"commit_id":"4e263bb1a39de2360461624ba2dd2bb2fdeafd48","original_commit_id":"4e263bb1a39de2360461624ba2dd2bb2fdeafd48","user":{"login":"adamnfish","id":29761,"avatar_url":"https://avatars0.githubusercontent.com/u/29761?v=4","gravatar_id":"","url":"https://api.github.com/users/adamnfish","html_url":"https://github.com/adamnfish","followers_url":"https://api.github.com/users/adamnfish/followers","following_url":"https://api.github.com/users/adamnfish/following{/other_user}","gists_url":"https://api.github.com/users/adamnfish/gists{/gist_id}","starred_url":"https://api.github.com/users/adamnfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamnfish/subscriptions","organizations_url":"https://api.github.com/users/adamnfish/orgs","repos_url":"https://api.github.com/users/adamnfish/repos","events_url":"https://api.github.com/users/adamnfish/events{/privacy}","received_events_url":"https://api.github.com/users/adamnfish/received_events","type":"User","site_admin":false},"body":"I think this filter is now pointless because all instances have a private IP address, and this highlights that the change breaks this part of the logic.\r\n\r\nThis function's job is to pick a \"valid\" instance. Previously that meant selecting an instance with a public IP address. The measure of \"valid\" now depends on whether the private flag was set so this function probably needs to take that flag and it should return the first instance that matches the dynamic requirement.\r\n\r\nThe now-broken behaviour is this:\r\nAt the moment this function will select an instance and then you'll apply another check to look for the correct (public or private) IP address on what gets returned. It may be that the instance selected here does not meet the requirements, but there was an instance among those that were matched that could have. With this change we now erroneously fail.\r\n","created_at":"2018-02-22T11:40:13Z","updated_at":"2018-02-22T11:41:42Z","html_url":"https://github.com/guardian/ssm-scala/pull/30#discussion_r169930461","pull_request_url":"https://api.github.com/repos/guardian/ssm-scala/pulls/30","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/guardian/ssm-scala/pulls/comments/169930461"},"html":{"href":"https://github.com/guardian/ssm-scala/pull/30#discussion_r169930461"},"pull_request":{"href":"https://api.github.com/repos/guardian/ssm-scala/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/ssm-scala/pulls/30","id":170328485,"html_url":"https://github.com/guardian/ssm-scala/pull/30","diff_url":"https://github.com/guardian/ssm-scala/pull/30.diff","patch_url":"https://github.com/guardian/ssm-scala/pull/30.patch","issue_url":"https://api.github.com/repos/guardian/ssm-scala/issues/30","number":30,"state":"open","locked":false,"title":"Use private IP address if no public IP address","user":{"login":"satterly","id":615057,"avatar_url":"https://avatars0.githubusercontent.com/u/615057?v=4","gravatar_id":"","url":"https://api.github.com/users/satterly","html_url":"https://github.com/satterly","followers_url":"https://api.github.com/users/satterly/followers","following_url":"https://api.github.com/users/satterly/following{/other_user}","gists_url":"https://api.github.com/users/satterly/gists{/gist_id}","starred_url":"https://api.github.com/users/satterly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satterly/subscriptions","organizations_url":"https://api.github.com/users/satterly/orgs","repos_url":"https://api.github.com/users/satterly/repos","events_url":"https://api.github.com/users/satterly/events{/privacy}","received_events_url":"https://api.github.com/users/satterly/received_events","type":"User","site_admin":false},"body":"Fixes #29 ","created_at":"2018-02-20T22:36:12Z","updated_at":"2018-02-22T11:41:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"304a8de2c06b4901ae491b46065b11f18ea0882f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/ssm-scala/pulls/30/commits","review_comments_url":"https://api.github.com/repos/guardian/ssm-scala/pulls/30/comments","review_comment_url":"https://api.github.com/repos/guardian/ssm-scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/ssm-scala/issues/30/comments","statuses_url":"https://api.github.com/repos/guardian/ssm-scala/statuses/4e263bb1a39de2360461624ba2dd2bb2fdeafd48","head":{"label":"satterly:public-and-private-ip","ref":"public-and-private-ip","sha":"4e263bb1a39de2360461624ba2dd2bb2fdeafd48","user":{"login":"satterly","id":615057,"avatar_url":"https://avatars0.githubusercontent.com/u/615057?v=4","gravatar_id":"","url":"https://api.github.com/users/satterly","html_url":"https://github.com/satterly","followers_url":"https://api.github.com/users/satterly/followers","following_url":"https://api.github.com/users/satterly/following{/other_user}","gists_url":"https://api.github.com/users/satterly/gists{/gist_id}","starred_url":"https://api.github.com/users/satterly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satterly/subscriptions","organizations_url":"https://api.github.com/users/satterly/orgs","repos_url":"https://api.github.com/users/satterly/repos","events_url":"https://api.github.com/users/satterly/events{/privacy}","received_events_url":"https://api.github.com/users/satterly/received_events","type":"User","site_admin":false},"repo":{"id":122264457,"name":"ssm-scala","full_name":"satterly/ssm-scala","owner":{"login":"satterly","id":615057,"avatar_url":"https://avatars0.githubusercontent.com/u/615057?v=4","gravatar_id":"","url":"https://api.github.com/users/satterly","html_url":"https://github.com/satterly","followers_url":"https://api.github.com/users/satterly/followers","following_url":"https://api.github.com/users/satterly/following{/other_user}","gists_url":"https://api.github.com/users/satterly/gists{/gist_id}","starred_url":"https://api.github.com/users/satterly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satterly/subscriptions","organizations_url":"https://api.github.com/users/satterly/orgs","repos_url":"https://api.github.com/users/satterly/repos","events_url":"https://api.github.com/users/satterly/events{/privacy}","received_events_url":"https://api.github.com/users/satterly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/satterly/ssm-scala","description":"ssh replacement: CLI program that wraps SSM's EC2 Run Command","fork":true,"url":"https://api.github.com/repos/satterly/ssm-scala","forks_url":"https://api.github.com/repos/satterly/ssm-scala/forks","keys_url":"https://api.github.com/repos/satterly/ssm-scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/satterly/ssm-scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/satterly/ssm-scala/teams","hooks_url":"https://api.github.com/repos/satterly/ssm-scala/hooks","issue_events_url":"https://api.github.com/repos/satterly/ssm-scala/issues/events{/number}","events_url":"https://api.github.com/repos/satterly/ssm-scala/events","assignees_url":"https://api.github.com/repos/satterly/ssm-scala/assignees{/user}","branches_url":"https://api.github.com/repos/satterly/ssm-scala/branches{/branch}","tags_url":"https://api.github.com/repos/satterly/ssm-scala/tags","blobs_url":"https://api.github.com/repos/satterly/ssm-scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/satterly/ssm-scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/satterly/ssm-scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/satterly/ssm-scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/satterly/ssm-scala/statuses/{sha}","languages_url":"https://api.github.com/repos/satterly/ssm-scala/languages","stargazers_url":"https://api.github.com/repos/satterly/ssm-scala/stargazers","contributors_url":"https://api.github.com/repos/satterly/ssm-scala/contributors","subscribers_url":"https://api.github.com/repos/satterly/ssm-scala/subscribers","subscription_url":"https://api.github.com/repos/satterly/ssm-scala/subscription","commits_url":"https://api.github.com/repos/satterly/ssm-scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/satterly/ssm-scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/satterly/ssm-scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/satterly/ssm-scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/satterly/ssm-scala/contents/{+path}","compare_url":"https://api.github.com/repos/satterly/ssm-scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/satterly/ssm-scala/merges","archive_url":"https://api.github.com/repos/satterly/ssm-scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/satterly/ssm-scala/downloads","issues_url":"https://api.github.com/repos/satterly/ssm-scala/issues{/number}","pulls_url":"https://api.github.com/repos/satterly/ssm-scala/pulls{/number}","milestones_url":"https://api.github.com/repos/satterly/ssm-scala/milestones{/number}","notifications_url":"https://api.github.com/repos/satterly/ssm-scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/satterly/ssm-scala/labels{/name}","releases_url":"https://api.github.com/repos/satterly/ssm-scala/releases{/id}","deployments_url":"https://api.github.com/repos/satterly/ssm-scala/deployments","created_at":"2018-02-20T22:28:06Z","updated_at":"2018-02-20T22:28:08Z","pushed_at":"2018-02-21T15:24:15Z","git_url":"git://github.com/satterly/ssm-scala.git","ssh_url":"git@github.com:satterly/ssm-scala.git","clone_url":"https://github.com/satterly/ssm-scala.git","svn_url":"https://github.com/satterly/ssm-scala","homepage":null,"size":125,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"54c58cb9a3a1fa3aed16adaac79d0bffeaae4674","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":117272170,"name":"ssm-scala","full_name":"guardian/ssm-scala","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/ssm-scala","description":"ssh replacement: CLI program that wraps SSM's EC2 Run Command","fork":false,"url":"https://api.github.com/repos/guardian/ssm-scala","forks_url":"https://api.github.com/repos/guardian/ssm-scala/forks","keys_url":"https://api.github.com/repos/guardian/ssm-scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/ssm-scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/ssm-scala/teams","hooks_url":"https://api.github.com/repos/guardian/ssm-scala/hooks","issue_events_url":"https://api.github.com/repos/guardian/ssm-scala/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/ssm-scala/events","assignees_url":"https://api.github.com/repos/guardian/ssm-scala/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/ssm-scala/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/ssm-scala/tags","blobs_url":"https://api.github.com/repos/guardian/ssm-scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/ssm-scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/ssm-scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/ssm-scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/ssm-scala/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/ssm-scala/languages","stargazers_url":"https://api.github.com/repos/guardian/ssm-scala/stargazers","contributors_url":"https://api.github.com/repos/guardian/ssm-scala/contributors","subscribers_url":"https://api.github.com/repos/guardian/ssm-scala/subscribers","subscription_url":"https://api.github.com/repos/guardian/ssm-scala/subscription","commits_url":"https://api.github.com/repos/guardian/ssm-scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/ssm-scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/ssm-scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/ssm-scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/ssm-scala/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/ssm-scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/ssm-scala/merges","archive_url":"https://api.github.com/repos/guardian/ssm-scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/ssm-scala/downloads","issues_url":"https://api.github.com/repos/guardian/ssm-scala/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/ssm-scala/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/ssm-scala/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/ssm-scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/ssm-scala/labels{/name}","releases_url":"https://api.github.com/repos/guardian/ssm-scala/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/ssm-scala/deployments","created_at":"2018-01-12T17:58:22Z","updated_at":"2018-02-13T09:31:04Z","pushed_at":"2018-02-21T18:08:20Z","git_url":"git://github.com/guardian/ssm-scala.git","ssh_url":"git@github.com:guardian/ssm-scala.git","clone_url":"https://github.com/guardian/ssm-scala.git","svn_url":"https://github.com/guardian/ssm-scala","homepage":null,"size":125,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":1,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/ssm-scala/pulls/30"},"html":{"href":"https://github.com/guardian/ssm-scala/pull/30"},"issue":{"href":"https://api.github.com/repos/guardian/ssm-scala/issues/30"},"comments":{"href":"https://api.github.com/repos/guardian/ssm-scala/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/ssm-scala/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/ssm-scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/ssm-scala/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/ssm-scala/statuses/4e263bb1a39de2360461624ba2dd2bb2fdeafd48"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"adamnfish"}}