mutation-analysis-plugin icon indicating copy to clipboard operation
mutation-analysis-plugin copied to clipboard

New Code conditions

Open darrenyeats opened this issue 2 years ago • 9 comments

Hi, I've got it working with multi-module project on PR branch. Thanks for this!

IME and per docs*, when it comes to enforcement of QG for PR branches, SonarQube uses only New Code conditions. Are there any plans for the plugin to support New Code conditions? Thanks.

*https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/pull-request-analysis/

darrenyeats avatar Jul 06 '23 16:07 darrenyeats

Hi @darrenyeats , what changes you made for plugin to work for PR branches?

Thanks Milind

milindbangar79 avatar Jul 28 '23 18:07 milindbangar79

I've made no changes, I refer to the normal scan report in the UI that includes Overall Code metrics (including Mutation testing provided by this plugin).

But only New Code conditions are picked up for a PR Quality Gate.

darrenyeats avatar Jul 28 '23 21:07 darrenyeats

I do not see Mutation Metrics in New Code condition. is there anything required to do enable it?

milindbangar79 avatar Jul 28 '23 21:07 milindbangar79

I believe they don't exist. That's what my original question is about.

darrenyeats avatar Jul 28 '23 22:07 darrenyeats

Ok thanks

milindbangar79 avatar Jul 29 '23 08:07 milindbangar79

Hi all,

atm there are no plans for new code conditions - mainly because I don't have any spare time to do it. But I'd be more than happy to accept any contributions in that regard!

gmuecke avatar Aug 02 '23 10:08 gmuecke

To answer your questions whether there are any plans: no, there aren't.

Mainly because I don't have any spare capacity for any new development - the only thing I do atm is keeping the lights on. But any contributions to add new features, such as "new code" support (if it's possible at all) is much welcomed.

gmuecke avatar Apr 08 '24 19:04 gmuecke

Hi all, I would like to join this discussion as me and my team would also like to specify the mutation-condition as "Condition on New Code". Our "relevant" build is the PR-build and currently all mutation conditions are just ignored due to the specified current limitation.

I just want to emphasize that for us this would also be very helpful. I would add a contribution, but I have no knowledge about SonarQube plugins... How would you start implementing this feature?

Image

Regards Dave

dave1b avatar Feb 11 '25 07:02 dave1b

Hi Dave, thanks for reaching out. Afaik, all the PR analysis stuff is only available in the commercial editions of Sonarqube. I don't have no such license and therefore could not implement & test it on my own and thus can not support this feature in any way. The metrics are computed in https://github.com/devcon5io/mutation-analysis-plugin/tree/master/src/main/java/ch/devcon5/sonar/plugins/mutationanalysis/metrics . It's run on the server side. That's maybe a starting point for your implementation.

Cheers, Gerald

gmuecke avatar Feb 11 '25 07:02 gmuecke