Trouble connecting specific analysis result with specific build


SonarQube 10.3 here, Developer Edition, standalone install on Windows 2019 Server. Bamboo as CI/CD. Scanner 5.15 for .NET.

I am trying to debug code coverage metrics changes across Sonar scans, performed on the same branch, nearly the same code, on the same day. One scan reports ~10% condition coverage, and the other - ~4%.

This is how it looks like in admin GUI. One the left - Administration > Projects > Background Tasks view, on the right - Projects > Activity view.

I can’t attribute specific scan results to a specific build.

Analysis times do not match. Activity view shows 10:20 and 9:18, but no such time in Background Task view. Background Tasks view shows 3 tasks that had run after 9 o’clock, and 3 after 10 o’clock, but neither of them matches 10:20 or 9:18. I might guess which is which, but no idea why the discrepancy.

Second issue is - the activity view does not display any custom argument that I have passed to SonarQube from SonarScanner. I would really like to have small link in Activity view, which will redirect to build-specific url to CI from argument.

Project scanner properties:
  - sonar.analysis.bamboo.agentWorkingDir=edited...
  - sonar.analysis.bamboo.shortPlanName=edited...
  - sonar.cs.opencover.reportsPaths= edited...
  - sonar.dotnet.excludeTestProjects=true
  - sonar.exclusions= edited...
  - edited...
  - edited...
  - sonar.modules= edited...
  - sonar.projectBaseDir= edited...
  - sonar.projectKey= edited...
  - sonar.projectVersion= edited...
  - sonar.pullrequest.cache.basepath= edited...
  - sonar.scanAllFiles=true
  - sonar.scanner.appVersion=5.15
  - sonar.sourceEncoding=UTF-8
  - sonar.sources= edited...
  - sonar.token= edited...
  - sonar.visualstudio.enable=false
  - edited...

Can you advise on this?

Kind regards,
Michal Gruda

Hi Michal,

You’ve got several questions here, and we try to keep it to one topic per thread. Otherwise it can get messy, fast.

I’ll do my best to address what’s here, but if you have followup questions, I reserve the right to ask you to create new threads.

Regarding the timestamps, your Background Tasks screenshot omits the column headings. Let’s take a look at them:

The timestamps shown in Background Tasks relate to… the background tasks themselves. So the first time column is when the analysis report reached the server from your CI agent. The next one is when the server started processing the report and the third is when it finished.

For the timestamps in the project’s Activity tab, I believe that’s when analysis started on the CI agent. You could check your agent to confirm.

You should see those properties when you mouseover analyses in the activity list:

sonar-enterprise - Activity - SonarQube - Island_005


1 Like

Hi Ann,

Thanks for picking this up.
No idea why, but I don’t see any custom property I have passed with Sonar Begin command:
I’ll try passing buildString to Sonar Begin step and see if it displays.
Still think that displaying a small link to value of , if provided - in Activity tab - would be more elegant and natural way. Maybe something the Product Team can reflect on :slight_smile: But that closes this topic.

The second topic - about discrepancy between times in Activity tab, and Background Tasks. I understand your explanation, but I hope you’ll understand the user that can see both the Activity view and the Background Tasks view. If a single Background Task has a one-to-one relation with single report processing result - why the only common data displayed for both - time - differs?
Anyway - now I know how it works - many thanks for that :slight_smile:


1 Like

Hi Michal,

Now I have followup questions. :smile:

You’re passing your sonar.analysis.* properties with the begin command, and they show up in the context on the Background page (BTW, not all users see that page, only project admins) but not on the Activity mouseover. (Yes, I know you just said that. Just recapping.)

I’m wondering what happens if you pass them also(?) only(?) with the end command. Have you ever tried that? Would you?


Edit to add / P.S. Could you try it with fewer dots? E.G. sonar.anlaysis.bambooAgentWorkingDir?

Hi Ann,

Regarding leaving out dots from custom analysis parameters:
I have changed:
I send them in SonarScanner begin step.

They are still not visible in Activity view. However, buildString - once added - is displayed.

I haven’t had a chance to play around with sending those along with SonarScanner end step. Still working on condition coverage counted correctly if a Pull Request contains both MAIN file change and TEST update to cover added conditionals… But I’ll figure it out :slight_smile:

Kind regards,

1 Like

Hi Michal,

Thanks for trying. You’ve spotted some sort of bug. I’m not sure whether it’s on the analysis or the display side, but I’m going to flag this for further attention.


Hi again,

I’m wrong.

Your custom values are stored with the analysis and available in webhook results. But not displayed anywhere. I had forgotten that sonar.buildString was its own parameter. :woman_facepalming:.

There’s no bug. And I’ll pass this forward as a feature request instead.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.