{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleChrome/confluence/pulls/comments/110924800","pull_request_review_id":32131138,"id":110924800,"diff_hunk":"@@ -0,0 +1,144 @@\n+// Copyright 2017 The Chromium Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style license that can be\n+// found in the LICENSE file.\n+'use strict';\n+\n+require('./aggressive_removal_data.es6.js');\n+\n+foam.CLASS({\n+  package: 'org.chromium.apis.web',\n+  name: 'AggressiveRemoval',\n+  extends: 'org.chromium.apis.web.MetricComputer',\n+  documentation: `AggressiveRemoval is a class that computes the aggressive\n+    removal metrics from browserApiDAO. It shows the number of APIs\n+    that is removed in this browser at least 2 years ago but still exits in\n+    other browsers.`,\n+  requires: [\n+    'org.chromium.apis.web.Browser',\n+    'org.chromium.apis.web.WebInterface',\n+    'org.chromium.apis.web.BrowserWebInterfaceJunction',\n+    'org.chromium.apis.web.AggressiveRemovalData',\n+    'foam.mlang.ExpressionsSingleton',\n+    'foam.dao.ArraySink',\n+    'foam.dao.EasyDAO',\n+  ],\n+  properties: [\n+    {\n+      name: 'aggressiveRemovalDAO',\n+      documentation: `This is a DAO that contains AggressiveRemovalData.`,\n+      final: true,\n+      factory: function() {\n+        return this.EasyDAO.create({\n+          name: 'aggressiveRemovalDAO',\n+          of: this.AggressiveRemovalData,\n+          daoType: 'MDAO',\n+        });\n+      },\n+    },\n+  ],\n+  methods: [\n+    {\n+      name: 'compute',\n+      documentation: `Compute aggressive removal value for each browser in\n+           browsers at the given date.`,\n+      args: [\n+        {\n+          name: 'browsers',\n+          typeName: 'Array of Browser',\n+          documentation: `An array of brwsers. These browser are either\n+              released at given date, or it is the most recent release\n+              before given date.`,\n+        },\n+        {\n+          name: 'date',\n+          typeName: 'Date',\n+          documentation: `The aggressive removal value will be calculated at\n+              given date.`,\n+        },\n+      ],\n+      code: function(browsers, date) {\n+        for (let i = 0; i < browsers.length; i++) {\n+          let browser = browsers[i];\n+          let year = date.getFullYear();\n+          let month = date.getMonth();\n+          let day = date.getDate();\n+          let oneYearAgo = new Date(year - 1, month, day);\n+          let browserKeys = browsers.map((browser) => browser.browserKey);\n+          let selectBrowsers = [\n+            this.browserDAO.where(this.mlang.AND(\n+              this.mlang.IN(this.Browser.BROWSER_KEY, browserKeys),\n+              this.mlang.NEQ(this.Browser.BROWSER_NAME, browser.browserName)))\n+            .select(),\n+            this.browserDAO.where(this.mlang.AND(\n+              this.mlang.EQ(this.Browser.BROWSER_NAME, browser.browserName),\n+              this.mlang.EQ(this.Browser.OS_NAME, browser.osName),\n+              this.mlang.LT(this.Browser.RELEASE_DATE, oneYearAgo)))\n+            .select()];\n+          Promise.all(selectBrowsers).then((result) => {\n+            let currBrowsers = result[0].a;\n+            let prevReleaseBrowsers = result[1].a;\n+            // Return if there is insufficient of historical data.\n+            if (prevReleaseBrowsers.length < 2) return;","path":"lib/confluence/aggressive_removal.es6.js","position":81,"original_position":81,"commit_id":"40f3f0c0f1e06701f1570002030320f87a10c61c","original_commit_id":"40f3f0c0f1e06701f1570002030320f87a10c61c","user":{"login":"jingt06","id":9008746,"avatar_url":"https://avatars0.githubusercontent.com/u/9008746?v=3","gravatar_id":"","url":"https://api.github.com/users/jingt06","html_url":"https://github.com/jingt06","followers_url":"https://api.github.com/users/jingt06/followers","following_url":"https://api.github.com/users/jingt06/following{/other_user}","gists_url":"https://api.github.com/users/jingt06/gists{/gist_id}","starred_url":"https://api.github.com/users/jingt06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jingt06/subscriptions","organizations_url":"https://api.github.com/users/jingt06/orgs","repos_url":"https://api.github.com/users/jingt06/repos","events_url":"https://api.github.com/users/jingt06/events{/privacy}","received_events_url":"https://api.github.com/users/jingt06/received_events","type":"User","site_admin":false},"body":"There is no way to get aggressive-removal data if we only have less than two version's object graph.","created_at":"2017-04-11T14:56:18Z","updated_at":"2017-04-11T14:56:19Z","html_url":"https://github.com/GoogleChrome/confluence/pull/33#discussion_r110924800","pull_request_url":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/confluence/pulls/comments/110924800"},"html":{"href":"https://github.com/GoogleChrome/confluence/pull/33#discussion_r110924800"},"pull_request":{"href":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33","id":115186278,"html_url":"https://github.com/GoogleChrome/confluence/pull/33","diff_url":"https://github.com/GoogleChrome/confluence/pull/33.diff","patch_url":"https://github.com/GoogleChrome/confluence/pull/33.patch","issue_url":"https://api.github.com/repos/GoogleChrome/confluence/issues/33","number":33,"state":"open","locked":false,"title":"UI, charts and computation for API confluence.","user":{"login":"jingt06","id":9008746,"avatar_url":"https://avatars0.githubusercontent.com/u/9008746?v=3","gravatar_id":"","url":"https://api.github.com/users/jingt06","html_url":"https://github.com/jingt06","followers_url":"https://api.github.com/users/jingt06/followers","following_url":"https://api.github.com/users/jingt06/following{/other_user}","gists_url":"https://api.github.com/users/jingt06/gists{/gist_id}","starred_url":"https://api.github.com/users/jingt06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jingt06/subscriptions","organizations_url":"https://api.github.com/users/jingt06/orgs","repos_url":"https://api.github.com/users/jingt06/repos","events_url":"https://api.github.com/users/jingt06/events{/privacy}","received_events_url":"https://api.github.com/users/jingt06/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-04-10T20:34:07Z","updated_at":"2017-04-11T14:56:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a0faac08f0084033592a872ad790187b7d9cf65","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33/commits","review_comments_url":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33/comments","review_comment_url":"https://api.github.com/repos/GoogleChrome/confluence/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleChrome/confluence/issues/33/comments","statuses_url":"https://api.github.com/repos/GoogleChrome/confluence/statuses/40f3f0c0f1e06701f1570002030320f87a10c61c","head":{"label":"jingt06:confluence","ref":"confluence","sha":"40f3f0c0f1e06701f1570002030320f87a10c61c","user":{"login":"jingt06","id":9008746,"avatar_url":"https://avatars0.githubusercontent.com/u/9008746?v=3","gravatar_id":"","url":"https://api.github.com/users/jingt06","html_url":"https://github.com/jingt06","followers_url":"https://api.github.com/users/jingt06/followers","following_url":"https://api.github.com/users/jingt06/following{/other_user}","gists_url":"https://api.github.com/users/jingt06/gists{/gist_id}","starred_url":"https://api.github.com/users/jingt06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jingt06/subscriptions","organizations_url":"https://api.github.com/users/jingt06/orgs","repos_url":"https://api.github.com/users/jingt06/repos","events_url":"https://api.github.com/users/jingt06/events{/privacy}","received_events_url":"https://api.github.com/users/jingt06/received_events","type":"User","site_admin":false},"repo":{"id":82972907,"name":"confluence","full_name":"jingt06/confluence","owner":{"login":"jingt06","id":9008746,"avatar_url":"https://avatars0.githubusercontent.com/u/9008746?v=3","gravatar_id":"","url":"https://api.github.com/users/jingt06","html_url":"https://github.com/jingt06","followers_url":"https://api.github.com/users/jingt06/followers","following_url":"https://api.github.com/users/jingt06/following{/other_user}","gists_url":"https://api.github.com/users/jingt06/gists{/gist_id}","starred_url":"https://api.github.com/users/jingt06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jingt06/subscriptions","organizations_url":"https://api.github.com/users/jingt06/orgs","repos_url":"https://api.github.com/users/jingt06/repos","events_url":"https://api.github.com/users/jingt06/events{/privacy}","received_events_url":"https://api.github.com/users/jingt06/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jingt06/confluence","description":null,"fork":true,"url":"https://api.github.com/repos/jingt06/confluence","forks_url":"https://api.github.com/repos/jingt06/confluence/forks","keys_url":"https://api.github.com/repos/jingt06/confluence/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jingt06/confluence/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jingt06/confluence/teams","hooks_url":"https://api.github.com/repos/jingt06/confluence/hooks","issue_events_url":"https://api.github.com/repos/jingt06/confluence/issues/events{/number}","events_url":"https://api.github.com/repos/jingt06/confluence/events","assignees_url":"https://api.github.com/repos/jingt06/confluence/assignees{/user}","branches_url":"https://api.github.com/repos/jingt06/confluence/branches{/branch}","tags_url":"https://api.github.com/repos/jingt06/confluence/tags","blobs_url":"https://api.github.com/repos/jingt06/confluence/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jingt06/confluence/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jingt06/confluence/git/refs{/sha}","trees_url":"https://api.github.com/repos/jingt06/confluence/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jingt06/confluence/statuses/{sha}","languages_url":"https://api.github.com/repos/jingt06/confluence/languages","stargazers_url":"https://api.github.com/repos/jingt06/confluence/stargazers","contributors_url":"https://api.github.com/repos/jingt06/confluence/contributors","subscribers_url":"https://api.github.com/repos/jingt06/confluence/subscribers","subscription_url":"https://api.github.com/repos/jingt06/confluence/subscription","commits_url":"https://api.github.com/repos/jingt06/confluence/commits{/sha}","git_commits_url":"https://api.github.com/repos/jingt06/confluence/git/commits{/sha}","comments_url":"https://api.github.com/repos/jingt06/confluence/comments{/number}","issue_comment_url":"https://api.github.com/repos/jingt06/confluence/issues/comments{/number}","contents_url":"https://api.github.com/repos/jingt06/confluence/contents/{+path}","compare_url":"https://api.github.com/repos/jingt06/confluence/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jingt06/confluence/merges","archive_url":"https://api.github.com/repos/jingt06/confluence/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jingt06/confluence/downloads","issues_url":"https://api.github.com/repos/jingt06/confluence/issues{/number}","pulls_url":"https://api.github.com/repos/jingt06/confluence/pulls{/number}","milestones_url":"https://api.github.com/repos/jingt06/confluence/milestones{/number}","notifications_url":"https://api.github.com/repos/jingt06/confluence/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jingt06/confluence/labels{/name}","releases_url":"https://api.github.com/repos/jingt06/confluence/releases{/id}","deployments_url":"https://api.github.com/repos/jingt06/confluence/deployments","created_at":"2017-02-23T21:25:37Z","updated_at":"2017-02-23T21:25:39Z","pushed_at":"2017-04-10T20:56:55Z","git_url":"git://github.com/jingt06/confluence.git","ssh_url":"git@github.com:jingt06/confluence.git","clone_url":"https://github.com/jingt06/confluence.git","svn_url":"https://github.com/jingt06/confluence","homepage":null,"size":6918,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleChrome:master","ref":"master","sha":"e9d1664102f17b43e29ca370324992a43b2e780f","user":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars0.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"repo":{"id":82467989,"name":"confluence","full_name":"GoogleChrome/confluence","owner":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars0.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleChrome/confluence","description":null,"fork":false,"url":"https://api.github.com/repos/GoogleChrome/confluence","forks_url":"https://api.github.com/repos/GoogleChrome/confluence/forks","keys_url":"https://api.github.com/repos/GoogleChrome/confluence/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleChrome/confluence/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleChrome/confluence/teams","hooks_url":"https://api.github.com/repos/GoogleChrome/confluence/hooks","issue_events_url":"https://api.github.com/repos/GoogleChrome/confluence/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleChrome/confluence/events","assignees_url":"https://api.github.com/repos/GoogleChrome/confluence/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleChrome/confluence/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleChrome/confluence/tags","blobs_url":"https://api.github.com/repos/GoogleChrome/confluence/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleChrome/confluence/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleChrome/confluence/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleChrome/confluence/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleChrome/confluence/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleChrome/confluence/languages","stargazers_url":"https://api.github.com/repos/GoogleChrome/confluence/stargazers","contributors_url":"https://api.github.com/repos/GoogleChrome/confluence/contributors","subscribers_url":"https://api.github.com/repos/GoogleChrome/confluence/subscribers","subscription_url":"https://api.github.com/repos/GoogleChrome/confluence/subscription","commits_url":"https://api.github.com/repos/GoogleChrome/confluence/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleChrome/confluence/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleChrome/confluence/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleChrome/confluence/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleChrome/confluence/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleChrome/confluence/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleChrome/confluence/merges","archive_url":"https://api.github.com/repos/GoogleChrome/confluence/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleChrome/confluence/downloads","issues_url":"https://api.github.com/repos/GoogleChrome/confluence/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleChrome/confluence/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleChrome/confluence/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleChrome/confluence/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleChrome/confluence/labels{/name}","releases_url":"https://api.github.com/repos/GoogleChrome/confluence/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleChrome/confluence/deployments","created_at":"2017-02-19T15:16:33Z","updated_at":"2017-04-06T19:24:19Z","pushed_at":"2017-04-10T20:56:56Z","git_url":"git://github.com/GoogleChrome/confluence.git","ssh_url":"git@github.com:GoogleChrome/confluence.git","clone_url":"https://github.com/GoogleChrome/confluence.git","svn_url":"https://github.com/GoogleChrome/confluence","homepage":null,"size":2020,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":17,"forks":3,"open_issues":17,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33"},"html":{"href":"https://github.com/GoogleChrome/confluence/pull/33"},"issue":{"href":"https://api.github.com/repos/GoogleChrome/confluence/issues/33"},"comments":{"href":"https://api.github.com/repos/GoogleChrome/confluence/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleChrome/confluence/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleChrome/confluence/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleChrome/confluence/statuses/40f3f0c0f1e06701f1570002030320f87a10c61c"}}}}
{"actor":{"display_login":"jingt06"}}