Quality Gate
Why is my Pull Request blocked with an error saying 'Quality gate failed'?
Feature Flag dynamically enables or disables features at runtime based on user or tenant identity; Quality Gate uses automated tests during development to stop broken builds before production.
CI is the automated pipeline workflow that clones repositories and runs test scripts; Quality Gate is the rule set deciding whether results qualify for approval or immediate blocking.
When to use it
- Enable branch protection so pull requests cannot merge until all quality gates passSee field rules at a glanceemailRequired · email formatpriceNumber · greater than 0roleuser / admin
- Require passing unit tests, clean lint reports, and type checks to stop regressions earlyKeep rules together in one schemaemail: string().email()price: number().positive()role: enum(["user", "admin"])
- Define unambiguous thresholds such as zero fatal errors and 100% passing test suitesWrite to the database only after validation passesReceive input→Rule check→Write to database
- Inspect CI failure logs to guide AI assistants on exact failing files and errorsErrors should point to the specific field.Product price-3Below the inputPrice must be greater than 0
When NOT to use it
- Abuse administrator privileges to bypass failing gates and push broken code to mainPage-side checks can be bypassedSkip form→Request API directly→Backend still needs validation
- Set flaky or intermittent tests as blocking gates, paralyzing regular development mergesDo not silently change critical data.User inputPrice -99 → System silently changes it toPrice 99Reject it clearly and ask the user to confirm.
- Set unrealistic thresholds like demanding 100% coverage on day-one prototype codeDo not show internal errors to users.PrismaClientKnownRequestErrorat node_modules/runtime/library.js:129:42The page should say: Unable to save right now. Please try again later.
- Rely only on verbal self-testing promises without automated gate enforcement in CIStatus code and result contradict each otherHTTP200 OKResponse bodyerror: invalid emailThe frontend can easily mistake failure for success.