Quality Gate Not Failing Even When Issues Exist in SonarQube

I have configured a SonarQube Quality Gate in my project, setting the condition to fail if the issue count is greater than 0. However, despite having issues in the code, my GitLab CI/CD pipeline still passes instead of failing as expected.

Here’s my setup:

  • SonarQube Version: (mention your version, e.g., SonarQube Community v24.12.0)
  • Quality Gate Condition: Issue count > 0 → FAIL
  • GitLab CI/CD Integration: Using SonarQube scanner in the pipeline
  • Observed Issue: The pipeline completes successfully even when issues exist

Can anyone help here?

Hi,

Welcome to the community!

I invite you to familiarize yourself with the FAQ, and in particular, this section:

I created a topic, when can I expect a response?

This is an open community with people volunteering their free time to provide assistance. We’re eager to contribute to the community, but you are not guaranteed a fast response.

Be patient

  • Wait a few days before bumping a topic that hasn’t received a response.

Regarding your question, failing the pipeline for a failing Quality Gate doesn’t happen automatically; not everyone wants that.

The docs should help you get it set up.

 
HTH,
Ann