PLUGINAPI-189 Add mapper from Severities#291
Conversation
SummaryThis PR adds two new static mapper methods to
Both are marked What reviewers should knowWhere to start: Review the mapping logic, especially Key points for reviewers:
Check against the author's checklist: The commit message prefix (PLUGINAPI-189) is present, and JavaDoc is properly formatted. Confirm CHANGELOG.md was updated per the PR template requirements.
|
antoine-vinot-sonarsource
left a comment
There was a problem hiding this comment.
I don't think this mapping should be part of the plugin api. IMO this is implementation detail and should be up to the platform.
There is one to one relationship between RuleSeverity and ImpactSeverity with the value of the new metrics. Without the explicit mapping, consumer of the new metrics won't know how to use it. Even they know how to use, they introduce duplication of code to do the same mapping in each product. Moreover, we have already similar mapping |
3c82126 to
7bcd3b2
Compare
@zipengwu |
7bcd3b2 to
155e816
Compare
|
Hi @antoine-vinot-sonarsource, isn't sonar-plugin-api public and used by all SonarQube plugins, including external ones? Since we are introducing a new interface that directly relates to two existing ones, I believe providing an explicit mapping is the best way to help consumers understand the relationship between these contracts. |




For SonarSourcers:
Check before making the PR ready for review
@since X.Yin the JavaDoc@Deprecated@deprecated since X.Yin the JavaDocsnake_case, for example:test_validate_input. It can also start with themethodNameFor external contributors:
Please be aware that we are not actively looking for feature contributions. The truth is that it's extremely difficult for someone outside SonarSource to comply with our roadmap and expectations. Therefore, we typically only accept minor cosmetic changes and typo fixes. If you would like to see a new feature, please create a new thread in the forum "Suggest new features".
With that in mind, if you would like to submit a code contribution, make sure that you adhere to the following guidelines and all tests are passing:
Please explain your motives to contribute this change: what problem you are trying to fix, what improvement you are trying to make
Use the following formatting style: SonarSource/sonar-developer-toolset
Provide a unit test for any code you changed
If there is a JIRA ticket available, please make your commits and pull request start with the ticket ID (PLUGINAPI-XXXX)
Please note that opening the PR will notify all the squad members. Please make sure you keep it in DRAFT and mark it ready, when all the checks are green.
We will try to give you feedback on your contribution as quickly as possible.
Thank You! The SonarSource Team