{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/79036125","id":79036125,"diff_hunk":"@@ -0,0 +1,40 @@\n+import { cleanVersion, versionSatisfies } from '../../utils/version';\n+import { get } from 'lodash';\n+\n+function compatibleWithKibana(kbnServer, pluginVersion) {\n+  //core plugins have a version of 'kibana' and are always compatible\n+  if (pluginVersion === 'kibana') return true;\n+\n+  const cleanPluginVersion = cleanVersion(pluginVersion);\n+  const kibanaVersion = cleanVersion(kbnServer.version);\n+\n+  return versionSatisfies(cleanPluginVersion, kibanaVersion);\n+}\n+\n+export default async function (kbnServer, server, config) {\n+  //because a plugin pack can contain more than one actual plugin, (for example x-pack)\n+  //we make sure that the warning messages are unique\n+  const warningMessages = new Set();\n+  const plugins = kbnServer.plugins;\n+\n+  for (let plugin of plugins) {\n+    // Plugins must specify their version, and by default that version should match\n+    // the version of kibana down to the patch level. If these two versions need\n+    // to diverge, they can specify a kibana.version to indicate the version of\n+    // kibana the plugin is intended to work with.\n+    const version = get(plugin, 'pkg.kibana.version', get(plugin, 'pkg.version'));\n+    const name = get(plugin, 'pkg.name');\n+\n+    if (!compatibleWithKibana(kbnServer, version)) {\n+      const message = `Plugin \"${name}\" was disabled because it expected Kibana version \"${version}\", and found \"${kbnServer.version}\".`;\n+      warningMessages.add(message);\n+      plugins.delete(plugin);","path":"src/server/plugins/check_version.js","position":31,"original_position":31,"commit_id":"28024105734ab4cf175a7009f8fe26fda34e801b","original_commit_id":"28024105734ab4cf175a7009f8fe26fda34e801b","user":{"login":"spalger","id":1329312,"avatar_url":"https://avatars.githubusercontent.com/u/1329312?v=3","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},"body":"Now that @Bargs has pointed it out, I took a deeper look and discovered that [`Plugin#readConfig()`](https://github.com/elastic/kibana/blob/aa82360788b657a31ebb1e6fdd13eded82226830/src/server/plugins/plugin.js#L92-L103) is doing a very different job that it should. Removing the config schema of the plugin from the config service is something that should also happen when a plugin is disabled.","created_at":"2016-09-15T18:53:17Z","updated_at":"2016-09-15T18:53:21Z","html_url":"https://github.com/elastic/kibana/pull/8283#discussion_r79036125","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/8283","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/79036125"},"html":{"href":"https://github.com/elastic/kibana/pull/8283#discussion_r79036125"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8283"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/8283","id":85283059,"html_url":"https://github.com/elastic/kibana/pull/8283","diff_url":"https://github.com/elastic/kibana/pull/8283.diff","patch_url":"https://github.com/elastic/kibana/pull/8283.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/8283","number":8283,"state":"open","locked":false,"title":"Check plugin version on startup","user":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"body":"Closes #6652\r\n\r\nAdds a version check to the Kibana startup process.\r\n - Applies the same version checks that are applied during the plugin install process (including #8222 changes)\r\n - If the version of the plugin (pack) fails this check, a warning message is displayed in the console and the plugin is disabled.\r\n\r\nI also changed the `version` value of some test fixtures to 'kibana' instead of '0.0.0'. The version checker will ignore (and not disable) any plugins that have a version number of 'kibana'.","created_at":"2016-09-14T18:44:38Z","updated_at":"2016-09-15T18:53:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"012f09a65da407902d2ea6a5f0f2c6b0bde2c2b6","assignee":{"login":"spalger","id":1329312,"avatar_url":"https://avatars.githubusercontent.com/u/1329312?v=3","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},"assignees":[{"login":"spalger","id":1329312,"avatar_url":"https://avatars.githubusercontent.com/u/1329312?v=3","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},{"login":"Bargs","id":6239176,"avatar_url":"https://avatars.githubusercontent.com/u/6239176?v=3","gravatar_id":"","url":"https://api.github.com/users/Bargs","html_url":"https://github.com/Bargs","followers_url":"https://api.github.com/users/Bargs/followers","following_url":"https://api.github.com/users/Bargs/following{/other_user}","gists_url":"https://api.github.com/users/Bargs/gists{/gist_id}","starred_url":"https://api.github.com/users/Bargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bargs/subscriptions","organizations_url":"https://api.github.com/users/Bargs/orgs","repos_url":"https://api.github.com/users/Bargs/repos","events_url":"https://api.github.com/users/Bargs/events{/privacy}","received_events_url":"https://api.github.com/users/Bargs/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/8283/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/8283/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/8283/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/28024105734ab4cf175a7009f8fe26fda34e801b","head":{"label":"BigFunger:check-plugin-version-on-startup","ref":"check-plugin-version-on-startup","sha":"28024105734ab4cf175a7009f8fe26fda34e801b","user":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"repo":{"id":35180828,"name":"kibana","full_name":"BigFunger/kibana","owner":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BigFunger/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/BigFunger/kibana","forks_url":"https://api.github.com/repos/BigFunger/kibana/forks","keys_url":"https://api.github.com/repos/BigFunger/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BigFunger/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BigFunger/kibana/teams","hooks_url":"https://api.github.com/repos/BigFunger/kibana/hooks","issue_events_url":"https://api.github.com/repos/BigFunger/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/BigFunger/kibana/events","assignees_url":"https://api.github.com/repos/BigFunger/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/BigFunger/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/BigFunger/kibana/tags","blobs_url":"https://api.github.com/repos/BigFunger/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BigFunger/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BigFunger/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/BigFunger/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BigFunger/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/BigFunger/kibana/languages","stargazers_url":"https://api.github.com/repos/BigFunger/kibana/stargazers","contributors_url":"https://api.github.com/repos/BigFunger/kibana/contributors","subscribers_url":"https://api.github.com/repos/BigFunger/kibana/subscribers","subscription_url":"https://api.github.com/repos/BigFunger/kibana/subscription","commits_url":"https://api.github.com/repos/BigFunger/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/BigFunger/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/BigFunger/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/BigFunger/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/BigFunger/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/BigFunger/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BigFunger/kibana/merges","archive_url":"https://api.github.com/repos/BigFunger/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BigFunger/kibana/downloads","issues_url":"https://api.github.com/repos/BigFunger/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/BigFunger/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/BigFunger/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/BigFunger/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BigFunger/kibana/labels{/name}","releases_url":"https://api.github.com/repos/BigFunger/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/BigFunger/kibana/deployments","created_at":"2015-05-06T20:19:18Z","updated_at":"2016-07-27T20:16:34Z","pushed_at":"2016-09-15T17:05:51Z","git_url":"git://github.com/BigFunger/kibana.git","ssh_url":"git@github.com:BigFunger/kibana.git","clone_url":"https://github.com/BigFunger/kibana.git","svn_url":"https://github.com/BigFunger/kibana","homepage":"https://www.elastic.co/products/kibana","size":220530,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"01b426c94957adc7914371d91c9989b3a155a526","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2016-09-15T16:59:18Z","pushed_at":"2016-09-15T18:16:42Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":264263,"stargazers_count":6004,"watchers_count":6004,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2190,"mirror_url":null,"open_issues_count":1165,"forks":2190,"open_issues":1165,"watchers":6004,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8283"},"html":{"href":"https://github.com/elastic/kibana/pull/8283"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/8283"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/8283/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8283/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/8283/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/28024105734ab4cf175a7009f8fe26fda34e801b"}}}}
{"actor":{"display_login":"spalger"}}