-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Issues is always shown at 0 on Pull Requests #945
Labels
bug
Something isn't working
Comments
mc1arke
added a commit
that referenced
this issue
Aug 13, 2024
Sonarqube currently reports a fixed issues metric for pull requests, but the plugin isn't providing the data to allow that value to be calculated. To resolve this an additional IssueVisitor has been introduced that compares the issues from the target branch with the findings on the source branch and finds any target code blocks that no longer exists - implying the issue line has been removed - or any code that still exists but is now reporting the issue as fixed, and reports them to the PullRequestFixedIssuesRepository which is used within Sonarqube to gather the count of issues fixed in the current analysis.
mc1arke
added a commit
that referenced
this issue
Aug 18, 2024
Sonarqube currently reports a fixed issues metric for pull requests, but the plugin isn't providing the data to allow that value to be calculated. To resolve this an additional IssueVisitor has been introduced that compares the issues from the target branch with the findings on the source branch and finds any target code blocks that no longer exists - implying the issue line has been removed - or any code that still exists but is now reporting the issue as fixed, and reports them to the PullRequestFixedIssuesRepository which is used within Sonarqube to gather the count of issues fixed in the current analysis.
mc1arke
added a commit
that referenced
this issue
Aug 18, 2024
Sonarqube currently reports a fixed issues metric for pull requests, but the plugin isn't providing the data to allow that value to be calculated. To resolve this an additional IssueVisitor has been introduced that compares the issues from the target branch with the findings on the source branch and finds any target code blocks that no longer exists - implying the issue line has been removed - or any code that still exists but is now reporting the issue as fixed, and reports them to the PullRequestFixedIssuesRepository which is used within Sonarqube to gather the count of issues fixed in the current analysis.
Released in 1.22.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.The text was updated successfully, but these errors were encountered: