Sonarqube and monorepo

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube - enterprise)
  • what are you trying to achieve(setup sonarqube to my organization)
  • what have you tried so far to achieve this

Hi, I’m quite new to sonarqube. I’m wondering if we can configure sonarqube with commit meaning the status gets updated on that commit in github. Because most of us directly push the commit to master

Hi,

Welcome to the community!

We offer PR analysis. If you’re committing directly on the main branch, then I guess you’re just interested in normal, plain-old analysis.

 
Ann

We have a monorepo configured in our org, so basically we just commit to master branch and it will kick off development pipeline(aws codebuild) right away.
So my question is how does sonaqube support this process.
Sorry if my question is a bit messy

Hi,

The monorepo support is specifically for PRs on a monorepo so that PR decoration for different projects in the monorepo don’t wipe each other out.

On the “plain” analysis side, I would say just to be careful to provide a different sonar.projectKey for each project in the monorepo.

Does that make sense? Is it what you were looking for? Would you expect some other / additional behavior?

 
Ann

I also wanted to know how can we configure sonarqube with aws codepipline( my pipeline is configured in such a way that whenever there is a new commit in github, my dev pipeline runs)

Hi,

That’s a new question. Can you open a new thread for it? We try to keep it to one question per thread. Otherwise it gets messy, fast.

 
Ann

I have my monorepo configured with a single CI pipeline, can we run the scan only for the specific project which is modified instead of scanning all of the monorepo all the time.

Hi,

I’m not sure we have an official position on how to run normal analysis of a monorepo. My gut reaction is that you’ll just need to narrow sonar.sources and/or use exclusions.

 
Ann

Sorry, I didn’t quite understand that, can you explain it a little more

Hi,

What I mean is basically that for each project in the monorepo, be selective about the sonar.sources definition.

 
HTH,
Ann