{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/windows-installers/pulls/comments/153176438","pull_request_review_id":79142972,"id":153176438,"diff_hunk":"@@ -0,0 +1,132 @@\n+﻿using System.IO;\n+using System.IO.Abstractions;\n+using Elastic.Configuration.FileBased.Yaml;\n+using Elastic.Installer.Domain.Configuration.Wix.Session;\n+using Elastic.Installer.Domain.Model.Elasticsearch;\n+using Elastic.InstallerHosts.Elasticsearch.Tasks.Uninstall;\n+\n+namespace Elastic.InstallerHosts.Elasticsearch.Tasks.Rollback\n+{\n+\tpublic class RollbackDirectoriesTask : DeleteDirectoriesTask\n+\t{\n+\t\tpublic RollbackDirectoriesTask(string[] args, ISession session)\n+\t\t\t: base(args, session) { }\n+\n+\t\tpublic RollbackDirectoriesTask(ElasticsearchInstallationModel model, ISession session, IFileSystem fileSystem)\n+\t\t\t: base(model, session, fileSystem) { }\n+\n+\t\tprotected override bool ExecuteTask()\n+\t\t{\n+\t\t\tif (this.InstallationModel.NoticeModel.ExistingVersionInstalled)\n+\t\t\t{\n+\t\t\t\tRestoreConfigDirectory();\n+\t\t\t\tRestorePluginsDirectory();\n+\t\t\t\treturn true;\n+\t\t\t}\n+\n+\t\t\tvar fs = this.FileSystem;\n+\n+\t\t\tif (this.Session.IsInstalling)","path":"src/InstallerHosts/Elastic.InstallerHosts/Elasticsearch/Tasks/Rollback/RollbackDirectoriesTask.cs","position":29,"original_position":29,"commit_id":"d1395a38294e8fc51a019ce7341f26b1cbe1f475","original_commit_id":"d1395a38294e8fc51a019ce7341f26b1cbe1f475","user":{"login":"Mpdreamz","id":245275,"avatar_url":"https://avatars3.githubusercontent.com/u/245275?v=4","gravatar_id":"","url":"https://api.github.com/users/Mpdreamz","html_url":"https://github.com/Mpdreamz","followers_url":"https://api.github.com/users/Mpdreamz/followers","following_url":"https://api.github.com/users/Mpdreamz/following{/other_user}","gists_url":"https://api.github.com/users/Mpdreamz/gists{/gist_id}","starred_url":"https://api.github.com/users/Mpdreamz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mpdreamz/subscriptions","organizations_url":"https://api.github.com/users/Mpdreamz/orgs","repos_url":"https://api.github.com/users/Mpdreamz/repos","events_url":"https://api.github.com/users/Mpdreamz/events{/privacy}","received_events_url":"https://api.github.com/users/Mpdreamz/received_events","type":"User","site_admin":false},"body":"decrease nesting either by inverting the `if` or creating a method of the body","created_at":"2017-11-27T11:55:36Z","updated_at":"2017-11-27T12:04:21Z","html_url":"https://github.com/elastic/windows-installers/pull/142#discussion_r153176438","pull_request_url":"https://api.github.com/repos/elastic/windows-installers/pulls/142","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/elastic/windows-installers/pulls/comments/153176438"},"html":{"href":"https://github.com/elastic/windows-installers/pull/142#discussion_r153176438"},"pull_request":{"href":"https://api.github.com/repos/elastic/windows-installers/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/windows-installers/pulls/142","id":154720055,"html_url":"https://github.com/elastic/windows-installers/pull/142","diff_url":"https://github.com/elastic/windows-installers/pull/142.diff","patch_url":"https://github.com/elastic/windows-installers/pull/142.patch","issue_url":"https://api.github.com/repos/elastic/windows-installers/issues/142","number":142,"state":"open","locked":false,"title":"Don't delete data, logs and config directories on uninstall","user":{"login":"russcam","id":208231,"avatar_url":"https://avatars0.githubusercontent.com/u/208231?v=4","gravatar_id":"","url":"https://api.github.com/users/russcam","html_url":"https://github.com/russcam","followers_url":"https://api.github.com/users/russcam/followers","following_url":"https://api.github.com/users/russcam/following{/other_user}","gists_url":"https://api.github.com/users/russcam/gists{/gist_id}","starred_url":"https://api.github.com/users/russcam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russcam/subscriptions","organizations_url":"https://api.github.com/users/russcam/orgs","repos_url":"https://api.github.com/users/russcam/repos","events_url":"https://api.github.com/users/russcam/events{/privacy}","received_events_url":"https://api.github.com/users/russcam/received_events","type":"User","site_admin":false},"body":"- Delete install directory on uninstall and rollback, except data, config and logs directories when they are sub directories of the install directory.\r\n- Split rollback and uninstallation directories tasks into two separate tasks, for clarity.\r\n\r\nCloses #132","created_at":"2017-11-27T03:51:10Z","updated_at":"2017-11-27T12:04:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"691a5e07a8c78b0ce36d2f48d17a4f569ff9e743","assignee":null,"assignees":[],"requested_reviewers":[{"login":"codebrain","id":148974,"avatar_url":"https://avatars3.githubusercontent.com/u/148974?v=4","gravatar_id":"","url":"https://api.github.com/users/codebrain","html_url":"https://github.com/codebrain","followers_url":"https://api.github.com/users/codebrain/followers","following_url":"https://api.github.com/users/codebrain/following{/other_user}","gists_url":"https://api.github.com/users/codebrain/gists{/gist_id}","starred_url":"https://api.github.com/users/codebrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codebrain/subscriptions","organizations_url":"https://api.github.com/users/codebrain/orgs","repos_url":"https://api.github.com/users/codebrain/repos","events_url":"https://api.github.com/users/codebrain/events{/privacy}","received_events_url":"https://api.github.com/users/codebrain/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/windows-installers/pulls/142/commits","review_comments_url":"https://api.github.com/repos/elastic/windows-installers/pulls/142/comments","review_comment_url":"https://api.github.com/repos/elastic/windows-installers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/windows-installers/issues/142/comments","statuses_url":"https://api.github.com/repos/elastic/windows-installers/statuses/d1395a38294e8fc51a019ce7341f26b1cbe1f475","head":{"label":"elastic:feature/dont-delete-non-home-directories","ref":"feature/dont-delete-non-home-directories","sha":"d1395a38294e8fc51a019ce7341f26b1cbe1f475","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":76686186,"name":"windows-installers","full_name":"elastic/windows-installers","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/windows-installers","description":"Windows installers for the Elastic stack","fork":false,"url":"https://api.github.com/repos/elastic/windows-installers","forks_url":"https://api.github.com/repos/elastic/windows-installers/forks","keys_url":"https://api.github.com/repos/elastic/windows-installers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/windows-installers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/windows-installers/teams","hooks_url":"https://api.github.com/repos/elastic/windows-installers/hooks","issue_events_url":"https://api.github.com/repos/elastic/windows-installers/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/windows-installers/events","assignees_url":"https://api.github.com/repos/elastic/windows-installers/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/windows-installers/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/windows-installers/tags","blobs_url":"https://api.github.com/repos/elastic/windows-installers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/windows-installers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/windows-installers/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/windows-installers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/windows-installers/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/windows-installers/languages","stargazers_url":"https://api.github.com/repos/elastic/windows-installers/stargazers","contributors_url":"https://api.github.com/repos/elastic/windows-installers/contributors","subscribers_url":"https://api.github.com/repos/elastic/windows-installers/subscribers","subscription_url":"https://api.github.com/repos/elastic/windows-installers/subscription","commits_url":"https://api.github.com/repos/elastic/windows-installers/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/windows-installers/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/windows-installers/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/windows-installers/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/windows-installers/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/windows-installers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/windows-installers/merges","archive_url":"https://api.github.com/repos/elastic/windows-installers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/windows-installers/downloads","issues_url":"https://api.github.com/repos/elastic/windows-installers/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/windows-installers/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/windows-installers/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/windows-installers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/windows-installers/labels{/name}","releases_url":"https://api.github.com/repos/elastic/windows-installers/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/windows-installers/deployments","created_at":"2016-12-16T21:17:05Z","updated_at":"2017-11-27T09:46:33Z","pushed_at":"2017-11-27T08:36:53Z","git_url":"git://github.com/elastic/windows-installers.git","ssh_url":"git@github.com:elastic/windows-installers.git","clone_url":"https://github.com/elastic/windows-installers.git","svn_url":"https://github.com/elastic/windows-installers","homepage":"","size":18058,"stargazers_count":43,"watchers_count":43,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":30,"forks":16,"open_issues":30,"watchers":43,"default_branch":"master"}},"base":{"label":"elastic:fix/installdir-integration-tests","ref":"fix/installdir-integration-tests","sha":"a4e8c131253030f61a19398a13d692ca672a3e26","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":76686186,"name":"windows-installers","full_name":"elastic/windows-installers","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/windows-installers","description":"Windows installers for the Elastic stack","fork":false,"url":"https://api.github.com/repos/elastic/windows-installers","forks_url":"https://api.github.com/repos/elastic/windows-installers/forks","keys_url":"https://api.github.com/repos/elastic/windows-installers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/windows-installers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/windows-installers/teams","hooks_url":"https://api.github.com/repos/elastic/windows-installers/hooks","issue_events_url":"https://api.github.com/repos/elastic/windows-installers/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/windows-installers/events","assignees_url":"https://api.github.com/repos/elastic/windows-installers/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/windows-installers/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/windows-installers/tags","blobs_url":"https://api.github.com/repos/elastic/windows-installers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/windows-installers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/windows-installers/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/windows-installers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/windows-installers/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/windows-installers/languages","stargazers_url":"https://api.github.com/repos/elastic/windows-installers/stargazers","contributors_url":"https://api.github.com/repos/elastic/windows-installers/contributors","subscribers_url":"https://api.github.com/repos/elastic/windows-installers/subscribers","subscription_url":"https://api.github.com/repos/elastic/windows-installers/subscription","commits_url":"https://api.github.com/repos/elastic/windows-installers/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/windows-installers/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/windows-installers/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/windows-installers/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/windows-installers/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/windows-installers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/windows-installers/merges","archive_url":"https://api.github.com/repos/elastic/windows-installers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/windows-installers/downloads","issues_url":"https://api.github.com/repos/elastic/windows-installers/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/windows-installers/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/windows-installers/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/windows-installers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/windows-installers/labels{/name}","releases_url":"https://api.github.com/repos/elastic/windows-installers/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/windows-installers/deployments","created_at":"2016-12-16T21:17:05Z","updated_at":"2017-11-27T09:46:33Z","pushed_at":"2017-11-27T08:36:53Z","git_url":"git://github.com/elastic/windows-installers.git","ssh_url":"git@github.com:elastic/windows-installers.git","clone_url":"https://github.com/elastic/windows-installers.git","svn_url":"https://github.com/elastic/windows-installers","homepage":"","size":18058,"stargazers_count":43,"watchers_count":43,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":30,"forks":16,"open_issues":30,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/windows-installers/pulls/142"},"html":{"href":"https://github.com/elastic/windows-installers/pull/142"},"issue":{"href":"https://api.github.com/repos/elastic/windows-installers/issues/142"},"comments":{"href":"https://api.github.com/repos/elastic/windows-installers/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/windows-installers/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/windows-installers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/windows-installers/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/windows-installers/statuses/d1395a38294e8fc51a019ce7341f26b1cbe1f475"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Mpdreamz"}}