Gather "more global" insights into scanner context data of the latest scan of a projectKey

Oh hai! :wave:
Must include info: Consider newest versions of stuff …

I was wandering how i might be able to take advantage of the following two parameters

  • sonar.scanner.app
  • sonar.scanner.appVersion

These get displayed in the /admin/background_tasks

  • when you klick on the “three dots button” in each row and then click on the “Show scanner context”
  • In the then displayed popup (which has no url i could display now) i can gather insights into the performed scan-process.

Right now i have the idea that i might be able to gather insight into which scanner and version is used inside our CI infra by gathering data for the shown parameters (for example):

  • sonar.scanner.app=ScannerGradle
  • sonar.scanner.appVersion=3.4.0.2513/Gradle 7.6

So … how would i best proceed in “mass-gathering” those two key/values for the latest scan of each projectKey?

  • I would be very glad if someone would be able to type out some pseudo-code of interactions with the WEB_API!
  • I know how to iterate over a bunch of projects, so the part of “getting to the data of the scanner context of the latest scanresult” is of interest
  • I would then myself research how i would need to implement that.

(And while typing i realize that the first reply probably will be: Use devtools in the browser and look for yourself :slightly_frowning_face: but i am no webdev and that is why i am asking here instead :person_shrugging: )

cheers
Daniel

P.S.: :thinking: on a second thought … wouldn’t this be a nice pie-chart-like statistic about the share of language-scanners that supply scans to sonarcloud for example? just thinking :person_shrugging:

Hi,

Would you mind sharing your end-goal here?

And yes, that’s the first reply. The best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action.

You may also find this guide helpful.

 
Thx,
Ann