{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments/165665880","pull_request_review_id":93634696,"id":165665880,"diff_hunk":"@@ -181,6 +181,22 @@ private void synchronizeDeprecatedKeys(DbSession dbSession, List<RulesDefinition\n       .flatMap(rule -> SingleDeprecatedRuleKey.from(rule).stream())\n       .collect(MoreCollectors.toSet());\n \n+    Set<RuleKey> currentKeys = repositories.stream()\n+      .flatMap(r -> r.rules().stream())\n+      .map(r -> RuleKey.of(r.repository().key(), r.key()))\n+      .collect(MoreCollectors.toSet());\n+\n+    Set<RuleKey> incorrectKeys = newDeprecatedKeys.stream()\n+      .map(SingleDeprecatedRuleKey::getOldRuleKeyAsRuleKey)\n+      .filter(currentKeys::contains)\n+      .collect(MoreCollectors.toSet());\n+\n+    if (!incorrectKeys.isEmpty()) {","path":"server/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java","position":132,"original_position":14,"commit_id":"1142ab9fac24ed2c1d7baa9d664f786798058245","original_commit_id":"1142ab9fac24ed2c1d7baa9d664f786798058245","user":{"login":"sns-seb","id":11717580,"avatar_url":"https://avatars2.githubusercontent.com/u/11717580?v=4","gravatar_id":"","url":"https://api.github.com/users/sns-seb","html_url":"https://github.com/sns-seb","followers_url":"https://api.github.com/users/sns-seb/followers","following_url":"https://api.github.com/users/sns-seb/following{/other_user}","gists_url":"https://api.github.com/users/sns-seb/gists{/gist_id}","starred_url":"https://api.github.com/users/sns-seb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sns-seb/subscriptions","organizations_url":"https://api.github.com/users/sns-seb/orgs","repos_url":"https://api.github.com/users/sns-seb/repos","events_url":"https://api.github.com/users/sns-seb/events{/privacy}","received_events_url":"https://api.github.com/users/sns-seb/received_events","type":"User","site_admin":false},"body":"this code won't detect a same key declared as deprecated of rule A and rule B\r\n","created_at":"2018-02-02T14:56:48Z","updated_at":"2018-02-02T14:56:51Z","html_url":"https://github.com/SonarSource/sonarqube/pull/3011#discussion_r165665880","pull_request_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments/165665880"},"html":{"href":"https://github.com/SonarSource/sonarqube/pull/3011#discussion_r165665880"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011","id":166595670,"html_url":"https://github.com/SonarSource/sonarqube/pull/3011","diff_url":"https://github.com/SonarSource/sonarqube/pull/3011.diff","patch_url":"https://github.com/SonarSource/sonarqube/pull/3011.patch","issue_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/3011","number":3011,"state":"open","locked":false,"title":"SONAR-10310 Fail a startup if a rule uses the deprecated key of another rule","user":{"login":"ehartmann","id":112486,"avatar_url":"https://avatars1.githubusercontent.com/u/112486?v=4","gravatar_id":"","url":"https://api.github.com/users/ehartmann","html_url":"https://github.com/ehartmann","followers_url":"https://api.github.com/users/ehartmann/followers","following_url":"https://api.github.com/users/ehartmann/following{/other_user}","gists_url":"https://api.github.com/users/ehartmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ehartmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehartmann/subscriptions","organizations_url":"https://api.github.com/users/ehartmann/orgs","repos_url":"https://api.github.com/users/ehartmann/repos","events_url":"https://api.github.com/users/ehartmann/events{/privacy}","received_events_url":"https://api.github.com/users/ehartmann/received_events","type":"User","site_admin":false},"body":null,"created_at":"2018-02-01T17:01:45Z","updated_at":"2018-02-02T14:56:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"adf2cdbeecd653120d8d495874e568017e031556","assignee":{"login":"ehartmann","id":112486,"avatar_url":"https://avatars1.githubusercontent.com/u/112486?v=4","gravatar_id":"","url":"https://api.github.com/users/ehartmann","html_url":"https://github.com/ehartmann","followers_url":"https://api.github.com/users/ehartmann/followers","following_url":"https://api.github.com/users/ehartmann/following{/other_user}","gists_url":"https://api.github.com/users/ehartmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ehartmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehartmann/subscriptions","organizations_url":"https://api.github.com/users/ehartmann/orgs","repos_url":"https://api.github.com/users/ehartmann/repos","events_url":"https://api.github.com/users/ehartmann/events{/privacy}","received_events_url":"https://api.github.com/users/ehartmann/received_events","type":"User","site_admin":false},"assignees":[{"login":"ehartmann","id":112486,"avatar_url":"https://avatars1.githubusercontent.com/u/112486?v=4","gravatar_id":"","url":"https://api.github.com/users/ehartmann","html_url":"https://github.com/ehartmann","followers_url":"https://api.github.com/users/ehartmann/followers","following_url":"https://api.github.com/users/ehartmann/following{/other_user}","gists_url":"https://api.github.com/users/ehartmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ehartmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehartmann/subscriptions","organizations_url":"https://api.github.com/users/ehartmann/orgs","repos_url":"https://api.github.com/users/ehartmann/repos","events_url":"https://api.github.com/users/ehartmann/events{/privacy}","received_events_url":"https://api.github.com/users/ehartmann/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011/comments","review_comment_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/3011/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonarqube/statuses/1142ab9fac24ed2c1d7baa9d664f786798058245","head":{"label":"SonarSource:feature/eh/SONAR-10310","ref":"feature/eh/SONAR-10310","sha":"1142ab9fac24ed2c1d7baa9d664f786798058245","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"repo":{"id":1222504,"name":"sonarqube","full_name":"SonarSource/sonarqube","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SonarSource/sonarqube","description":"Continuous Code Quality","fork":false,"url":"https://api.github.com/repos/SonarSource/sonarqube","forks_url":"https://api.github.com/repos/SonarSource/sonarqube/forks","keys_url":"https://api.github.com/repos/SonarSource/sonarqube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonarqube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonarqube/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonarqube/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonarqube/events","assignees_url":"https://api.github.com/repos/SonarSource/sonarqube/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonarqube/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonarqube/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonarqube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonarqube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonarqube/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonarqube/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonarqube/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonarqube/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonarqube/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonarqube/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonarqube/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonarqube/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonarqube/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonarqube/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonarqube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonarqube/merges","archive_url":"https://api.github.com/repos/SonarSource/sonarqube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonarqube/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonarqube/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonarqube/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonarqube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonarqube/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonarqube/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonarqube/deployments","created_at":"2011-01-05T11:05:17Z","updated_at":"2018-02-02T13:01:32Z","pushed_at":"2018-02-02T14:32:18Z","git_url":"git://github.com/SonarSource/sonarqube.git","ssh_url":"git@github.com:SonarSource/sonarqube.git","clone_url":"https://github.com/SonarSource/sonarqube.git","svn_url":"https://github.com/SonarSource/sonarqube","homepage":"http://www.sonarqube.org","size":273150,"stargazers_count":2387,"watchers_count":2387,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":779,"mirror_url":null,"archived":false,"open_issues_count":20,"license":null,"forks":779,"open_issues":20,"watchers":2387,"default_branch":"master"}},"base":{"label":"SonarSource:feature/MMF-1153/support_rule_key_renaming","ref":"feature/MMF-1153/support_rule_key_renaming","sha":"9d72ae46e89e97e9d45b401dda1386f986271877","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"repo":{"id":1222504,"name":"sonarqube","full_name":"SonarSource/sonarqube","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars0.githubusercontent.com/u/545988?v=4","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SonarSource/sonarqube","description":"Continuous Code Quality","fork":false,"url":"https://api.github.com/repos/SonarSource/sonarqube","forks_url":"https://api.github.com/repos/SonarSource/sonarqube/forks","keys_url":"https://api.github.com/repos/SonarSource/sonarqube/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonarqube/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonarqube/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonarqube/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonarqube/events","assignees_url":"https://api.github.com/repos/SonarSource/sonarqube/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonarqube/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonarqube/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonarqube/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonarqube/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonarqube/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonarqube/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonarqube/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonarqube/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonarqube/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonarqube/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonarqube/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonarqube/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonarqube/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonarqube/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonarqube/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonarqube/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonarqube/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonarqube/merges","archive_url":"https://api.github.com/repos/SonarSource/sonarqube/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonarqube/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonarqube/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonarqube/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonarqube/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonarqube/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonarqube/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonarqube/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonarqube/deployments","created_at":"2011-01-05T11:05:17Z","updated_at":"2018-02-02T13:01:32Z","pushed_at":"2018-02-02T14:32:18Z","git_url":"git://github.com/SonarSource/sonarqube.git","ssh_url":"git@github.com:SonarSource/sonarqube.git","clone_url":"https://github.com/SonarSource/sonarqube.git","svn_url":"https://github.com/SonarSource/sonarqube","homepage":"http://www.sonarqube.org","size":273150,"stargazers_count":2387,"watchers_count":2387,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":779,"mirror_url":null,"archived":false,"open_issues_count":20,"license":null,"forks":779,"open_issues":20,"watchers":2387,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011"},"html":{"href":"https://github.com/SonarSource/sonarqube/pull/3011"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonarqube/issues/3011"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonarqube/issues/3011/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011/comments"},"review_comment":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SonarSource/sonarqube/pulls/3011/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonarqube/statuses/1142ab9fac24ed2c1d7baa9d664f786798058245"}},"author_association":"OWNER"}}
{"actor":{"display_login":"sns-seb"}}