I would like to understand how to use this analysis cache feature correctly. I can’t find any document on this aside from how to enable it. Yes I have enabled it and it works from one workspace perfectly everything with 100% hit rate.
Is analysis cache per workspace? That is does it rely on path where the workspace is checked out?
It seems like the case for me. So locally I have master checked out in 2 locations and I am using the same cache path for both analysis. There are no hits between them when switching from one to another. Note: It is exact same source code. And if I work on one workspace I get 100% hit.
The above issue will cause problems with PR on Jenkins and branch builds as they are checked out at different locations. What is the best approach to handle cache and reuse between different locations of source tree?
I use sonar.branch.name for all my build types and use the same cache for all build type on Jenkins. When I say build type I mean master, branch build and pull requests. ie. on Jenkins master build sonar.branch.name=master and for PR sonar.branch.name=PR-123 and branch build sonar.branch.name=branchname. Is this the way to do it to share the cache across from master to PR to branch builds?
I seriously need an urgent answer otherwise this tool is not useful with out cache speed up in PR.