checkstyle / sonar-checkstyle

Support on Checkstyle in SonarQube. Officially transfered from https://github.com/SonarQubeCommunity/sonar-checkstyle
GNU Lesser General Public License v3.0
174 stars 70 forks source link

RuleFinder is deprecated #185

Closed muhlba91 closed 5 years ago

muhlba91 commented 5 years ago

Sonar version: 7.5 Checkstyle sonar plugin verson: 4.17-SNAPSHOT

Steps to reproduce or description of problem: https://github.com/checkstyle/sonar-checkstyle/blob/master/checkstyle-sonar-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileImporter.java uses RuleFinder which is deprecated in SonarQube and should be replaced.

romani commented 5 years ago

@muhlba91 ,

What is a successor of RuleFinder ? from what version successor exists ? we need to know when to switch new minimal version of support.

after we merge your upgrade to 6.7-7.4 at https://github.com/checkstyle/sonar-checkstyle/pull/186, do we have problem with 7.5 ?

looks like I need to prepare 7.5 based docker image for our CI.

muhlba91 commented 5 years ago

I investigated this issue again and have no idea what SQ is/was doing.

As of 5.1 - 7.3 RuleFinder is deprecated since 5.1 and you should use ActiveRules - I have used 7.2 in my previous implementation and then 6.7 - BUT starting with 7.4 they "undeprecated" it again and only the usage of findById is deprecated since 4.4.

This also means SQ 7.5 (assumingly also later versions to come) works perfectly well (for now) and I have tested it successfully as well.

Having seen this I assume RuleFinder won't get deprecated (for now) and we can close this issue? But I'd suggest keeping an eye on the API changes of SQ in case they are deprecating it again.

rnveach commented 5 years ago

API: 5.1 - http://javadocs.sonarsource.org/5.1/apidocs/org/sonar/api/rules/RuleFinder.html (class deprecated) 7.3 - http://javadocs.sonarsource.org/7.3/apidocs/org/sonar/api/rules/RuleFinder.html 7.4 - http://javadocs.sonarsource.org/7.4/apidocs/org/sonar/api/rules/RuleFinder.html 7.5 - http://javadocs.sonarsource.org/7.5/apidocs/org/sonar/api/rules/RuleFinder.html (deprecated method, class undeprecated)

Source: Removing deprecation - https://github.com/SonarSource/sonarqube/commit/5666430ddc9fb043313be01045fd93208033acbd#diff-dbab0ac2eb723195d957a86ad76c2829 ( SONAR-11218 Drop RuleFinder implementation on scanner side and remove deprecation) Tracker - https://jira.sonarsource.com/browse/SONAR-11218

Adding deprecation - https://github.com/SonarSource/sonarqube/commit/aa5364a765fe4ef24ee1fb49c016fe70dafc3ef2#diff-dbab0ac2eb723195d957a86ad76c2829 (SONAR-5927 Restore UserFinder on batch side but deprecate it) Tracker - https://jira.sonarsource.com/browse/SONAR-5927

romani commented 5 years ago

in 7.5 , class is not deprecated any more, only one method http://javadocs.sonarsource.org/7.5/apidocs/org/sonar/api/rules/RuleFinder.html#findById-int- is deprecated, we do not use this method now and are not going to use it at fix #186 .

We do not need to do anything.