No email notificaton when issues are inherited from a pull request

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Community lts(7.9.4)docker version with sonarqube-community-branch-plugin

  • steps to reproduce

  1. Setup the SMTP server and subscribe “My new issues”. Config the account with email.
  2. Create a new project, commit the project by git, and perform an init scan.
  3. Modify the code to contain issues, commit by git again, and perform a new scan with sonar.pullrequest.key, sonar.pullrequest.branch parameters.
  4. Check the sonar dashboard that the pull request dashboard shows the correct issues.
  5. Scan the code again but with sonar.branch.name parameter.
  6. No email notification but the new issues are showed in the project dashboard.
  • root cause
    When issues are inherited from a pull request or short live branch, most of the properties are copy from the pull request one.
    In the method IssueLifecycle#mergeConfirmedOrResolvedFromShortLivingBranchOrPr, the creationDate is copy too. Since the creation date is earlier than scan time, the issue is ignored in the SendIssueNotificationsStep.

Hi,

Thanks for opening two different threads for two different (but related :smiley:) questions. The answer here is going to be pretty much the same as for your other thread:

The thinking here is that if you merge a PR with existing issues, you’ve chosen to accept that debt, even if only temporarily. You’re more than likely already quite aware of it and don’t need to be spammed with additional notifications.

 
HTH,
Ann

In fact, from our developers perspective, they don’t want to accept these issues.

The problem is that the emails are not sent either of pull request or master scanning. So there’s no chance tell the developer he/she introduces some issues by email notification. They have to check the sonar dashboard from time to time.

Any suggestion?

Thanks

Hi,

As mentioned in your other thread, I’m not sure emails are sent for PRs. Again, the assumption is that you’re paying attention to the PR and will see the issues there (and thus don’t need emails).

 
HTH,
Ann