Issue #387 Add deprecated jsp rule key #391
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Between version 3.3 and 3.4 of the plugin rules XSS_JSP_PRINT and XSS_REQUEST_PARAMETER_TO_JSP_WRITER have been moved from the Java findsecbugs repository to the JSP findsecbugs-jsp repository.
When a rule key is modified the plugin should apparently declare it's "deprecated key(s)" to let SonarQube know, see: https://javadocs.sonarsource.org/7.1/apidocs/org/sonar/api/server/rule/RulesDefinition.Rule.html#deprecatedRuleKeys--
The database was left in an apparently inconsistent state for SQ installations where the plugin had been upgraded from <= 3.3 to >= 3.4
Then when the API used to load profiles was changed in #369 (to make the plugin compatible with SQ 9) the server crashed on startup with error:
BadRequestException: java rule findsecbugs:XSS_JSP_PRINT cannot be activated on jsp profile FindBugs Security JSP
This PR adds the "deprecated keys" (i.e. the old rules ID) for these two rules and prevent the plugin from trying to activate a removed rule into a profile.