{"action":"created","issue":{"url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/2381","repository_url":"https://api.github.com/repos/pmmp/PocketMine-MP","labels_url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/2381/labels{/name}","comments_url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/2381/comments","events_url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/2381/events","html_url":"https://github.com/pmmp/PocketMine-MP/pull/2381","id":351232625,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4ODgwNjI1","number":2381,"title":"PluginManager: Add warnings when a plugin declares useless minor/patc…","user":{"login":"dktapps","id":14214667,"node_id":"MDQ6VXNlcjE0MjE0NjY3","avatar_url":"https://avatars2.githubusercontent.com/u/14214667?v=4","gravatar_id":"","url":"https://api.github.com/users/dktapps","html_url":"https://github.com/dktapps","followers_url":"https://api.github.com/users/dktapps/followers","following_url":"https://api.github.com/users/dktapps/following{/other_user}","gists_url":"https://api.github.com/users/dktapps/gists{/gist_id}","starred_url":"https://api.github.com/users/dktapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dktapps/subscriptions","organizations_url":"https://api.github.com/users/dktapps/orgs","repos_url":"https://api.github.com/users/dktapps/repos","events_url":"https://api.github.com/users/dktapps/events{/privacy}","received_events_url":"https://api.github.com/users/dktapps/received_events","type":"User","site_admin":false},"labels":[{"id":454782351,"node_id":"MDU6TGFiZWw0NTQ3ODIzNTE=","url":"https://api.github.com/repos/pmmp/PocketMine-MP/labels/Category:%20API","name":"Category: API","color":"00aa55","default":false},{"id":454787972,"node_id":"MDU6TGFiZWw0NTQ3ODc5NzI=","url":"https://api.github.com/repos/pmmp/PocketMine-MP/labels/PR:%20Contribution","name":"PR: Contribution","color":"bfdadc","default":false},{"id":497020318,"node_id":"MDU6TGFiZWw0OTcwMjAzMTg=","url":"https://api.github.com/repos/pmmp/PocketMine-MP/labels/Requires%20translations","name":"Requires translations","color":"8080ff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pmmp/PocketMine-MP/milestones/4","html_url":"https://github.com/pmmp/PocketMine-MP/milestone/4","labels_url":"https://api.github.com/repos/pmmp/PocketMine-MP/milestones/4/labels","id":3607682,"node_id":"MDk6TWlsZXN0b25lMzYwNzY4Mg==","number":4,"title":"3.4","description":"","creator":{"login":"dktapps","id":14214667,"node_id":"MDQ6VXNlcjE0MjE0NjY3","avatar_url":"https://avatars2.githubusercontent.com/u/14214667?v=4","gravatar_id":"","url":"https://api.github.com/users/dktapps","html_url":"https://github.com/dktapps","followers_url":"https://api.github.com/users/dktapps/followers","following_url":"https://api.github.com/users/dktapps/following{/other_user}","gists_url":"https://api.github.com/users/dktapps/gists{/gist_id}","starred_url":"https://api.github.com/users/dktapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dktapps/subscriptions","organizations_url":"https://api.github.com/users/dktapps/orgs","repos_url":"https://api.github.com/users/dktapps/repos","events_url":"https://api.github.com/users/dktapps/events{/privacy}","received_events_url":"https://api.github.com/users/dktapps/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":4,"state":"open","created_at":"2018-08-29T17:51:42Z","updated_at":"2018-10-16T16:13:28Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-08-16T14:33:53Z","updated_at":"2018-10-19T10:45:56Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/pmmp/PocketMine-MP/pulls/2381","html_url":"https://github.com/pmmp/PocketMine-MP/pull/2381","diff_url":"https://github.com/pmmp/PocketMine-MP/pull/2381.diff","patch_url":"https://github.com/pmmp/PocketMine-MP/pull/2381.patch"},"body":"…h API versions\r\n\r\n## Introduction\r\nFar too often I see people writing long lists of API versions like\r\n`3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4 ...` and so on. It seems that the information on how the API versioning system checks compatibility has completely flown over the heads of most people.\r\n\r\nThis PR adds warnings on plugin load to inform the user that the plugin is declaring useless API versions.\r\n\r\n### Relevant issues\r\nNo GitHub issues, but many many many Poggit plugin rejections.\r\n\r\n## Changes\r\n### API changes\r\nAdded the following methods:\r\n- `PluginManager::compareApi()`\r\n- `PluginManager::findRedundantApis()`\r\n\r\n### Behavioural changes\r\nA warning will now be emitted when useless API versions are declared in the plugin manifest.\r\n\r\n## Backwards compatibility\r\nThis does not pose any BC breaks, but it is a feature addition and as such targets 3.2.\r\n\r\n## Follow-up\r\nThe language strings for these warnings need to be translated - currently they are hardcoded in English.\r\n\r\n## Tests\r\nHas been tested with compliant and non-compliant plugins. Original loading behaviour should be preserved, the only difference should be with the warning emission on bad plugins.\r\n\r\nThe following `plugin.yml` was used to test:\r\n```yaml\r\nname: test\r\nmain: dktapps\\test\\Main\r\nversion: 0.0.1\r\napi: [2.0.0, 2.1.0, 3.0.4, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0, 4.0.0, 4.0.1]\r\nload: POSTWORLD\r\ncommands:\r\n hand:\r\n  description: \"Skeleton plugin example command\"\r\n  usage: \"/examplecommand\"\r\n  permission: test.hand\r\npermissions:\r\n test:\r\n  default: true\r\n  description: \"Example root permission node\"\r\n  children:\r\n   hand:\r\n    default: true\r\n    description: \"Allows the use of /examplecommand\"\r\n```\r\nThe output:\r\n```\r\n[Server thread/WARNING]: test declares redundant API versions: 2.1.0 (already included with 2.0.0), 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0 (already included with 3.0.0), 4.0.1 (already included with 4.0.0)\r\n```"},"comment":{"url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/comments/431322809","html_url":"https://github.com/pmmp/PocketMine-MP/pull/2381#issuecomment-431322809","issue_url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/2381","id":431322809,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTMyMjgwOQ==","user":{"login":"SOF3","id":19623715,"node_id":"MDQ6VXNlcjE5NjIzNzE1","avatar_url":"https://avatars3.githubusercontent.com/u/19623715?v=4","gravatar_id":"","url":"https://api.github.com/users/SOF3","html_url":"https://github.com/SOF3","followers_url":"https://api.github.com/users/SOF3/followers","following_url":"https://api.github.com/users/SOF3/following{/other_user}","gists_url":"https://api.github.com/users/SOF3/gists{/gist_id}","starred_url":"https://api.github.com/users/SOF3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SOF3/subscriptions","organizations_url":"https://api.github.com/users/SOF3/orgs","repos_url":"https://api.github.com/users/SOF3/repos","events_url":"https://api.github.com/users/SOF3/events{/privacy}","received_events_url":"https://api.github.com/users/SOF3/received_events","type":"User","site_admin":false},"created_at":"2018-10-19T10:45:56Z","updated_at":"2018-10-19T10:45:56Z","author_association":"MEMBER","body":"Agreed. However this would become a backward-incompatible change and should target 4.0.0"}}
{"actor":{"display_login":"SOF3"}}