{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/docker-tools/pulls/comments/171081154","pull_request_review_id":99872293,"id":171081154,"diff_hunk":"@@ -73,18 +80,42 @@ public static PlatformInfo Create(Platform model, string repoName, VariableHelpe\n \n         private void InitializeFromImages()\n         {\n-            string dockerfile = File.ReadAllText(this.DockerfilePath);\n-            IEnumerable<Match> fromMatches = FromRegex.Matches(dockerfile);\n+            string dockerfile = File.ReadAllText(DockerfilePath);\n+            IList<Match> fromMatches = FromRegex.Matches(dockerfile);\n \n             if (!fromMatches.Any())\n             {\n-                throw new InvalidOperationException($\"Unable to find a FROM image in {this.DockerfilePath}.\");\n+                throw new InvalidOperationException($\"Unable to find a FROM image in {DockerfilePath}.\");\n             }\n \n             FromImages = fromMatches\n-                .Select(match => match.Groups[\"fromImage\"].Value)\n-                .Where(from => !from.Contains(\"$\"))\n+                .Select(match => match.Groups[FromImageMatchName].Value)\n+                .Where(from => !IsStageReference(from, fromMatches) && !from.Contains(\"$\"))","path":"Microsoft.DotNet.ImageBuilder/src/ViewModel/PlatformInfo.cs","position":39,"original_position":39,"commit_id":"14320a4f109f147b415685ada05f472a5a3da8d4","original_commit_id":"14320a4f109f147b415685ada05f472a5a3da8d4","user":{"login":"MichaelSimons","id":8290530,"avatar_url":"https://avatars1.githubusercontent.com/u/8290530?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaelSimons","html_url":"https://github.com/MichaelSimons","followers_url":"https://api.github.com/users/MichaelSimons/followers","following_url":"https://api.github.com/users/MichaelSimons/following{/other_user}","gists_url":"https://api.github.com/users/MichaelSimons/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelSimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelSimons/subscriptions","organizations_url":"https://api.github.com/users/MichaelSimons/orgs","repos_url":"https://api.github.com/users/MichaelSimons/repos","events_url":"https://api.github.com/users/MichaelSimons/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelSimons/received_events","type":"User","site_admin":false},"body":"Yes - this could be written in a way which is faster but I settled on this approach for improved readability.  The most number of stages in our repos is 5, the majority is 1 or 2.","created_at":"2018-02-27T22:00:39Z","updated_at":"2018-02-27T22:00:39Z","html_url":"https://github.com/dotnet/docker-tools/pull/91#discussion_r171081154","pull_request_url":"https://api.github.com/repos/dotnet/docker-tools/pulls/91","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/docker-tools/pulls/comments/171081154"},"html":{"href":"https://github.com/dotnet/docker-tools/pull/91#discussion_r171081154"},"pull_request":{"href":"https://api.github.com/repos/dotnet/docker-tools/pulls/91"}},"in_reply_to_id":171079141},"pull_request":{"url":"https://api.github.com/repos/dotnet/docker-tools/pulls/91","id":171789796,"html_url":"https://github.com/dotnet/docker-tools/pull/91","diff_url":"https://github.com/dotnet/docker-tools/pull/91.diff","patch_url":"https://github.com/dotnet/docker-tools/pull/91.patch","issue_url":"https://api.github.com/repos/dotnet/docker-tools/issues/91","number":91,"state":"open","locked":false,"title":"Add logic to handle stage references in FROM instructions","user":{"login":"MichaelSimons","id":8290530,"avatar_url":"https://avatars1.githubusercontent.com/u/8290530?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaelSimons","html_url":"https://github.com/MichaelSimons","followers_url":"https://api.github.com/users/MichaelSimons/followers","following_url":"https://api.github.com/users/MichaelSimons/following{/other_user}","gists_url":"https://api.github.com/users/MichaelSimons/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelSimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelSimons/subscriptions","organizations_url":"https://api.github.com/users/MichaelSimons/orgs","repos_url":"https://api.github.com/users/MichaelSimons/repos","events_url":"https://api.github.com/users/MichaelSimons/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelSimons/received_events","type":"User","site_admin":false},"body":"Fixes #88 ","created_at":"2018-02-27T21:29:45Z","updated_at":"2018-02-27T22:00:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c8594754d28f4e2dbe2d414c8d6a9b6fbcec658","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/docker-tools/pulls/91/commits","review_comments_url":"https://api.github.com/repos/dotnet/docker-tools/pulls/91/comments","review_comment_url":"https://api.github.com/repos/dotnet/docker-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/docker-tools/issues/91/comments","statuses_url":"https://api.github.com/repos/dotnet/docker-tools/statuses/14320a4f109f147b415685ada05f472a5a3da8d4","head":{"label":"MichaelSimons:issue-88","ref":"issue-88","sha":"14320a4f109f147b415685ada05f472a5a3da8d4","user":{"login":"MichaelSimons","id":8290530,"avatar_url":"https://avatars1.githubusercontent.com/u/8290530?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaelSimons","html_url":"https://github.com/MichaelSimons","followers_url":"https://api.github.com/users/MichaelSimons/followers","following_url":"https://api.github.com/users/MichaelSimons/following{/other_user}","gists_url":"https://api.github.com/users/MichaelSimons/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelSimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelSimons/subscriptions","organizations_url":"https://api.github.com/users/MichaelSimons/orgs","repos_url":"https://api.github.com/users/MichaelSimons/repos","events_url":"https://api.github.com/users/MichaelSimons/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelSimons/received_events","type":"User","site_admin":false},"repo":{"id":89959474,"name":"docker-tools","full_name":"MichaelSimons/docker-tools","owner":{"login":"MichaelSimons","id":8290530,"avatar_url":"https://avatars1.githubusercontent.com/u/8290530?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaelSimons","html_url":"https://github.com/MichaelSimons","followers_url":"https://api.github.com/users/MichaelSimons/followers","following_url":"https://api.github.com/users/MichaelSimons/following{/other_user}","gists_url":"https://api.github.com/users/MichaelSimons/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelSimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelSimons/subscriptions","organizations_url":"https://api.github.com/users/MichaelSimons/orgs","repos_url":"https://api.github.com/users/MichaelSimons/repos","events_url":"https://api.github.com/users/MichaelSimons/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelSimons/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MichaelSimons/docker-tools","description":"This is a repo to house some common tools for our various docker repos. ","fork":true,"url":"https://api.github.com/repos/MichaelSimons/docker-tools","forks_url":"https://api.github.com/repos/MichaelSimons/docker-tools/forks","keys_url":"https://api.github.com/repos/MichaelSimons/docker-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MichaelSimons/docker-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MichaelSimons/docker-tools/teams","hooks_url":"https://api.github.com/repos/MichaelSimons/docker-tools/hooks","issue_events_url":"https://api.github.com/repos/MichaelSimons/docker-tools/issues/events{/number}","events_url":"https://api.github.com/repos/MichaelSimons/docker-tools/events","assignees_url":"https://api.github.com/repos/MichaelSimons/docker-tools/assignees{/user}","branches_url":"https://api.github.com/repos/MichaelSimons/docker-tools/branches{/branch}","tags_url":"https://api.github.com/repos/MichaelSimons/docker-tools/tags","blobs_url":"https://api.github.com/repos/MichaelSimons/docker-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MichaelSimons/docker-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MichaelSimons/docker-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/MichaelSimons/docker-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MichaelSimons/docker-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/MichaelSimons/docker-tools/languages","stargazers_url":"https://api.github.com/repos/MichaelSimons/docker-tools/stargazers","contributors_url":"https://api.github.com/repos/MichaelSimons/docker-tools/contributors","subscribers_url":"https://api.github.com/repos/MichaelSimons/docker-tools/subscribers","subscription_url":"https://api.github.com/repos/MichaelSimons/docker-tools/subscription","commits_url":"https://api.github.com/repos/MichaelSimons/docker-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/MichaelSimons/docker-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/MichaelSimons/docker-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/MichaelSimons/docker-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/MichaelSimons/docker-tools/contents/{+path}","compare_url":"https://api.github.com/repos/MichaelSimons/docker-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MichaelSimons/docker-tools/merges","archive_url":"https://api.github.com/repos/MichaelSimons/docker-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MichaelSimons/docker-tools/downloads","issues_url":"https://api.github.com/repos/MichaelSimons/docker-tools/issues{/number}","pulls_url":"https://api.github.com/repos/MichaelSimons/docker-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/MichaelSimons/docker-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/MichaelSimons/docker-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MichaelSimons/docker-tools/labels{/name}","releases_url":"https://api.github.com/repos/MichaelSimons/docker-tools/releases{/id}","deployments_url":"https://api.github.com/repos/MichaelSimons/docker-tools/deployments","created_at":"2017-05-01T20:19:00Z","updated_at":"2017-05-03T21:06:31Z","pushed_at":"2018-02-27T21:28:19Z","git_url":"git://github.com/MichaelSimons/docker-tools.git","ssh_url":"git@github.com:MichaelSimons/docker-tools.git","clone_url":"https://github.com/MichaelSimons/docker-tools.git","svn_url":"https://github.com/MichaelSimons/docker-tools","homepage":null,"size":143,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"ac09c16173c354646eab1f5a137b5b069cc8271d","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":89951797,"name":"docker-tools","full_name":"dotnet/docker-tools","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/docker-tools","description":"This is a repo to house some common tools for our various docker repos. ","fork":false,"url":"https://api.github.com/repos/dotnet/docker-tools","forks_url":"https://api.github.com/repos/dotnet/docker-tools/forks","keys_url":"https://api.github.com/repos/dotnet/docker-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/docker-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/docker-tools/teams","hooks_url":"https://api.github.com/repos/dotnet/docker-tools/hooks","issue_events_url":"https://api.github.com/repos/dotnet/docker-tools/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/docker-tools/events","assignees_url":"https://api.github.com/repos/dotnet/docker-tools/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/docker-tools/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/docker-tools/tags","blobs_url":"https://api.github.com/repos/dotnet/docker-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/docker-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/docker-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/docker-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/docker-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/docker-tools/languages","stargazers_url":"https://api.github.com/repos/dotnet/docker-tools/stargazers","contributors_url":"https://api.github.com/repos/dotnet/docker-tools/contributors","subscribers_url":"https://api.github.com/repos/dotnet/docker-tools/subscribers","subscription_url":"https://api.github.com/repos/dotnet/docker-tools/subscription","commits_url":"https://api.github.com/repos/dotnet/docker-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/docker-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/docker-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/docker-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/docker-tools/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/docker-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/docker-tools/merges","archive_url":"https://api.github.com/repos/dotnet/docker-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/docker-tools/downloads","issues_url":"https://api.github.com/repos/dotnet/docker-tools/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/docker-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/docker-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/docker-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/docker-tools/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/docker-tools/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/docker-tools/deployments","created_at":"2017-05-01T18:41:47Z","updated_at":"2018-02-19T22:06:11Z","pushed_at":"2018-02-27T21:29:45Z","git_url":"git://github.com/dotnet/docker-tools.git","ssh_url":"git@github.com:dotnet/docker-tools.git","clone_url":"https://github.com/dotnet/docker-tools.git","svn_url":"https://github.com/dotnet/docker-tools","homepage":null,"size":120,"stargazers_count":7,"watchers_count":7,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":7,"open_issues":10,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/docker-tools/pulls/91"},"html":{"href":"https://github.com/dotnet/docker-tools/pull/91"},"issue":{"href":"https://api.github.com/repos/dotnet/docker-tools/issues/91"},"comments":{"href":"https://api.github.com/repos/dotnet/docker-tools/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/docker-tools/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/docker-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/docker-tools/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/docker-tools/statuses/14320a4f109f147b415685ada05f472a5a3da8d4"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"MichaelSimons"}}