Quality Gates on PRs

The tutorial for setup of SonarQube states the following.

  1. Why is failing the PR not recommended based on UT Coverage or other quality gates?
  2. Deployments take place from CD, not CI. We do trunk based development with Artifact promotion (dev → stage → prod) where as the Artifact passes SQA it moves to different environments. Code is not prompted into different environments, artifacts are. How would sonarqube fail a deployment in this case?
      #  If you wish to fail your job when the Quality Gate is red, uncomment the
      #  following lines. This would typically be used to fail a deployment.
      #  We do not recommend to use this in a pull request. Prefer using pull request
      #  decoration instead.
      # - uses: sonarsource/sonarqube-quality-gate-action@master
      #   timeout-minutes: 5
      #   env:
      #     SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}


Welcome to the community!

In fact, it’s not that we recommend against failing the Quality Gate for low coverage. What we recommend is that when a PR fails the Quality Gate, instead of failing the build, you should use PR decoration to block the merge.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.