{"action":"created","comment":{"url":"https://api.github.com/repos/koding/koding/pulls/comments/79700604","id":79700604,"diff_hunk":"@@ -0,0 +1,306 @@\n+_ = require 'lodash'\n+kd = require 'kd'\n+isAdmin = require 'app/util/isAdmin'\n+immutable = require 'app/util/immutable'\n+showError = require 'app/util/showError'\n+whoami = require 'app/util/whoami'\n+getMachineOwner = require 'app/util/getMachineOwner'\n+isStackTemplateSharedWithTeam = require 'app/util/isstacktemplatesharedwithteam'\n+{ series, waterfall } = require 'async'\n+{ createSelector } = require 'reselect'\n+\n+\n+{ makeNamespace, expandActionType,\n+  normalize, defineSchema } = require 'app/redux/helper'\n+\n+withNamespace = makeNamespace 'koding', 'sidebar', 'stacks'\n+\n+GENERATE_STACK = expandActionType withNamespace 'GENERATE_STACK'\n+EDIT = expandActionType withNamespace 'EDIT'\n+INITIALIZE = expandActionType withNamespace 'INITIALIZE'\n+{ LOAD, REMOVE } = require 'app/redux/modules/bongo'\n+\n+bongo = require 'app/redux/modules/bongo'\n+\n+reducer = (state = immutable({}), action) ->\n+\n+  switch action.type\n+\n+    when 'STACK_REVISION_SUCCESS'\n+      { result: { _id, data, error } } = action\n+      return state  if error\n+      state = state.set _id, immutable data\n+\n+      return state\n+\n+    else\n+      return state\n+\n+# actions\n+\n+initializeStack = (template) -> (dispatch) ->\n+  { reactor } = kd.singletons\n+\n+  waterfall([\n+    (next) ->\n+      dispatch {\n+        types: [LOAD.BEGIN, LOAD.SUCCESS, LOAD.FAIL]\n+        bongo: -> template.generateStack().then (result) ->\n+          { stack, results: { machines } } = result\n+          instances = []\n+          instances.push stack\n+          machines.forEach (machine) -> instances.push machine.obj","path":"client/app/lib/redux/modules/sidebar/stacks.coffee","position":52,"original_position":52,"commit_id":"75af45e24ceea768f966094c79c5220888a4b63f","original_commit_id":"75af45e24ceea768f966094c79c5220888a4b63f","user":{"login":"usirin","id":1783869,"avatar_url":"https://avatars.githubusercontent.com/u/1783869?v=3","gravatar_id":"","url":"https://api.github.com/users/usirin","html_url":"https://github.com/usirin","followers_url":"https://api.github.com/users/usirin/followers","following_url":"https://api.github.com/users/usirin/following{/other_user}","gists_url":"https://api.github.com/users/usirin/gists{/gist_id}","starred_url":"https://api.github.com/users/usirin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usirin/subscriptions","organizations_url":"https://api.github.com/users/usirin/orgs","repos_url":"https://api.github.com/users/usirin/repos","events_url":"https://api.github.com/users/usirin/events{/privacy}","received_events_url":"https://api.github.com/users/usirin/received_events","type":"User","site_admin":false},"body":"```coffee\r\ninstances = machines.map (machine) -> machine.obj\r\n```","created_at":"2016-09-20T20:11:02Z","updated_at":"2016-09-20T20:11:02Z","html_url":"https://github.com/koding/koding/pull/9069#discussion_r79700604","pull_request_url":"https://api.github.com/repos/koding/koding/pulls/9069","_links":{"self":{"href":"https://api.github.com/repos/koding/koding/pulls/comments/79700604"},"html":{"href":"https://github.com/koding/koding/pull/9069#discussion_r79700604"},"pull_request":{"href":"https://api.github.com/repos/koding/koding/pulls/9069"}}},"pull_request":{"url":"https://api.github.com/repos/koding/koding/pulls/9069","id":86031739,"html_url":"https://github.com/koding/koding/pull/9069","diff_url":"https://github.com/koding/koding/pull/9069.diff","patch_url":"https://github.com/koding/koding/pull/9069.patch","issue_url":"https://api.github.com/repos/koding/koding/issues/9069","number":9069,"state":"open","locked":false,"title":"New Sidebar","user":{"login":"hakankaradis","id":5847301,"avatar_url":"https://avatars.githubusercontent.com/u/5847301?v=3","gravatar_id":"","url":"https://api.github.com/users/hakankaradis","html_url":"https://github.com/hakankaradis","followers_url":"https://api.github.com/users/hakankaradis/followers","following_url":"https://api.github.com/users/hakankaradis/following{/other_user}","gists_url":"https://api.github.com/users/hakankaradis/gists{/gist_id}","starred_url":"https://api.github.com/users/hakankaradis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hakankaradis/subscriptions","organizations_url":"https://api.github.com/users/hakankaradis/orgs","repos_url":"https://api.github.com/users/hakankaradis/repos","events_url":"https://api.github.com/users/hakankaradis/events{/privacy}","received_events_url":"https://api.github.com/users/hakankaradis/received_events","type":"User","site_admin":false},"body":"This pr is wip right now. \r\n","created_at":"2016-09-20T18:35:02Z","updated_at":"2016-09-20T20:39:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbfe4bf32a159a73d60741a411daf909dbd39657","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/koding/koding/pulls/9069/commits","review_comments_url":"https://api.github.com/repos/koding/koding/pulls/9069/comments","review_comment_url":"https://api.github.com/repos/koding/koding/pulls/comments{/number}","comments_url":"https://api.github.com/repos/koding/koding/issues/9069/comments","statuses_url":"https://api.github.com/repos/koding/koding/statuses/75af45e24ceea768f966094c79c5220888a4b63f","head":{"label":"koding:sidebar_new","ref":"sidebar_new","sha":"75af45e24ceea768f966094c79c5220888a4b63f","user":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"repo":{"id":21317360,"name":"koding","full_name":"koding/koding","owner":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/koding/koding","description":"The Simplest Way to Manage Your Entire Dev Infrastructure!","fork":false,"url":"https://api.github.com/repos/koding/koding","forks_url":"https://api.github.com/repos/koding/koding/forks","keys_url":"https://api.github.com/repos/koding/koding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koding/koding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koding/koding/teams","hooks_url":"https://api.github.com/repos/koding/koding/hooks","issue_events_url":"https://api.github.com/repos/koding/koding/issues/events{/number}","events_url":"https://api.github.com/repos/koding/koding/events","assignees_url":"https://api.github.com/repos/koding/koding/assignees{/user}","branches_url":"https://api.github.com/repos/koding/koding/branches{/branch}","tags_url":"https://api.github.com/repos/koding/koding/tags","blobs_url":"https://api.github.com/repos/koding/koding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koding/koding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koding/koding/git/refs{/sha}","trees_url":"https://api.github.com/repos/koding/koding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koding/koding/statuses/{sha}","languages_url":"https://api.github.com/repos/koding/koding/languages","stargazers_url":"https://api.github.com/repos/koding/koding/stargazers","contributors_url":"https://api.github.com/repos/koding/koding/contributors","subscribers_url":"https://api.github.com/repos/koding/koding/subscribers","subscription_url":"https://api.github.com/repos/koding/koding/subscription","commits_url":"https://api.github.com/repos/koding/koding/commits{/sha}","git_commits_url":"https://api.github.com/repos/koding/koding/git/commits{/sha}","comments_url":"https://api.github.com/repos/koding/koding/comments{/number}","issue_comment_url":"https://api.github.com/repos/koding/koding/issues/comments{/number}","contents_url":"https://api.github.com/repos/koding/koding/contents/{+path}","compare_url":"https://api.github.com/repos/koding/koding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koding/koding/merges","archive_url":"https://api.github.com/repos/koding/koding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koding/koding/downloads","issues_url":"https://api.github.com/repos/koding/koding/issues{/number}","pulls_url":"https://api.github.com/repos/koding/koding/pulls{/number}","milestones_url":"https://api.github.com/repos/koding/koding/milestones{/number}","notifications_url":"https://api.github.com/repos/koding/koding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koding/koding/labels{/name}","releases_url":"https://api.github.com/repos/koding/koding/releases{/id}","deployments_url":"https://api.github.com/repos/koding/koding/deployments","created_at":"2014-06-29T05:46:24Z","updated_at":"2016-09-20T20:36:34Z","pushed_at":"2016-09-20T20:09:24Z","git_url":"git://github.com/koding/koding.git","ssh_url":"git@github.com:koding/koding.git","clone_url":"https://github.com/koding/koding.git","svn_url":"https://github.com/koding/koding","homepage":"https://www.koding.com","size":614940,"stargazers_count":421,"watchers_count":421,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":151,"forks":41,"open_issues":151,"watchers":421,"default_branch":"master"}},"base":{"label":"koding:master","ref":"master","sha":"f2ae29c8b6937e56a996a07fb5b58dafd5cd5cf5","user":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"repo":{"id":21317360,"name":"koding","full_name":"koding/koding","owner":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/koding/koding","description":"The Simplest Way to Manage Your Entire Dev Infrastructure!","fork":false,"url":"https://api.github.com/repos/koding/koding","forks_url":"https://api.github.com/repos/koding/koding/forks","keys_url":"https://api.github.com/repos/koding/koding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koding/koding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koding/koding/teams","hooks_url":"https://api.github.com/repos/koding/koding/hooks","issue_events_url":"https://api.github.com/repos/koding/koding/issues/events{/number}","events_url":"https://api.github.com/repos/koding/koding/events","assignees_url":"https://api.github.com/repos/koding/koding/assignees{/user}","branches_url":"https://api.github.com/repos/koding/koding/branches{/branch}","tags_url":"https://api.github.com/repos/koding/koding/tags","blobs_url":"https://api.github.com/repos/koding/koding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koding/koding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koding/koding/git/refs{/sha}","trees_url":"https://api.github.com/repos/koding/koding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koding/koding/statuses/{sha}","languages_url":"https://api.github.com/repos/koding/koding/languages","stargazers_url":"https://api.github.com/repos/koding/koding/stargazers","contributors_url":"https://api.github.com/repos/koding/koding/contributors","subscribers_url":"https://api.github.com/repos/koding/koding/subscribers","subscription_url":"https://api.github.com/repos/koding/koding/subscription","commits_url":"https://api.github.com/repos/koding/koding/commits{/sha}","git_commits_url":"https://api.github.com/repos/koding/koding/git/commits{/sha}","comments_url":"https://api.github.com/repos/koding/koding/comments{/number}","issue_comment_url":"https://api.github.com/repos/koding/koding/issues/comments{/number}","contents_url":"https://api.github.com/repos/koding/koding/contents/{+path}","compare_url":"https://api.github.com/repos/koding/koding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koding/koding/merges","archive_url":"https://api.github.com/repos/koding/koding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koding/koding/downloads","issues_url":"https://api.github.com/repos/koding/koding/issues{/number}","pulls_url":"https://api.github.com/repos/koding/koding/pulls{/number}","milestones_url":"https://api.github.com/repos/koding/koding/milestones{/number}","notifications_url":"https://api.github.com/repos/koding/koding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koding/koding/labels{/name}","releases_url":"https://api.github.com/repos/koding/koding/releases{/id}","deployments_url":"https://api.github.com/repos/koding/koding/deployments","created_at":"2014-06-29T05:46:24Z","updated_at":"2016-09-20T20:36:34Z","pushed_at":"2016-09-20T20:09:24Z","git_url":"git://github.com/koding/koding.git","ssh_url":"git@github.com:koding/koding.git","clone_url":"https://github.com/koding/koding.git","svn_url":"https://github.com/koding/koding","homepage":"https://www.koding.com","size":614940,"stargazers_count":421,"watchers_count":421,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":151,"forks":41,"open_issues":151,"watchers":421,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/koding/koding/pulls/9069"},"html":{"href":"https://github.com/koding/koding/pull/9069"},"issue":{"href":"https://api.github.com/repos/koding/koding/issues/9069"},"comments":{"href":"https://api.github.com/repos/koding/koding/issues/9069/comments"},"review_comments":{"href":"https://api.github.com/repos/koding/koding/pulls/9069/comments"},"review_comment":{"href":"https://api.github.com/repos/koding/koding/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/koding/koding/pulls/9069/commits"},"statuses":{"href":"https://api.github.com/repos/koding/koding/statuses/75af45e24ceea768f966094c79c5220888a4b63f"}}}}
{"actor":{"display_login":"usirin"}}