adamtornhill / code-maat

A command line tool to mine and analyze data from version-control systems
http://www.adamtornhill.com/code/codemaat.htm
2.38k stars 222 forks source link

How can we use code-maat with CI tools ? #45

Closed harmeetsingh0013 closed 7 years ago

harmeetsingh0013 commented 7 years ago

How can we use code-maat with CI tools like Jenkins and codeship because code-maat is a part of code analysis. Now, the time, we need to maintain code analysis at CI time. Is possible to use with codeship of Jenkins?

adamtornhill commented 7 years ago

Yes, it's possible to run the analyses as part of a CI pipeline. You'd need to implement a wrapper around code-maat that mines the Git repository and invokes code-maat with the analyses of interest. There's no out of the box support for it in code-maat (however codescene.io automates all these steps).

That said, I don't think it makes sense to run the analyses in code-maat on every commit. The analysis information from code-maat is more useful for tactical decisions around a codebase. The information won't change much for individual commits, which means we cannot get direct feedback on the level of detail we're interested in (e.g. individual commits, pull requests).

IMO we need a different approach to the analysis in order to be useful in a CI pipeline. I've been working on such analyses and how they fit CI and code reviews. I'll write about it in a few weeks at my blog when I have had time to evaluate the new techniques in more depth.

cdancy commented 7 years ago

Hey Adam,

So we'd like to do this very thing, that being: create a gradle plugin to tie this into actual CI pipelines for builds. As the current lead maintainer of the gradle-docker-plugin, and a handful of other gradle based projects, so this should be easy enough to wire up.

What are your thoughts on this? I could certainly get the project off the ground and going and think it would be immensely helpful for developers.

adamtornhill commented 7 years ago

Hi @cdancy

That sounds really interesting and I'd love to see a gradle plugin. I have a post that describes what the CI versions does here.

We've also implemented a Jenkins plugin, which is open sourced here as a working example. The integration itself is straightforward with basically a single REST call.

Please get in touch over e-mail and we can discuss this is in much more detail. I'm adam dot tornhill at empear dot com.