Jenkins plugin support for multiple sonarqube projects

Hello all. Let me first define my problem as any other suggestions that can solve it would also be welcome.

I’m working on a fairly complex microservice project in Java, built with Gradle, which consists of 20 sonarqube enabled projects. We want to build our code as quickly and efficiently as possible.

Right now our build process consists of the following steps:

  1. Test the application and generate code coverage, which is done with --parallel
  2. Run sonarqube analisys for project 1
  3. Wait for the webhook to report status for project 1
  4. Run sonarqube analisys for project 2
  5. Wait for the webhook to report status for project 2

While the first step is done in parallel, steps 2. and 3. need to be sequential. This is because as said in the documentation, the jenkins plugin relies on a context for the taskId on the last executed sonarqube analisys. What we’d like to do is :

  1. Test the application, generate code coverage and run sonarqube analisys which is done with --parallel
  2. Wait for the webhook to report status for project 1
  3. Wait for the webhook to report status for project 2

So far the first step seems to work just fine and a waitforqualitygate call takes in a matter of milliseconds as it has already been done. This makes this sequence of steps actually run around 3 times as fast as what we currently have.

So for the new feature request:
Optimally make the waitForQualityGate() either be able to process all of the generated report-task.txt which I can see in the logs it finds just fine.
Alternatively make the waitForQualityGate() step mark the taskIds that were processed as already done, so if I rerun it multiple times, it would run with another taskId.
Another alternative would be the ability to specify either projectKey or taskId to the waitForQualityGate() step, although I’d suppose you wouldn’t want users of the plugin to deal with those manually.

Thanks in advance and really great job on both the gradle plugin and the Jenkins one. It makes integrating Sonarqube quite easy.