{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/64437462","id":64437462,"diff_hunk":"@@ -0,0 +1,82 @@\n+/*\n+ * The MIT License\n+ *\n+ * Copyright (c) 2016, Baptiste Mathus\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+package jenkins.model.statistics;\n+\n+import hudson.ExtensionList;\n+import hudson.ExtensionPoint;\n+import hudson.model.Computer;\n+import hudson.model.UsageStatistics;\n+import net.sf.json.JSONObject;\n+\n+import javax.annotation.Nonnull;\n+\n+/**\n+ * <p>\n+ * Extension point to contribute usage statistics to the {@link UsageStatistics} class and associated infrastructure\n+ * (see below).\n+ * </p>\n+ * <p/>\n+ * <p>\n+ * When adding a new implementation:\n+ * </p>\n+ * <ul>\n+ * <li>You'll have to document the requirement at the\n+ * <a href=\"https://github.com/jenkinsci/infra-statistics\">infra-statistics</a> project so that your data can be\n+ * processed ;</li>\n+ * <li><strong>WARNING:</strong> Because there can be security/privacy implications, before adding a new implementation\n+ * of this extension point in your plugin, it is <strong>strongly recommended</strong> to get your code reviewed by the\n+ * community in general, and by the","path":"core/src/main/java/jenkins/model/statistics/UsageStatisticsContributor.java","position":49,"original_position":49,"commit_id":"913785fa624a2147ef7abd55704030a9bf803bc7","original_commit_id":"913785fa624a2147ef7abd55704030a9bf803bc7","user":{"login":"daniel-beck","id":1831569,"avatar_url":"https://avatars.githubusercontent.com/u/1831569?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-beck","html_url":"https://github.com/daniel-beck","followers_url":"https://api.github.com/users/daniel-beck/followers","following_url":"https://api.github.com/users/daniel-beck/following{/other_user}","gists_url":"https://api.github.com/users/daniel-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-beck/subscriptions","organizations_url":"https://api.github.com/users/daniel-beck/orgs","repos_url":"https://api.github.com/users/daniel-beck/repos","events_url":"https://api.github.com/users/daniel-beck/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-beck/received_events","type":"User","site_admin":false},"body":"Maybe a useful process would be to only accept core changes once the `infra-statistics` change is in, and _that_ is the closely reviewed one?","created_at":"2016-05-24T17:27:47Z","updated_at":"2016-05-24T17:27:47Z","html_url":"https://github.com/jenkinsci/jenkins/pull/1985#discussion_r64437462","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/64437462"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1985#discussion_r64437462"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985","id":56265654,"html_url":"https://github.com/jenkinsci/jenkins/pull/1985","diff_url":"https://github.com/jenkinsci/jenkins/pull/1985.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/1985.patch","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1985","number":1985,"state":"open","locked":false,"title":"[FIX JENKINS-32485] New extension point for contributing usage statistics / preparatory for JENKINS-26466","user":{"login":"batmat","id":223853,"avatar_url":"https://avatars.githubusercontent.com/u/223853?v=3","gravatar_id":"","url":"https://api.github.com/users/batmat","html_url":"https://github.com/batmat","followers_url":"https://api.github.com/users/batmat/followers","following_url":"https://api.github.com/users/batmat/following{/other_user}","gists_url":"https://api.github.com/users/batmat/gists{/gist_id}","starred_url":"https://api.github.com/users/batmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batmat/subscriptions","organizations_url":"https://api.github.com/users/batmat/orgs","repos_url":"https://api.github.com/users/batmat/repos","events_url":"https://api.github.com/users/batmat/events{/privacy}","received_events_url":"https://api.github.com/users/batmat/received_events","type":"User","site_admin":false},"body":"This pull request introduces [a new feature/JENKINS-32485](https://issues.jenkins-ci.org/browse/JENKINS-32485): now the UsageStatistics class doesn't know the stats it's going to send anymore.\r\n\r\nIt delegates to a new UsageStatisticsContributor extension point, and iterates through the implementations to find what to send.\r\n\r\n----\r\n\r\nThis PR also includes the refactoring for the coupling between UsageStatistics and ArchitectureMonitor (preparatory for [JENKINS-26466](https://issues.jenkins-ci.org/browse/JENKINS-26466)). \r\n\r\nI hesitated to include it in another PR, but finally thought it would be good to:\r\n* illustrate what it would be useful for directly here (i.e. breaking some undesirable relationships between some classes in this case). \r\n* And also proving that it actually enables it through a concrete usage and I haven't missed something to make it usable.\r\n\r\nThanks for your feedback. Thanks to @jglick for his help on the design.\r\n\r\nPing @jenkinsci/code-reviewers ","created_at":"2016-01-16T23:18:37Z","updated_at":"2016-05-24T17:27:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fcd030b48a59aabc47d5a85d100c89bfac631690","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1985/comments","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/913785fa624a2147ef7abd55704030a9bf803bc7","head":{"label":"batmat:JENKINS-32485+JENKINS-26466-decouple-UsageStatistics-from-ArchitectureMonitor","ref":"JENKINS-32485+JENKINS-26466-decouple-UsageStatistics-from-ArchitectureMonitor","sha":"913785fa624a2147ef7abd55704030a9bf803bc7","user":{"login":"batmat","id":223853,"avatar_url":"https://avatars.githubusercontent.com/u/223853?v=3","gravatar_id":"","url":"https://api.github.com/users/batmat","html_url":"https://github.com/batmat","followers_url":"https://api.github.com/users/batmat/followers","following_url":"https://api.github.com/users/batmat/following{/other_user}","gists_url":"https://api.github.com/users/batmat/gists{/gist_id}","starred_url":"https://api.github.com/users/batmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batmat/subscriptions","organizations_url":"https://api.github.com/users/batmat/orgs","repos_url":"https://api.github.com/users/batmat/repos","events_url":"https://api.github.com/users/batmat/events{/privacy}","received_events_url":"https://api.github.com/users/batmat/received_events","type":"User","site_admin":false},"repo":{"id":1334400,"name":"jenkins","full_name":"batmat/jenkins","owner":{"login":"batmat","id":223853,"avatar_url":"https://avatars.githubusercontent.com/u/223853?v=3","gravatar_id":"","url":"https://api.github.com/users/batmat","html_url":"https://github.com/batmat","followers_url":"https://api.github.com/users/batmat/followers","following_url":"https://api.github.com/users/batmat/following{/other_user}","gists_url":"https://api.github.com/users/batmat/gists{/gist_id}","starred_url":"https://api.github.com/users/batmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batmat/subscriptions","organizations_url":"https://api.github.com/users/batmat/orgs","repos_url":"https://api.github.com/users/batmat/repos","events_url":"https://api.github.com/users/batmat/events{/privacy}","received_events_url":"https://api.github.com/users/batmat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/batmat/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/batmat/jenkins","forks_url":"https://api.github.com/repos/batmat/jenkins/forks","keys_url":"https://api.github.com/repos/batmat/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/batmat/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/batmat/jenkins/teams","hooks_url":"https://api.github.com/repos/batmat/jenkins/hooks","issue_events_url":"https://api.github.com/repos/batmat/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/batmat/jenkins/events","assignees_url":"https://api.github.com/repos/batmat/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/batmat/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/batmat/jenkins/tags","blobs_url":"https://api.github.com/repos/batmat/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/batmat/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/batmat/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/batmat/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/batmat/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/batmat/jenkins/languages","stargazers_url":"https://api.github.com/repos/batmat/jenkins/stargazers","contributors_url":"https://api.github.com/repos/batmat/jenkins/contributors","subscribers_url":"https://api.github.com/repos/batmat/jenkins/subscribers","subscription_url":"https://api.github.com/repos/batmat/jenkins/subscription","commits_url":"https://api.github.com/repos/batmat/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/batmat/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/batmat/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/batmat/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/batmat/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/batmat/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/batmat/jenkins/merges","archive_url":"https://api.github.com/repos/batmat/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/batmat/jenkins/downloads","issues_url":"https://api.github.com/repos/batmat/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/batmat/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/batmat/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/batmat/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/batmat/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/batmat/jenkins/releases{/id}","deployments_url":"https://api.github.com/repos/batmat/jenkins/deployments","created_at":"2011-02-06T13:58:36Z","updated_at":"2016-01-09T13:59:45Z","pushed_at":"2016-05-22T20:28:12Z","git_url":"git://github.com/batmat/jenkins.git","ssh_url":"git@github.com:batmat/jenkins.git","clone_url":"https://github.com/batmat/jenkins.git","svn_url":"https://github.com/batmat/jenkins","homepage":"http://jenkins-ci.org/","size":90237,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"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":1,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"67597a7c91ea90dab5b28d17ab2e9a3f9d6439a6","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1103607,"name":"jenkins","full_name":"jenkinsci/jenkins","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/jenkinsci/jenkins","forks_url":"https://api.github.com/repos/jenkinsci/jenkins/forks","keys_url":"https://api.github.com/repos/jenkinsci/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/jenkins/teams","hooks_url":"https://api.github.com/repos/jenkinsci/jenkins/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/jenkins/events","assignees_url":"https://api.github.com/repos/jenkinsci/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/jenkins/tags","blobs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/jenkins/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/jenkins/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/jenkins/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/jenkins/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/jenkins/subscription","commits_url":"https://api.github.com/repos/jenkinsci/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/jenkins/merges","archive_url":"https://api.github.com/repos/jenkinsci/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/jenkins/downloads","issues_url":"https://api.github.com/repos/jenkinsci/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/jenkins/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/jenkins/deployments","created_at":"2010-11-22T21:21:23Z","updated_at":"2016-05-24T15:50:04Z","pushed_at":"2016-05-24T16:59:27Z","git_url":"git://github.com/jenkinsci/jenkins.git","ssh_url":"git@github.com:jenkinsci/jenkins.git","clone_url":"https://github.com/jenkinsci/jenkins.git","svn_url":"https://github.com/jenkinsci/jenkins","homepage":"http://jenkins-ci.org/","size":138458,"stargazers_count":5884,"watchers_count":5884,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2531,"mirror_url":null,"open_issues_count":116,"forks":2531,"open_issues":116,"watchers":5884,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1985"},"issue":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1985"},"comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1985/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1985/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/jenkins/statuses/913785fa624a2147ef7abd55704030a9bf803bc7"}}}}
{"actor":{"display_login":"daniel-beck"}}