A quality gate is a set of predefined conditions or criteria that code must meet before it can progress to the next stage of the software development lifecycle. Acting as automated checkpoints, quality gates enforce standards for code quality, test coverage, security vulnerabilities, code duplication, and other metrics. If the code fails to meet these thresholds, the pipeline is halted, preventing substandard code from reaching production.
Tools like SonarQube, SonarCloud, and various CI/CD platforms implement quality gates as configurable rule sets. A typical quality gate might require that new code has at least 80% test coverage, zero critical security vulnerabilities, no more than 3% code duplication, and a maintainability rating of A. Teams can customize these thresholds based on their project requirements and gradually tighten them as code quality improves over time.
Quality gates are a key part of modern DevOps and continuous delivery practices. By shifting quality checks left in the development process and automating their enforcement, teams catch issues early when they're cheaper and easier to fix. This approach encourages quality ownership among developers and ensures that technical debt is managed proactively rather than allowed to accumulate unchecked.