Seperate Quality Gates for Main Branch and Pull Requests

Hey,

I came across a new scenario for which i have not found a solution in sonar, maybe you guys can help me.

We had a quality gate with the demand of no new issues and at least 75% code coverage on new code. This of course works on the pull requests very well and on the main branch we had new code defined as the last 14 days (for the scrum sprints).

We just had the latest release and within this release we got the scenario that we needed to push some bugfixes fast which we did.

But now our main branch failed, even though we only fixed some bugs. The easiest solution would be to turn the 75% code quality on new code to overall code.
But we would like a solution in which we only look at the new code in the pull requests and only on overall code on the main branch so that a bug fix would not break our gate. As far as i can read any new code gate would also apply to the main branch.

Is there a way around that?

On what conditions did the main branch fail?

The test coverage on new code was below 75% which was fine because as said it was a bugfix that needed to get pushed as fast as possible.

It sounds like this is an exceptional circumstance best handled by a “manual override” of the Quality Gate. Before this, did you ever see a reason to have seperate quality gates?