sonar-gerrit-plugin
sonar-gerrit-plugin copied to clipboard
Only fetch unresolved issues
When fetching issues from SonarQube, we should only fetch unresolved issues. This will avoid showing issues which were discovered in previous runs with the same "PR" ID but have since been resolved and are no longer issues.
Testing done
Tested manually in our local environment.
Submitter checklist
- [x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [ ] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
Actually, this PR may still have some issues. Working through them now. Please do not merge yet.
@reda-alaoui, this has been fully tested locally now and resolves our issue nicely. I've also added an automated test to verify the requests that are being sent to SonarQube. Please review when you are able.
@mtughan , unit tests have low value in this case. Please write an integration test instead.
@mtughan , unit tests have low value in this case. Please write an integration test instead.
Testing an integration test now. Will request review again when I've confirmed it as working (am having issues running it locally).
@reda-alaoui, PullRequestAnalysisTest doesn't seem to be getting executed in the PR runs, either on Linux or on Windows. Any idea why that would be?
12:48:56 [INFO] Running org.jenkinsci.plugins.sonargerrit.sonar.pull_request_analysis.PullRequestAnalysisTest
12:50:12 [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 75.834 s - in org.jenkinsci.plugins.sonargerrit.sonar.pull_request_analysis.PullRequestAnalysisTest
@mtughan , I am currently investigating this.
@mtughan please rebase on master to retrieve https://github.com/jenkinsci/sonar-gerrit-plugin/commit/d12b9889389d19599e1635ea4c6c86ead376d0da .
@mtughan please rebase on master to retrieve d12b988 .
Will do, thanks.
UPDATE: Yes, it appears to be fixed now. I will troubleshoot and get the unit test working now.
As a user of this plugin, I'd like to cast my support for this PR. It would be great if it avoided posting comments for resolved issues. :)
@reda-alaoui, the integration test is fixed and demonstrating that the change works as expected now. Please review when you are able.
@reda-alaoui, ping on this PR. I just rebased it on the latest commit in master.
Sounds like this could fix #155. Would appreciate a merge.
we are facing the same issue. is there any update?
@reda-alaoui, the PR’s been rebased again. Are you able to review it and (hopefully!) merge it?