sonar-gerrit-plugin icon indicating copy to clipboard operation
sonar-gerrit-plugin copied to clipboard

Only fetch unresolved issues

Open mtughan opened this issue 1 year ago • 12 comments
trafficstars

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

mtughan avatar Jul 24 '24 16:07 mtughan

Actually, this PR may still have some issues. Working through them now. Please do not merge yet.

mtughan avatar Jul 24 '24 19:07 mtughan

@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 avatar Aug 21 '24 17:08 mtughan

@mtughan , unit tests have low value in this case. Please write an integration test instead.

reda-alaoui avatar Aug 27 '24 20:08 reda-alaoui

@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).

mtughan avatar Sep 04 '24 15:09 mtughan

@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 avatar Sep 05 '24 17:09 mtughan

@mtughan , I am currently investigating this.

reda-alaoui avatar Sep 16 '24 16:09 reda-alaoui

@mtughan please rebase on master to retrieve https://github.com/jenkinsci/sonar-gerrit-plugin/commit/d12b9889389d19599e1635ea4c6c86ead376d0da .

reda-alaoui avatar Sep 17 '24 12:09 reda-alaoui

@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.

mtughan avatar Sep 17 '24 16:09 mtughan

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. :)

felipecrs avatar Nov 12 '24 13:11 felipecrs

@reda-alaoui, the integration test is fixed and demonstrating that the change works as expected now. Please review when you are able.

mtughan avatar Dec 09 '24 04:12 mtughan

@reda-alaoui, ping on this PR. I just rebased it on the latest commit in master.

mtughan avatar Jan 22 '25 18:01 mtughan

Sounds like this could fix #155. Would appreciate a merge.

SR4ven avatar Feb 19 '25 15:02 SR4ven

we are facing the same issue. is there any update?

philippberger avatar Sep 22 '25 14:09 philippberger

@reda-alaoui, the PR’s been rebased again. Are you able to review it and (hopefully!) merge it?

mtughan avatar Sep 24 '25 01:09 mtughan