{"action":"created","comment":{"url":"https://api.github.com/repos/xbmc/addon-check/pulls/comments/190495097","pull_request_review_id":122880557,"id":190495097,"diff_hunk":"@@ -384,3 +391,33 @@ def _check_dependencies(report: Report, addon_path, repo_addons):\n             if LooseVersion(available_version) < LooseVersion(required_version) and (required_addon not in ignore):\n                 report.add(Record(PROBLEM, \"Version mismatch for addon %s. Required: %s, Available: %s \"\n                                   % (required_addon, required_version, available_version)))\n+\n+\n+def get_addon_name(xml_path):\n+    tree = ET.parse(xml_path).getroot()\n+    return (tree.get(\"id\"), tree.get(\"version\"))\n+\n+\n+def _check_for_existing_addon(report: Report, addon_path, addon_branch):\n+    \"\"\"Check if addon submitted already exists or not\"\"\"\n+    addon_xml = os.path.join(addon_path, \"addon.xml\")\n+    addon_name, addon_version = get_addon_name(addon_xml)\n+\n+    branches = ['gotham', 'helix', 'isengard', 'jarvis', 'krypton', 'leia']\n+\n+    for branch in branches:\n+\n+        branch_url = ROOT_URL.format(branch=branch)\n+        repo_addons = _get_addons(branch_url)\n+\n+        if addon_name in repo_addons:\n+            if LooseVersion(addon_version) == LooseVersion(repo_addons[addon_name]):\n+                report.add(Record(PROBLEM, \"%s addon already exist with current version in lower branch\"\n+                                  % addon_name))\n+\n+            else:\n+                report.add(Record(INFORMATION, \"%s addon also exists in %s branch but with lower version\"","path":"kodi_addon_checker/check_addon.py","position":97,"original_position":97,"commit_id":"dc5c142fd96c8d5a6d6e828d2214827aca2d64cd","original_commit_id":"dc5c142fd96c8d5a6d6e828d2214827aca2d64cd","user":{"login":"Rechi","id":5367567,"avatar_url":"https://avatars3.githubusercontent.com/u/5367567?v=4","gravatar_id":"","url":"https://api.github.com/users/Rechi","html_url":"https://github.com/Rechi","followers_url":"https://api.github.com/users/Rechi/followers","following_url":"https://api.github.com/users/Rechi/following{/other_user}","gists_url":"https://api.github.com/users/Rechi/gists{/gist_id}","starred_url":"https://api.github.com/users/Rechi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rechi/subscriptions","organizations_url":"https://api.github.com/users/Rechi/orgs","repos_url":"https://api.github.com/users/Rechi/repos","events_url":"https://api.github.com/users/Rechi/events{/privacy}","received_events_url":"https://api.github.com/users/Rechi/received_events","type":"User","site_admin":false},"body":"as you compare for equality in the if statement the addon repo version could be higher too","created_at":"2018-05-24T07:57:38Z","updated_at":"2018-05-24T07:57:38Z","html_url":"https://github.com/xbmc/addon-check/pull/57#discussion_r190495097","pull_request_url":"https://api.github.com/repos/xbmc/addon-check/pulls/57","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/xbmc/addon-check/pulls/comments/190495097"},"html":{"href":"https://github.com/xbmc/addon-check/pull/57#discussion_r190495097"},"pull_request":{"href":"https://api.github.com/repos/xbmc/addon-check/pulls/57"}}},"pull_request":{"url":"https://api.github.com/repos/xbmc/addon-check/pulls/57","id":178108875,"html_url":"https://github.com/xbmc/addon-check/pull/57","diff_url":"https://github.com/xbmc/addon-check/pull/57.diff","patch_url":"https://github.com/xbmc/addon-check/pull/57.patch","issue_url":"https://api.github.com/repos/xbmc/addon-check/issues/57","number":57,"state":"open","locked":false,"title":"Add check for existing addon","user":{"login":"mzfr","id":16623935,"avatar_url":"https://avatars3.githubusercontent.com/u/16623935?v=4","gravatar_id":"","url":"https://api.github.com/users/mzfr","html_url":"https://github.com/mzfr","followers_url":"https://api.github.com/users/mzfr/followers","following_url":"https://api.github.com/users/mzfr/following{/other_user}","gists_url":"https://api.github.com/users/mzfr/gists{/gist_id}","starred_url":"https://api.github.com/users/mzfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzfr/subscriptions","organizations_url":"https://api.github.com/users/mzfr/orgs","repos_url":"https://api.github.com/users/mzfr/repos","events_url":"https://api.github.com/users/mzfr/events{/privacy}","received_events_url":"https://api.github.com/users/mzfr/received_events","type":"User","site_admin":false},"body":"Fix #56 \r\n@Razzeee This contain some code similar to PR [51](https://github.com/xbmc/addon-check/pull/51).\r\n\r\nShould I make this also usable via `.tests-config.json` ?","created_at":"2018-03-28T17:26:22Z","updated_at":"2018-05-24T07:57:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25bb6baab37c67b20ce3a76a1cd266088f74d6fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xbmc/addon-check/pulls/57/commits","review_comments_url":"https://api.github.com/repos/xbmc/addon-check/pulls/57/comments","review_comment_url":"https://api.github.com/repos/xbmc/addon-check/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xbmc/addon-check/issues/57/comments","statuses_url":"https://api.github.com/repos/xbmc/addon-check/statuses/dc5c142fd96c8d5a6d6e828d2214827aca2d64cd","head":{"label":"mzfr:old-addons","ref":"old-addons","sha":"dc5c142fd96c8d5a6d6e828d2214827aca2d64cd","user":{"login":"mzfr","id":16623935,"avatar_url":"https://avatars3.githubusercontent.com/u/16623935?v=4","gravatar_id":"","url":"https://api.github.com/users/mzfr","html_url":"https://github.com/mzfr","followers_url":"https://api.github.com/users/mzfr/followers","following_url":"https://api.github.com/users/mzfr/following{/other_user}","gists_url":"https://api.github.com/users/mzfr/gists{/gist_id}","starred_url":"https://api.github.com/users/mzfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzfr/subscriptions","organizations_url":"https://api.github.com/users/mzfr/orgs","repos_url":"https://api.github.com/users/mzfr/repos","events_url":"https://api.github.com/users/mzfr/events{/privacy}","received_events_url":"https://api.github.com/users/mzfr/received_events","type":"User","site_admin":false},"repo":{"id":120640993,"name":"addon-check","full_name":"mzfr/addon-check","owner":{"login":"mzfr","id":16623935,"avatar_url":"https://avatars3.githubusercontent.com/u/16623935?v=4","gravatar_id":"","url":"https://api.github.com/users/mzfr","html_url":"https://github.com/mzfr","followers_url":"https://api.github.com/users/mzfr/followers","following_url":"https://api.github.com/users/mzfr/following{/other_user}","gists_url":"https://api.github.com/users/mzfr/gists{/gist_id}","starred_url":"https://api.github.com/users/mzfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzfr/subscriptions","organizations_url":"https://api.github.com/users/mzfr/orgs","repos_url":"https://api.github.com/users/mzfr/repos","events_url":"https://api.github.com/users/mzfr/events{/privacy}","received_events_url":"https://api.github.com/users/mzfr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mzfr/addon-check","description":"Automatic checks for new repository submissions","fork":true,"url":"https://api.github.com/repos/mzfr/addon-check","forks_url":"https://api.github.com/repos/mzfr/addon-check/forks","keys_url":"https://api.github.com/repos/mzfr/addon-check/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mzfr/addon-check/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mzfr/addon-check/teams","hooks_url":"https://api.github.com/repos/mzfr/addon-check/hooks","issue_events_url":"https://api.github.com/repos/mzfr/addon-check/issues/events{/number}","events_url":"https://api.github.com/repos/mzfr/addon-check/events","assignees_url":"https://api.github.com/repos/mzfr/addon-check/assignees{/user}","branches_url":"https://api.github.com/repos/mzfr/addon-check/branches{/branch}","tags_url":"https://api.github.com/repos/mzfr/addon-check/tags","blobs_url":"https://api.github.com/repos/mzfr/addon-check/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mzfr/addon-check/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mzfr/addon-check/git/refs{/sha}","trees_url":"https://api.github.com/repos/mzfr/addon-check/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mzfr/addon-check/statuses/{sha}","languages_url":"https://api.github.com/repos/mzfr/addon-check/languages","stargazers_url":"https://api.github.com/repos/mzfr/addon-check/stargazers","contributors_url":"https://api.github.com/repos/mzfr/addon-check/contributors","subscribers_url":"https://api.github.com/repos/mzfr/addon-check/subscribers","subscription_url":"https://api.github.com/repos/mzfr/addon-check/subscription","commits_url":"https://api.github.com/repos/mzfr/addon-check/commits{/sha}","git_commits_url":"https://api.github.com/repos/mzfr/addon-check/git/commits{/sha}","comments_url":"https://api.github.com/repos/mzfr/addon-check/comments{/number}","issue_comment_url":"https://api.github.com/repos/mzfr/addon-check/issues/comments{/number}","contents_url":"https://api.github.com/repos/mzfr/addon-check/contents/{+path}","compare_url":"https://api.github.com/repos/mzfr/addon-check/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mzfr/addon-check/merges","archive_url":"https://api.github.com/repos/mzfr/addon-check/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mzfr/addon-check/downloads","issues_url":"https://api.github.com/repos/mzfr/addon-check/issues{/number}","pulls_url":"https://api.github.com/repos/mzfr/addon-check/pulls{/number}","milestones_url":"https://api.github.com/repos/mzfr/addon-check/milestones{/number}","notifications_url":"https://api.github.com/repos/mzfr/addon-check/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mzfr/addon-check/labels{/name}","releases_url":"https://api.github.com/repos/mzfr/addon-check/releases{/id}","deployments_url":"https://api.github.com/repos/mzfr/addon-check/deployments","created_at":"2018-02-07T16:30:37Z","updated_at":"2018-05-07T14:24:00Z","pushed_at":"2018-05-24T06:42:58Z","git_url":"git://github.com/mzfr/addon-check.git","ssh_url":"git@github.com:mzfr/addon-check.git","clone_url":"https://github.com/mzfr/addon-check.git","svn_url":"https://github.com/mzfr/addon-check","homepage":"","size":595,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"xbmc:master","ref":"master","sha":"47d34ae38e5a4d6026ee4d338e701a5e23ddfd13","user":{"login":"xbmc","id":199122,"avatar_url":"https://avatars2.githubusercontent.com/u/199122?v=4","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"repo":{"id":109441339,"name":"addon-check","full_name":"xbmc/addon-check","owner":{"login":"xbmc","id":199122,"avatar_url":"https://avatars2.githubusercontent.com/u/199122?v=4","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xbmc/addon-check","description":"Automatic checks for new repository submissions","fork":false,"url":"https://api.github.com/repos/xbmc/addon-check","forks_url":"https://api.github.com/repos/xbmc/addon-check/forks","keys_url":"https://api.github.com/repos/xbmc/addon-check/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xbmc/addon-check/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xbmc/addon-check/teams","hooks_url":"https://api.github.com/repos/xbmc/addon-check/hooks","issue_events_url":"https://api.github.com/repos/xbmc/addon-check/issues/events{/number}","events_url":"https://api.github.com/repos/xbmc/addon-check/events","assignees_url":"https://api.github.com/repos/xbmc/addon-check/assignees{/user}","branches_url":"https://api.github.com/repos/xbmc/addon-check/branches{/branch}","tags_url":"https://api.github.com/repos/xbmc/addon-check/tags","blobs_url":"https://api.github.com/repos/xbmc/addon-check/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xbmc/addon-check/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xbmc/addon-check/git/refs{/sha}","trees_url":"https://api.github.com/repos/xbmc/addon-check/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xbmc/addon-check/statuses/{sha}","languages_url":"https://api.github.com/repos/xbmc/addon-check/languages","stargazers_url":"https://api.github.com/repos/xbmc/addon-check/stargazers","contributors_url":"https://api.github.com/repos/xbmc/addon-check/contributors","subscribers_url":"https://api.github.com/repos/xbmc/addon-check/subscribers","subscription_url":"https://api.github.com/repos/xbmc/addon-check/subscription","commits_url":"https://api.github.com/repos/xbmc/addon-check/commits{/sha}","git_commits_url":"https://api.github.com/repos/xbmc/addon-check/git/commits{/sha}","comments_url":"https://api.github.com/repos/xbmc/addon-check/comments{/number}","issue_comment_url":"https://api.github.com/repos/xbmc/addon-check/issues/comments{/number}","contents_url":"https://api.github.com/repos/xbmc/addon-check/contents/{+path}","compare_url":"https://api.github.com/repos/xbmc/addon-check/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xbmc/addon-check/merges","archive_url":"https://api.github.com/repos/xbmc/addon-check/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xbmc/addon-check/downloads","issues_url":"https://api.github.com/repos/xbmc/addon-check/issues{/number}","pulls_url":"https://api.github.com/repos/xbmc/addon-check/pulls{/number}","milestones_url":"https://api.github.com/repos/xbmc/addon-check/milestones{/number}","notifications_url":"https://api.github.com/repos/xbmc/addon-check/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xbmc/addon-check/labels{/name}","releases_url":"https://api.github.com/repos/xbmc/addon-check/releases{/id}","deployments_url":"https://api.github.com/repos/xbmc/addon-check/deployments","created_at":"2017-11-03T20:46:35Z","updated_at":"2018-05-20T07:50:12Z","pushed_at":"2018-05-24T06:43:00Z","git_url":"git://github.com/xbmc/addon-check.git","ssh_url":"git@github.com:xbmc/addon-check.git","clone_url":"https://github.com/xbmc/addon-check.git","svn_url":"https://github.com/xbmc/addon-check","homepage":"","size":214,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":14,"open_issues":20,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xbmc/addon-check/pulls/57"},"html":{"href":"https://github.com/xbmc/addon-check/pull/57"},"issue":{"href":"https://api.github.com/repos/xbmc/addon-check/issues/57"},"comments":{"href":"https://api.github.com/repos/xbmc/addon-check/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/xbmc/addon-check/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/xbmc/addon-check/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xbmc/addon-check/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/xbmc/addon-check/statuses/dc5c142fd96c8d5a6d6e828d2214827aca2d64cd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Rechi"}}