Quality gates for different branch In a project

Hi,

I’m using sonarqube developer edition version 8.1

I was just wondering if there is a way to configure different quality gates for each branch in a specific project ? We’re now using the sonarqube recommended quality gate for all of our projects.

Thank you

Hello @fhumera,

Welcome to the SonarSource community. :wave: . I hope you’ll enjoy it
You can configure different quality gates for different projects but you cannot configure different quality gates for different branches of a same projects. We don’t see a use case for that.
If what use case/context would you need to do that ?

Olivier

Thank you for your response Olivier.
I would like to have a different quality gate for the test branches on bitbucket compared to the master branch. Is there a way to configure something like that in sonarqube ?

Farheen

Does it make sense to use a liberal quality gate for test (= feature ?) branches
when i’ll get issues after merging to master and scanning the master branch with
a stricter quality gate !?

Read liberal and stricter as example for different quality gates.

Gilbert

I already understood what you want to do, what I am trying to understand is why you want to do that, which you don’t explain above.

@Rebse gave a possible guess.

I am not super convinced by the use case. If you want to be permissive on a branch to test something, then you should not care about failing the quality OR you should analyze the test code as a separate project (use a different sonar.projectKey), where you can use a different quality gate.

So in conclusion, what you want to doe @fhumera is current not possible and we could only consider changing that if we have a good use case demonstrating the relevance of that feature.