For each MR, we don’t want it calculate code coverage on the incremental code, instead, we want to compare the code coverage of current long-live branch (in most cases, master), and the code coverage after merging a MR to the master.
For example, say Master branch has a overall 73.41% coverage, and we created a MR from feature-branch-1 to master. We expect sonarqube to calculate the code coverage after feature-branch-1 is merge to master. And if that value is smaller than 73.41%, we expect the quality gate would fail.
It would looks like what codecov provides here: [ISSUE #3009]test(benchmark): support delay message test by maixiaohai · Pull Request #3010 · apache/rocketmq · GitHub
(If in the “value”, we can add a branch name instead of a hardcoded, value, that would be great)
Not sure if this feature has been provided yet, thanks for all potential help!
EDIT: SonarQube version: 8.4.1, and yes according to following this can be done using script, but would be nice to have this feature out of box.