{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments/203811348","pull_request_review_id":138777340,"id":203811348,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzgxMTM0OA==","diff_hunk":"@@ -0,0 +1,123 @@\n+// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Xml.Linq;\n+\n+namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS\n+{\n+    public class IISDeploymentParameters : DeploymentParameters\n+    {\n+        public IISDeploymentParameters() : base()\n+        {\n+            WebConfigActionList = CreateDefaultWebConfigActionList();\n+        }\n+\n+        public IISDeploymentParameters(TestVariant variant)\n+            : base(variant)\n+        {\n+            WebConfigActionList = CreateDefaultWebConfigActionList();\n+        }\n+\n+        public IISDeploymentParameters(\n+           string applicationPath,\n+           ServerType serverType,\n+           RuntimeFlavor runtimeFlavor,\n+           RuntimeArchitecture runtimeArchitecture)\n+            : base(applicationPath, serverType, runtimeFlavor, runtimeArchitecture)\n+        {\n+            WebConfigActionList = CreateDefaultWebConfigActionList();\n+        }\n+\n+        public IISDeploymentParameters(DeploymentParameters parameters)\n+            : base(parameters)\n+        {\n+            WebConfigActionList = CreateDefaultWebConfigActionList();\n+\n+            if (parameters is IISDeploymentParameters)\n+            {\n+                var tempParameters = (IISDeploymentParameters)parameters;\n+                WebConfigActionList = tempParameters.WebConfigActionList;\n+                ServerConfigActionList = tempParameters.ServerConfigActionList;\n+                WebConfigBasedEnvironmentVariables = tempParameters.WebConfigBasedEnvironmentVariables;\n+                HandlerSettings = tempParameters.HandlerSettings;\n+            }\n+        }\n+\n+        private IList<Action<XElement>> CreateDefaultWebConfigActionList()\n+        {\n+            return new List<Action<XElement>>() { AddWebConfigEnvironmentVariables(), AddHandlerSettings() };\n+        }\n+\n+        public IList<Action<XElement>> WebConfigActionList { get; }\n+\n+        public IList<Action<XElement>> ServerConfigActionList { get; } = new List<Action<XElement>>();\n+\n+        public IDictionary<string, string> WebConfigBasedEnvironmentVariables { get; set; } = new Dictionary<string, string>();\n+\n+        public IDictionary<string, string> HandlerSettings { get; set; } = new Dictionary<string, string>();\n+\n+        private Action<XElement> AddWebConfigEnvironmentVariables()\n+        {\n+            return xElement =>\n+            {\n+                if (WebConfigBasedEnvironmentVariables.Count == 0)\n+                {\n+                    return;\n+                }\n+\n+                var element = xElement.Descendants(\"environmentVariables\").SingleOrDefault();\n+                if (element == null)\n+                {\n+                    element = new XElement(\"environmentVariables\");\n+                    xElement.Descendants(\"aspNetCore\").SingleOrDefault().Add(element);\n+                }\n+\n+                foreach (var envVar in WebConfigBasedEnvironmentVariables)\n+                {\n+                    CreateOrSetElement(element, envVar.Key, envVar.Value, \"environmentVariable\");\n+                }\n+            };\n+        }\n+\n+        private Action<XElement> AddHandlerSettings()\n+        {\n+            return xElement =>\n+            {\n+                if (HandlerSettings.Count == 0)\n+                {\n+                    return;\n+                }\n+\n+                var element = xElement.Descendants(\"handlerSettings\").SingleOrDefault();\n+                if (element == null)\n+                {\n+                    element = new XElement(\"handlerSettings\");\n+                    xElement.Descendants(\"aspNetCore\").SingleOrDefault().Add(element);\n+                }\n+\n+                foreach (var handlerSetting in HandlerSettings)\n+                {\n+                    CreateOrSetElement(element, handlerSetting.Key, handlerSetting.Value, \"handlerSetting\");\n+                }\n+            };\n+        }\n+\n+        public static void CreateOrSetElement(XElement rootElement, string name, string value, string elementName)","path":"src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameters.cs","position":108,"original_position":108,"commit_id":"c63a722cf4b0bfa53decc9fb4258df616573d8a9","original_commit_id":"c63a722cf4b0bfa53decc9fb4258df616573d8a9","user":{"login":"pakrym","id":1697911,"node_id":"MDQ6VXNlcjE2OTc5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false},"body":"private?","created_at":"2018-07-19T17:34:18Z","updated_at":"2018-07-19T17:34:18Z","html_url":"https://github.com/aspnet/IISIntegration/pull/1063#discussion_r203811348","pull_request_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments/203811348"},"html":{"href":"https://github.com/aspnet/IISIntegration/pull/1063#discussion_r203811348"},"pull_request":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063","id":201764693,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNzY0Njkz","html_url":"https://github.com/aspnet/IISIntegration/pull/1063","diff_url":"https://github.com/aspnet/IISIntegration/pull/1063.diff","patch_url":"https://github.com/aspnet/IISIntegration/pull/1063.patch","issue_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/1063","number":1063,"state":"open","locked":false,"title":"Move config operations from helpers to functions on the deployment parameters","user":{"login":"jkotalik","id":8302101,"node_id":"MDQ6VXNlcjgzMDIxMDE=","avatar_url":"https://avatars0.githubusercontent.com/u/8302101?v=4","gravatar_id":"","url":"https://api.github.com/users/jkotalik","html_url":"https://github.com/jkotalik","followers_url":"https://api.github.com/users/jkotalik/followers","following_url":"https://api.github.com/users/jkotalik/following{/other_user}","gists_url":"https://api.github.com/users/jkotalik/gists{/gist_id}","starred_url":"https://api.github.com/users/jkotalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkotalik/subscriptions","organizations_url":"https://api.github.com/users/jkotalik/orgs","repos_url":"https://api.github.com/users/jkotalik/repos","events_url":"https://api.github.com/users/jkotalik/events{/privacy}","received_events_url":"https://api.github.com/users/jkotalik/received_events","type":"User","site_admin":false},"body":"This change modifies the way we apply configuration changes on the web.config and applicationhost.config files. This helps with writing tests that need to modify configuration. Also, all web.config modification should be added before deployment, rather than after, which intuitively makes more sense.","created_at":"2018-07-16T21:24:07Z","updated_at":"2018-07-19T17:34:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e3d5fa02d0b3650e3c5f05da0f65291d57b0273","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063/commits","review_comments_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063/comments","review_comment_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/1063/comments","statuses_url":"https://api.github.com/repos/aspnet/IISIntegration/statuses/c63a722cf4b0bfa53decc9fb4258df616573d8a9","head":{"label":"aspnet:jkotalik/configCleanup","ref":"jkotalik/configCleanup","sha":"c63a722cf4b0bfa53decc9fb4258df616573d8a9","user":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":42883699,"node_id":"MDEwOlJlcG9zaXRvcnk0Mjg4MzY5OQ==","name":"IISIntegration","full_name":"aspnet/IISIntegration","owner":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/IISIntegration","description":"ASP.NET Core IIS integration","fork":false,"url":"https://api.github.com/repos/aspnet/IISIntegration","forks_url":"https://api.github.com/repos/aspnet/IISIntegration/forks","keys_url":"https://api.github.com/repos/aspnet/IISIntegration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/IISIntegration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/IISIntegration/teams","hooks_url":"https://api.github.com/repos/aspnet/IISIntegration/hooks","issue_events_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/IISIntegration/events","assignees_url":"https://api.github.com/repos/aspnet/IISIntegration/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/IISIntegration/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/IISIntegration/tags","blobs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/IISIntegration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/IISIntegration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/IISIntegration/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/IISIntegration/languages","stargazers_url":"https://api.github.com/repos/aspnet/IISIntegration/stargazers","contributors_url":"https://api.github.com/repos/aspnet/IISIntegration/contributors","subscribers_url":"https://api.github.com/repos/aspnet/IISIntegration/subscribers","subscription_url":"https://api.github.com/repos/aspnet/IISIntegration/subscription","commits_url":"https://api.github.com/repos/aspnet/IISIntegration/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/IISIntegration/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/IISIntegration/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/IISIntegration/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/IISIntegration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/IISIntegration/merges","archive_url":"https://api.github.com/repos/aspnet/IISIntegration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/IISIntegration/downloads","issues_url":"https://api.github.com/repos/aspnet/IISIntegration/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/IISIntegration/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/IISIntegration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/IISIntegration/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/IISIntegration/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/IISIntegration/deployments","created_at":"2015-09-21T17:55:09Z","updated_at":"2018-07-19T05:34:18Z","pushed_at":"2018-07-19T17:29:43Z","git_url":"git://github.com/aspnet/IISIntegration.git","ssh_url":"git@github.com:aspnet/IISIntegration.git","clone_url":"https://github.com/aspnet/IISIntegration.git","svn_url":"https://github.com/aspnet/IISIntegration","homepage":"","size":11886,"stargazers_count":112,"watchers_count":112,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"archived":false,"open_issues_count":114,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":44,"open_issues":114,"watchers":112,"default_branch":"release/2.2"}},"base":{"label":"aspnet:release/2.2","ref":"release/2.2","sha":"97ebe36b1309871c2767cd72181a10322991a489","user":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":42883699,"node_id":"MDEwOlJlcG9zaXRvcnk0Mjg4MzY5OQ==","name":"IISIntegration","full_name":"aspnet/IISIntegration","owner":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/IISIntegration","description":"ASP.NET Core IIS integration","fork":false,"url":"https://api.github.com/repos/aspnet/IISIntegration","forks_url":"https://api.github.com/repos/aspnet/IISIntegration/forks","keys_url":"https://api.github.com/repos/aspnet/IISIntegration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/IISIntegration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/IISIntegration/teams","hooks_url":"https://api.github.com/repos/aspnet/IISIntegration/hooks","issue_events_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/IISIntegration/events","assignees_url":"https://api.github.com/repos/aspnet/IISIntegration/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/IISIntegration/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/IISIntegration/tags","blobs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/IISIntegration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/IISIntegration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/IISIntegration/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/IISIntegration/languages","stargazers_url":"https://api.github.com/repos/aspnet/IISIntegration/stargazers","contributors_url":"https://api.github.com/repos/aspnet/IISIntegration/contributors","subscribers_url":"https://api.github.com/repos/aspnet/IISIntegration/subscribers","subscription_url":"https://api.github.com/repos/aspnet/IISIntegration/subscription","commits_url":"https://api.github.com/repos/aspnet/IISIntegration/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/IISIntegration/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/IISIntegration/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/IISIntegration/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/IISIntegration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/IISIntegration/merges","archive_url":"https://api.github.com/repos/aspnet/IISIntegration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/IISIntegration/downloads","issues_url":"https://api.github.com/repos/aspnet/IISIntegration/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/IISIntegration/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/IISIntegration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/IISIntegration/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/IISIntegration/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/IISIntegration/deployments","created_at":"2015-09-21T17:55:09Z","updated_at":"2018-07-19T05:34:18Z","pushed_at":"2018-07-19T17:29:43Z","git_url":"git://github.com/aspnet/IISIntegration.git","ssh_url":"git@github.com:aspnet/IISIntegration.git","clone_url":"https://github.com/aspnet/IISIntegration.git","svn_url":"https://github.com/aspnet/IISIntegration","homepage":"","size":11886,"stargazers_count":112,"watchers_count":112,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"archived":false,"open_issues_count":114,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":44,"open_issues":114,"watchers":112,"default_branch":"release/2.2"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063"},"html":{"href":"https://github.com/aspnet/IISIntegration/pull/1063"},"issue":{"href":"https://api.github.com/repos/aspnet/IISIntegration/issues/1063"},"comments":{"href":"https://api.github.com/repos/aspnet/IISIntegration/issues/1063/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/1063/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/IISIntegration/statuses/c63a722cf4b0bfa53decc9fb4258df616573d8a9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pakrym"}}