{"action":"created","comment":{"url":"https://api.github.com/repos/gengo/goship/pulls/comments/52708104","id":52708104,"diff_hunk":"@@ -143,21 +173,78 @@\n         'X-TrackerToken': pt_token\n       },\n       success: function(data) {\n-        // Find all git commit messages\n-        var list = data.filter(function(obj) {\n-          return obj.commit_type;\n-        });\n-        // Find repo name from comment body text\n-        list = list.map(function(item) {\n-          return item.text.split('https://github.com/gengo/')[1].split('/commit/')[0];\n+        var PULL_REQUEST_REGEX = /Merge pull request/;\n+        var COMMIT_REPO_REGEX = /https:\\/\\/github.com\\/gengo\\/(.+)\\/commit\\//;\n+        var DEPLOY_REPO_REGEX = new RegExp('Deployed (.+) to '+ config.environment +': ');\n+\n+        var activities = data.filter(function(activity) {\n+          return activity.commit_type === 'github' || DEPLOY_REPO_REGEX.test(activity.text);\n+        }).reverse();\n+\n+        var activitiesGrouped = groupBy(activities, function(activity) {\n+          // With commit message\n+          if (COMMIT_REPO_REGEX.test(activity.text)) {\n+            return activity.text.match(COMMIT_REPO_REGEX)[1];\n+          }\n+          // Deployed message\n+          if (DEPLOY_REPO_REGEX.test(activity.text)) {\n+            return activity.text.match(DEPLOY_REPO_REGEX)[1];\n+          }\n         });\n \n-        callback(removeDupesFromArray(list));\n+        var inProgress = [];\n+        var deployed = [];\n+        var notDeployed = [];\n+        for (key in activitiesGrouped) {\n+          var activity = activitiesGrouped[key][0];\n+\n+          // Merged repo\n+          if (PULL_REQUEST_REGEX.test(activity.text)) {\n+            notDeployed.push(activity.text.match(COMMIT_REPO_REGEX)[1]);\n+          }\n+          // In Progress repo\n+          else if (COMMIT_REPO_REGEX.test(activity.text)) {\n+            inProgress.push(activity.text.match(COMMIT_REPO_REGEX)[1]);\n+          }\n+          // Deployed repo\n+          if (DEPLOY_REPO_REGEX.test(activity.text)) {\n+            deployed.push(activity.text.match(DEPLOY_REPO_REGEX)[1]);\n+          }\n+        }\n+\n+        callback({\n+          'all': inProgress.concat(notDeployed, deployed),\n+          'in_progress': inProgress,\n+          'not_deployed': notDeployed,\n+          'deployed': deployed\n+        });\n       }\n     });\n   }\n \n   /**\n+   * getPopoverHTML return a HTML string\n+   * @param  {Array} list Array of strings\n+   * @return {String}     HTML text string\n+   */\n+  function getPopoverHTML(dependencies) {\n+    // In progress","path":"static/js/pivotal.js","position":null,"original_position":110,"commit_id":"e604c1463ea59f78e3edbf181795af00b1c17c26","original_commit_id":"8c501c5efcf77bf3d00f13b76fcbd5b85fd5318f","user":{"login":"marexandre","id":228359,"avatar_url":"https://avatars.githubusercontent.com/u/228359?v=3","gravatar_id":"","url":"https://api.github.com/users/marexandre","html_url":"https://github.com/marexandre","followers_url":"https://api.github.com/users/marexandre/followers","following_url":"https://api.github.com/users/marexandre/following{/other_user}","gists_url":"https://api.github.com/users/marexandre/gists{/gist_id}","starred_url":"https://api.github.com/users/marexandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marexandre/subscriptions","organizations_url":"https://api.github.com/users/marexandre/orgs","repos_url":"https://api.github.com/users/marexandre/repos","events_url":"https://api.github.com/users/marexandre/events{/privacy}","received_events_url":"https://api.github.com/users/marexandre/received_events","type":"User","site_admin":false},"body":"True, some how was lazy to use longer names for variables... will update the code with proper variables names :)","created_at":"2016-02-12T05:59:55Z","updated_at":"2016-02-12T05:59:55Z","html_url":"https://github.com/gengo/goship/pull/184#discussion_r52708104","pull_request_url":"https://api.github.com/repos/gengo/goship/pulls/184","_links":{"self":{"href":"https://api.github.com/repos/gengo/goship/pulls/comments/52708104"},"html":{"href":"https://github.com/gengo/goship/pull/184#discussion_r52708104"},"pull_request":{"href":"https://api.github.com/repos/gengo/goship/pulls/184"}}},"pull_request":{"url":"https://api.github.com/repos/gengo/goship/pulls/184","id":58861218,"html_url":"https://github.com/gengo/goship/pull/184","diff_url":"https://github.com/gengo/goship/pull/184.diff","patch_url":"https://github.com/gengo/goship/pull/184.patch","issue_url":"https://api.github.com/repos/gengo/goship/issues/184","number":184,"state":"open","locked":false,"title":"Improve logic for showing dependency list: in progress, merged, deployed","user":{"login":"marexandre","id":228359,"avatar_url":"https://avatars.githubusercontent.com/u/228359?v=3","gravatar_id":"","url":"https://api.github.com/users/marexandre","html_url":"https://github.com/marexandre","followers_url":"https://api.github.com/users/marexandre/followers","following_url":"https://api.github.com/users/marexandre/following{/other_user}","gists_url":"https://api.github.com/users/marexandre/gists{/gist_id}","starred_url":"https://api.github.com/users/marexandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marexandre/subscriptions","organizations_url":"https://api.github.com/users/marexandre/orgs","repos_url":"https://api.github.com/users/marexandre/repos","events_url":"https://api.github.com/users/marexandre/events{/privacy}","received_events_url":"https://api.github.com/users/marexandre/received_events","type":"User","site_admin":false},"body":"![screen shot 2016-02-10 at 5 40 54 pm](https://cloud.githubusercontent.com/assets/228359/12942387/f81a4370-d01d-11e5-8ced-8105d90526a5.png)\r\n\r\n`Gray`: repo has commits\r\n`Green`: ready to deploy, changes were merged into master but not deployed\r\n`Strikethrough`: deployed","created_at":"2016-02-10T08:45:11Z","updated_at":"2016-02-12T05:59:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd968f9b15966383a59b049ad8f7c46a97ff51b9","assignee":{"login":"toshipon","id":60810,"avatar_url":"https://avatars.githubusercontent.com/u/60810?v=3","gravatar_id":"","url":"https://api.github.com/users/toshipon","html_url":"https://github.com/toshipon","followers_url":"https://api.github.com/users/toshipon/followers","following_url":"https://api.github.com/users/toshipon/following{/other_user}","gists_url":"https://api.github.com/users/toshipon/gists{/gist_id}","starred_url":"https://api.github.com/users/toshipon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshipon/subscriptions","organizations_url":"https://api.github.com/users/toshipon/orgs","repos_url":"https://api.github.com/users/toshipon/repos","events_url":"https://api.github.com/users/toshipon/events{/privacy}","received_events_url":"https://api.github.com/users/toshipon/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/gengo/goship/pulls/184/commits","review_comments_url":"https://api.github.com/repos/gengo/goship/pulls/184/comments","review_comment_url":"https://api.github.com/repos/gengo/goship/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gengo/goship/issues/184/comments","statuses_url":"https://api.github.com/repos/gengo/goship/statuses/e604c1463ea59f78e3edbf181795af00b1c17c26","head":{"label":"gengo:show-dependency-count-for-projects","ref":"show-dependency-count-for-projects","sha":"e604c1463ea59f78e3edbf181795af00b1c17c26","user":{"login":"gengo","id":1681251,"avatar_url":"https://avatars.githubusercontent.com/u/1681251?v=3","gravatar_id":"","url":"https://api.github.com/users/gengo","html_url":"https://github.com/gengo","followers_url":"https://api.github.com/users/gengo/followers","following_url":"https://api.github.com/users/gengo/following{/other_user}","gists_url":"https://api.github.com/users/gengo/gists{/gist_id}","starred_url":"https://api.github.com/users/gengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gengo/subscriptions","organizations_url":"https://api.github.com/users/gengo/orgs","repos_url":"https://api.github.com/users/gengo/repos","events_url":"https://api.github.com/users/gengo/events{/privacy}","received_events_url":"https://api.github.com/users/gengo/received_events","type":"Organization","site_admin":false},"repo":{"id":12479555,"name":"goship","full_name":"gengo/goship","owner":{"login":"gengo","id":1681251,"avatar_url":"https://avatars.githubusercontent.com/u/1681251?v=3","gravatar_id":"","url":"https://api.github.com/users/gengo","html_url":"https://github.com/gengo","followers_url":"https://api.github.com/users/gengo/followers","following_url":"https://api.github.com/users/gengo/following{/other_user}","gists_url":"https://api.github.com/users/gengo/gists{/gist_id}","starred_url":"https://api.github.com/users/gengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gengo/subscriptions","organizations_url":"https://api.github.com/users/gengo/orgs","repos_url":"https://api.github.com/users/gengo/repos","events_url":"https://api.github.com/users/gengo/events{/privacy}","received_events_url":"https://api.github.com/users/gengo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gengo/goship","description":"A simple tool for deploying code to servers.","fork":false,"url":"https://api.github.com/repos/gengo/goship","forks_url":"https://api.github.com/repos/gengo/goship/forks","keys_url":"https://api.github.com/repos/gengo/goship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gengo/goship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gengo/goship/teams","hooks_url":"https://api.github.com/repos/gengo/goship/hooks","issue_events_url":"https://api.github.com/repos/gengo/goship/issues/events{/number}","events_url":"https://api.github.com/repos/gengo/goship/events","assignees_url":"https://api.github.com/repos/gengo/goship/assignees{/user}","branches_url":"https://api.github.com/repos/gengo/goship/branches{/branch}","tags_url":"https://api.github.com/repos/gengo/goship/tags","blobs_url":"https://api.github.com/repos/gengo/goship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gengo/goship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gengo/goship/git/refs{/sha}","trees_url":"https://api.github.com/repos/gengo/goship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gengo/goship/statuses/{sha}","languages_url":"https://api.github.com/repos/gengo/goship/languages","stargazers_url":"https://api.github.com/repos/gengo/goship/stargazers","contributors_url":"https://api.github.com/repos/gengo/goship/contributors","subscribers_url":"https://api.github.com/repos/gengo/goship/subscribers","subscription_url":"https://api.github.com/repos/gengo/goship/subscription","commits_url":"https://api.github.com/repos/gengo/goship/commits{/sha}","git_commits_url":"https://api.github.com/repos/gengo/goship/git/commits{/sha}","comments_url":"https://api.github.com/repos/gengo/goship/comments{/number}","issue_comment_url":"https://api.github.com/repos/gengo/goship/issues/comments{/number}","contents_url":"https://api.github.com/repos/gengo/goship/contents/{+path}","compare_url":"https://api.github.com/repos/gengo/goship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gengo/goship/merges","archive_url":"https://api.github.com/repos/gengo/goship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gengo/goship/downloads","issues_url":"https://api.github.com/repos/gengo/goship/issues{/number}","pulls_url":"https://api.github.com/repos/gengo/goship/pulls{/number}","milestones_url":"https://api.github.com/repos/gengo/goship/milestones{/number}","notifications_url":"https://api.github.com/repos/gengo/goship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gengo/goship/labels{/name}","releases_url":"https://api.github.com/repos/gengo/goship/releases{/id}","deployments_url":"https://api.github.com/repos/gengo/goship/deployments","created_at":"2013-08-30T06:20:15Z","updated_at":"2016-02-02T09:27:02Z","pushed_at":"2016-02-12T05:58:03Z","git_url":"git://github.com/gengo/goship.git","ssh_url":"git@github.com:gengo/goship.git","clone_url":"https://github.com/gengo/goship.git","svn_url":"https://github.com/gengo/goship","homepage":"","size":2597,"stargazers_count":432,"watchers_count":432,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":8,"forks":25,"open_issues":8,"watchers":432,"default_branch":"master"}},"base":{"label":"gengo:master","ref":"master","sha":"4061a71b7d1db94f372c7755c43a9039c35e40f1","user":{"login":"gengo","id":1681251,"avatar_url":"https://avatars.githubusercontent.com/u/1681251?v=3","gravatar_id":"","url":"https://api.github.com/users/gengo","html_url":"https://github.com/gengo","followers_url":"https://api.github.com/users/gengo/followers","following_url":"https://api.github.com/users/gengo/following{/other_user}","gists_url":"https://api.github.com/users/gengo/gists{/gist_id}","starred_url":"https://api.github.com/users/gengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gengo/subscriptions","organizations_url":"https://api.github.com/users/gengo/orgs","repos_url":"https://api.github.com/users/gengo/repos","events_url":"https://api.github.com/users/gengo/events{/privacy}","received_events_url":"https://api.github.com/users/gengo/received_events","type":"Organization","site_admin":false},"repo":{"id":12479555,"name":"goship","full_name":"gengo/goship","owner":{"login":"gengo","id":1681251,"avatar_url":"https://avatars.githubusercontent.com/u/1681251?v=3","gravatar_id":"","url":"https://api.github.com/users/gengo","html_url":"https://github.com/gengo","followers_url":"https://api.github.com/users/gengo/followers","following_url":"https://api.github.com/users/gengo/following{/other_user}","gists_url":"https://api.github.com/users/gengo/gists{/gist_id}","starred_url":"https://api.github.com/users/gengo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gengo/subscriptions","organizations_url":"https://api.github.com/users/gengo/orgs","repos_url":"https://api.github.com/users/gengo/repos","events_url":"https://api.github.com/users/gengo/events{/privacy}","received_events_url":"https://api.github.com/users/gengo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gengo/goship","description":"A simple tool for deploying code to servers.","fork":false,"url":"https://api.github.com/repos/gengo/goship","forks_url":"https://api.github.com/repos/gengo/goship/forks","keys_url":"https://api.github.com/repos/gengo/goship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gengo/goship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gengo/goship/teams","hooks_url":"https://api.github.com/repos/gengo/goship/hooks","issue_events_url":"https://api.github.com/repos/gengo/goship/issues/events{/number}","events_url":"https://api.github.com/repos/gengo/goship/events","assignees_url":"https://api.github.com/repos/gengo/goship/assignees{/user}","branches_url":"https://api.github.com/repos/gengo/goship/branches{/branch}","tags_url":"https://api.github.com/repos/gengo/goship/tags","blobs_url":"https://api.github.com/repos/gengo/goship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gengo/goship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gengo/goship/git/refs{/sha}","trees_url":"https://api.github.com/repos/gengo/goship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gengo/goship/statuses/{sha}","languages_url":"https://api.github.com/repos/gengo/goship/languages","stargazers_url":"https://api.github.com/repos/gengo/goship/stargazers","contributors_url":"https://api.github.com/repos/gengo/goship/contributors","subscribers_url":"https://api.github.com/repos/gengo/goship/subscribers","subscription_url":"https://api.github.com/repos/gengo/goship/subscription","commits_url":"https://api.github.com/repos/gengo/goship/commits{/sha}","git_commits_url":"https://api.github.com/repos/gengo/goship/git/commits{/sha}","comments_url":"https://api.github.com/repos/gengo/goship/comments{/number}","issue_comment_url":"https://api.github.com/repos/gengo/goship/issues/comments{/number}","contents_url":"https://api.github.com/repos/gengo/goship/contents/{+path}","compare_url":"https://api.github.com/repos/gengo/goship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gengo/goship/merges","archive_url":"https://api.github.com/repos/gengo/goship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gengo/goship/downloads","issues_url":"https://api.github.com/repos/gengo/goship/issues{/number}","pulls_url":"https://api.github.com/repos/gengo/goship/pulls{/number}","milestones_url":"https://api.github.com/repos/gengo/goship/milestones{/number}","notifications_url":"https://api.github.com/repos/gengo/goship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gengo/goship/labels{/name}","releases_url":"https://api.github.com/repos/gengo/goship/releases{/id}","deployments_url":"https://api.github.com/repos/gengo/goship/deployments","created_at":"2013-08-30T06:20:15Z","updated_at":"2016-02-02T09:27:02Z","pushed_at":"2016-02-12T05:58:03Z","git_url":"git://github.com/gengo/goship.git","ssh_url":"git@github.com:gengo/goship.git","clone_url":"https://github.com/gengo/goship.git","svn_url":"https://github.com/gengo/goship","homepage":"","size":2597,"stargazers_count":432,"watchers_count":432,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":8,"forks":25,"open_issues":8,"watchers":432,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gengo/goship/pulls/184"},"html":{"href":"https://github.com/gengo/goship/pull/184"},"issue":{"href":"https://api.github.com/repos/gengo/goship/issues/184"},"comments":{"href":"https://api.github.com/repos/gengo/goship/issues/184/comments"},"review_comments":{"href":"https://api.github.com/repos/gengo/goship/pulls/184/comments"},"review_comment":{"href":"https://api.github.com/repos/gengo/goship/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gengo/goship/pulls/184/commits"},"statuses":{"href":"https://api.github.com/repos/gengo/goship/statuses/e604c1463ea59f78e3edbf181795af00b1c17c26"}}}}