{"action":"created","comment":{"url":"https://api.github.com/repos/kiteco/kite-installer/pulls/comments/91475663","pull_request_review_id":11983178,"id":91475663,"diff_hunk":"@@ -95,10 +96,33 @@ function findClosestGitRepo(filePath) {\n   return findClosestGitRepo(path.dirname(filePath));\n }\n \n+// Returns a new Promise that resolve if the passed-in promise is rejected and\n+// will be rejected with the provided error if the passed-in promise resolve.\n+function reversePromise (promise, rejectionMessage) {\n+  return new Promise((resolve, reject) => {\n+    promise.then(() => reject(rejectionMessage)).catch(() => resolve())\n+  })\n+}\n+\n+// Spawns a child process and returns a promise that will be resolved if\n+// the process ends with a code of 0, otherwise the promise will be rejected\n+// with an error object of the provided rejectionType.\n+// Optionally a callback\n+function spawnPromise (cmd, cmdOptions, rejectionType) {\n+  return new Promise((resolve, reject) => {\n+    const proc = child_process.spawn(cmd, cmdOptions)\n+    proc.on('close', (code) =>{\n+      code ? reject({ type: rejectionType, data: proc.stderr }) : resolve()","path":"lib/utils.js","position":28,"original_position":28,"commit_id":"8216ea8c4ae8e2759182ac9c9a44004c670ed4c1","original_commit_id":"8216ea8c4ae8e2759182ac9c9a44004c670ed4c1","user":{"login":"abe33","id":247140,"avatar_url":"https://avatars.githubusercontent.com/u/247140?v=3","gravatar_id":"","url":"https://api.github.com/users/abe33","html_url":"https://github.com/abe33","followers_url":"https://api.github.com/users/abe33/followers","following_url":"https://api.github.com/users/abe33/following{/other_user}","gists_url":"https://api.github.com/users/abe33/gists{/gist_id}","starred_url":"https://api.github.com/users/abe33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abe33/subscriptions","organizations_url":"https://api.github.com/users/abe33/orgs","repos_url":"https://api.github.com/users/abe33/repos","events_url":"https://api.github.com/users/abe33/events{/privacy}","received_events_url":"https://api.github.com/users/abe33/received_events","type":"User","site_admin":false},"body":"Totally","created_at":"2016-12-08T09:31:04Z","updated_at":"2016-12-08T09:31:04Z","html_url":"https://github.com/kiteco/kite-installer/pull/30#discussion_r91475663","pull_request_url":"https://api.github.com/repos/kiteco/kite-installer/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/kiteco/kite-installer/pulls/comments/91475663"},"html":{"href":"https://github.com/kiteco/kite-installer/pull/30#discussion_r91475663"},"pull_request":{"href":"https://api.github.com/repos/kiteco/kite-installer/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/kiteco/kite-installer/pulls/30","id":96788092,"html_url":"https://github.com/kiteco/kite-installer/pull/30","diff_url":"https://github.com/kiteco/kite-installer/pull/30.diff","patch_url":"https://github.com/kiteco/kite-installer/pull/30.patch","issue_url":"https://api.github.com/repos/kiteco/kite-installer/issues/30","number":30,"state":"open","locked":false,"title":"Test state controller","user":{"login":"abe33","id":247140,"avatar_url":"https://avatars.githubusercontent.com/u/247140?v=3","gravatar_id":"","url":"https://api.github.com/users/abe33","html_url":"https://github.com/abe33","followers_url":"https://api.github.com/users/abe33/followers","following_url":"https://api.github.com/users/abe33/following{/other_user}","gists_url":"https://api.github.com/users/abe33/gists{/gist_id}","starred_url":"https://api.github.com/users/abe33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abe33/subscriptions","organizations_url":"https://api.github.com/users/abe33/orgs","repos_url":"https://api.github.com/users/abe33/repos","events_url":"https://api.github.com/users/abe33/events{/privacy}","received_events_url":"https://api.github.com/users/abe33/received_events","type":"User","site_admin":false},"body":"This PR is a way for me to hit two birds with one stone: \r\n\r\n1. getting used to the kite API and the installer process\r\n2. adding tests to the StateController as it appears to be a key component of the kite plugin\r\n\r\nI’ll also try to refactor the code the I see something that can be improved.\r\n\r\nThe commit messages convention is based on the one used by Atom, see https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages\r\n\r\nIt'd be great if one of the admin could enable Travis for this project as I don't have admin rights for this one. ","created_at":"2016-12-06T19:21:01Z","updated_at":"2016-12-08T09:31:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ffa919bfebd90de60564fb7632fffa8f735593f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kiteco/kite-installer/pulls/30/commits","review_comments_url":"https://api.github.com/repos/kiteco/kite-installer/pulls/30/comments","review_comment_url":"https://api.github.com/repos/kiteco/kite-installer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kiteco/kite-installer/issues/30/comments","statuses_url":"https://api.github.com/repos/kiteco/kite-installer/statuses/8216ea8c4ae8e2759182ac9c9a44004c670ed4c1","head":{"label":"kiteco:cn-test-state-controller","ref":"cn-test-state-controller","sha":"8216ea8c4ae8e2759182ac9c9a44004c670ed4c1","user":{"login":"kiteco","id":7321919,"avatar_url":"https://avatars.githubusercontent.com/u/7321919?v=3","gravatar_id":"","url":"https://api.github.com/users/kiteco","html_url":"https://github.com/kiteco","followers_url":"https://api.github.com/users/kiteco/followers","following_url":"https://api.github.com/users/kiteco/following{/other_user}","gists_url":"https://api.github.com/users/kiteco/gists{/gist_id}","starred_url":"https://api.github.com/users/kiteco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiteco/subscriptions","organizations_url":"https://api.github.com/users/kiteco/orgs","repos_url":"https://api.github.com/users/kiteco/repos","events_url":"https://api.github.com/users/kiteco/events{/privacy}","received_events_url":"https://api.github.com/users/kiteco/received_events","type":"Organization","site_admin":false},"repo":{"id":73506977,"name":"kite-installer","full_name":"kiteco/kite-installer","owner":{"login":"kiteco","id":7321919,"avatar_url":"https://avatars.githubusercontent.com/u/7321919?v=3","gravatar_id":"","url":"https://api.github.com/users/kiteco","html_url":"https://github.com/kiteco","followers_url":"https://api.github.com/users/kiteco/followers","following_url":"https://api.github.com/users/kiteco/following{/other_user}","gists_url":"https://api.github.com/users/kiteco/gists{/gist_id}","starred_url":"https://api.github.com/users/kiteco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiteco/subscriptions","organizations_url":"https://api.github.com/users/kiteco/orgs","repos_url":"https://api.github.com/users/kiteco/repos","events_url":"https://api.github.com/users/kiteco/events{/privacy}","received_events_url":"https://api.github.com/users/kiteco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kiteco/kite-installer","description":"Javascript library to install Kite app","fork":false,"url":"https://api.github.com/repos/kiteco/kite-installer","forks_url":"https://api.github.com/repos/kiteco/kite-installer/forks","keys_url":"https://api.github.com/repos/kiteco/kite-installer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiteco/kite-installer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiteco/kite-installer/teams","hooks_url":"https://api.github.com/repos/kiteco/kite-installer/hooks","issue_events_url":"https://api.github.com/repos/kiteco/kite-installer/issues/events{/number}","events_url":"https://api.github.com/repos/kiteco/kite-installer/events","assignees_url":"https://api.github.com/repos/kiteco/kite-installer/assignees{/user}","branches_url":"https://api.github.com/repos/kiteco/kite-installer/branches{/branch}","tags_url":"https://api.github.com/repos/kiteco/kite-installer/tags","blobs_url":"https://api.github.com/repos/kiteco/kite-installer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiteco/kite-installer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiteco/kite-installer/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiteco/kite-installer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiteco/kite-installer/statuses/{sha}","languages_url":"https://api.github.com/repos/kiteco/kite-installer/languages","stargazers_url":"https://api.github.com/repos/kiteco/kite-installer/stargazers","contributors_url":"https://api.github.com/repos/kiteco/kite-installer/contributors","subscribers_url":"https://api.github.com/repos/kiteco/kite-installer/subscribers","subscription_url":"https://api.github.com/repos/kiteco/kite-installer/subscription","commits_url":"https://api.github.com/repos/kiteco/kite-installer/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiteco/kite-installer/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiteco/kite-installer/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiteco/kite-installer/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiteco/kite-installer/contents/{+path}","compare_url":"https://api.github.com/repos/kiteco/kite-installer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiteco/kite-installer/merges","archive_url":"https://api.github.com/repos/kiteco/kite-installer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiteco/kite-installer/downloads","issues_url":"https://api.github.com/repos/kiteco/kite-installer/issues{/number}","pulls_url":"https://api.github.com/repos/kiteco/kite-installer/pulls{/number}","milestones_url":"https://api.github.com/repos/kiteco/kite-installer/milestones{/number}","notifications_url":"https://api.github.com/repos/kiteco/kite-installer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiteco/kite-installer/labels{/name}","releases_url":"https://api.github.com/repos/kiteco/kite-installer/releases{/id}","deployments_url":"https://api.github.com/repos/kiteco/kite-installer/deployments","created_at":"2016-11-11T19:54:14Z","updated_at":"2016-12-05T07:48:42Z","pushed_at":"2016-12-07T21:35:10Z","git_url":"git://github.com/kiteco/kite-installer.git","ssh_url":"git@github.com:kiteco/kite-installer.git","clone_url":"https://github.com/kiteco/kite-installer.git","svn_url":"https://github.com/kiteco/kite-installer","homepage":null,"size":179,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":1,"default_branch":"master"}},"base":{"label":"kiteco:master","ref":"master","sha":"2c0e3253bf8d3fddd13366d57994e7cc404d6086","user":{"login":"kiteco","id":7321919,"avatar_url":"https://avatars.githubusercontent.com/u/7321919?v=3","gravatar_id":"","url":"https://api.github.com/users/kiteco","html_url":"https://github.com/kiteco","followers_url":"https://api.github.com/users/kiteco/followers","following_url":"https://api.github.com/users/kiteco/following{/other_user}","gists_url":"https://api.github.com/users/kiteco/gists{/gist_id}","starred_url":"https://api.github.com/users/kiteco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiteco/subscriptions","organizations_url":"https://api.github.com/users/kiteco/orgs","repos_url":"https://api.github.com/users/kiteco/repos","events_url":"https://api.github.com/users/kiteco/events{/privacy}","received_events_url":"https://api.github.com/users/kiteco/received_events","type":"Organization","site_admin":false},"repo":{"id":73506977,"name":"kite-installer","full_name":"kiteco/kite-installer","owner":{"login":"kiteco","id":7321919,"avatar_url":"https://avatars.githubusercontent.com/u/7321919?v=3","gravatar_id":"","url":"https://api.github.com/users/kiteco","html_url":"https://github.com/kiteco","followers_url":"https://api.github.com/users/kiteco/followers","following_url":"https://api.github.com/users/kiteco/following{/other_user}","gists_url":"https://api.github.com/users/kiteco/gists{/gist_id}","starred_url":"https://api.github.com/users/kiteco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiteco/subscriptions","organizations_url":"https://api.github.com/users/kiteco/orgs","repos_url":"https://api.github.com/users/kiteco/repos","events_url":"https://api.github.com/users/kiteco/events{/privacy}","received_events_url":"https://api.github.com/users/kiteco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kiteco/kite-installer","description":"Javascript library to install Kite app","fork":false,"url":"https://api.github.com/repos/kiteco/kite-installer","forks_url":"https://api.github.com/repos/kiteco/kite-installer/forks","keys_url":"https://api.github.com/repos/kiteco/kite-installer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiteco/kite-installer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiteco/kite-installer/teams","hooks_url":"https://api.github.com/repos/kiteco/kite-installer/hooks","issue_events_url":"https://api.github.com/repos/kiteco/kite-installer/issues/events{/number}","events_url":"https://api.github.com/repos/kiteco/kite-installer/events","assignees_url":"https://api.github.com/repos/kiteco/kite-installer/assignees{/user}","branches_url":"https://api.github.com/repos/kiteco/kite-installer/branches{/branch}","tags_url":"https://api.github.com/repos/kiteco/kite-installer/tags","blobs_url":"https://api.github.com/repos/kiteco/kite-installer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiteco/kite-installer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiteco/kite-installer/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiteco/kite-installer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiteco/kite-installer/statuses/{sha}","languages_url":"https://api.github.com/repos/kiteco/kite-installer/languages","stargazers_url":"https://api.github.com/repos/kiteco/kite-installer/stargazers","contributors_url":"https://api.github.com/repos/kiteco/kite-installer/contributors","subscribers_url":"https://api.github.com/repos/kiteco/kite-installer/subscribers","subscription_url":"https://api.github.com/repos/kiteco/kite-installer/subscription","commits_url":"https://api.github.com/repos/kiteco/kite-installer/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiteco/kite-installer/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiteco/kite-installer/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiteco/kite-installer/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiteco/kite-installer/contents/{+path}","compare_url":"https://api.github.com/repos/kiteco/kite-installer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiteco/kite-installer/merges","archive_url":"https://api.github.com/repos/kiteco/kite-installer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiteco/kite-installer/downloads","issues_url":"https://api.github.com/repos/kiteco/kite-installer/issues{/number}","pulls_url":"https://api.github.com/repos/kiteco/kite-installer/pulls{/number}","milestones_url":"https://api.github.com/repos/kiteco/kite-installer/milestones{/number}","notifications_url":"https://api.github.com/repos/kiteco/kite-installer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiteco/kite-installer/labels{/name}","releases_url":"https://api.github.com/repos/kiteco/kite-installer/releases{/id}","deployments_url":"https://api.github.com/repos/kiteco/kite-installer/deployments","created_at":"2016-11-11T19:54:14Z","updated_at":"2016-12-05T07:48:42Z","pushed_at":"2016-12-07T21:35:10Z","git_url":"git://github.com/kiteco/kite-installer.git","ssh_url":"git@github.com:kiteco/kite-installer.git","clone_url":"https://github.com/kiteco/kite-installer.git","svn_url":"https://github.com/kiteco/kite-installer","homepage":null,"size":179,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kiteco/kite-installer/pulls/30"},"html":{"href":"https://github.com/kiteco/kite-installer/pull/30"},"issue":{"href":"https://api.github.com/repos/kiteco/kite-installer/issues/30"},"comments":{"href":"https://api.github.com/repos/kiteco/kite-installer/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/kiteco/kite-installer/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/kiteco/kite-installer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kiteco/kite-installer/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/kiteco/kite-installer/statuses/8216ea8c4ae8e2759182ac9c9a44004c670ed4c1"}}}}
{"actor":{"display_login":"abe33"}}