Describe the bug
When reporting on the results of a pull request, Sonarqube reports a Fixed issues statistic on the Pull Request overview page, but this always appears as 0, regardless of the number of issues fixed.
To Reproduce
Submit a branch (e.g. master) for analysis with some findings in it, such as using System.err.println rather than a logger
Ensure Sonarqube shows the issue in the branch overview
Create another branch from master and 'fix' those issues, such as switching to using a logger or removing the problem lines
Analyse the changed commit, reporting it as a Pull Request to Sonarqube, with the base branch as the branch from step 1
Open the overview page for the pull request, and check the Fixed issues panel
Expected behaviour
The fixed issues panel should show a number that reflects the number of issues fixed (i.e. not 0 in the above case)
Screenshots
Software Versions
SonarQube Version: 10.6
Plugin Version: 1.21.0
Additional context
The Fixed issues metric is exposed in the component API as a metric with key pull_request_fixed_issues:
The metric is set by PullRequestFixedIssuesMeasureStep reading from PullRequestFixedIssueRepository, with the repository just being an in-memory store for a list of issues. As PullRequestFixedIssuesMeasureStep is invoked after any IssueVisitor, implementing onRawIssues with some filtering/comparison between baseIssues and rawIssues looks like a potential solution.
Describe the bug When reporting on the results of a pull request, Sonarqube reports a
Fixed issues
statistic on the Pull Request overview page, but this always appears as0
, regardless of the number of issues fixed.To Reproduce
System.err.println
rather than a loggerFixed issues
panelExpected behaviour The fixed issues panel should show a number that reflects the number of issues fixed (i.e. not
0
in the above case)Screenshots
Software Versions
Additional context The
Fixed issues
metric is exposed in thecomponent
API as a metric with keypull_request_fixed_issues
:The metric is set by PullRequestFixedIssuesMeasureStep reading from
PullRequestFixedIssueRepository
, with the repository just being an in-memory store for a list of issues. AsPullRequestFixedIssuesMeasureStep
is invoked after anyIssueVisitor
, implementing onRawIssues with some filtering/comparison betweenbaseIssues
andrawIssues
looks like a potential solution.