Cache usage interchangeably

I wondered if using SonarQube caches, created in different SonarUserHome locations, interchangeably
is possible. Because of our build structure, each branch gets assigned a distinct build directory with a cache location. The cache location is $WORKSPACE/cache. The workspace folder is named accordingly to the branch. Therefore the main branch has a different SonarUserHome location when running the analysis than, for example, a feature branch. Using the saved cache for new builds for the same branch is no problem, as the SonarUserHome locations match, for example, main (build 1) and main (build 2). I question whether it is possible to use the cache generated from the master for a different branch with a different absolute path. Currently, we get 0 cache hits when using the master cache for another branch.
I appreciate any help you can provide.

  • Enterprise Edition, Version 8.9.6 (build 50800)

Hello @Murasaki and welcome to our community!

Unfortunately no, using SonarQube caches interchangeably is currently not possible. That is why, indeed, you have 0 cache hits in your case.

But we are well aware of this painful limitation and plan to work on it soon: in the next version of SonarQube (9.6), the cache will be independent of the project checkout location. So in a case like yours, you will be able to use, for example, the cache generated from the master for a different branch.

To follow the progress, you can watch this ticket CPP-3730.

Have a nice day,

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