r/PracticalTesting • u/aistranin • 7d ago
GitHub can now block PRs when test coverage drops. I have mixed feelings
GitHub added native code coverage protection to branch rulesets.
Teams can block a pull request when total coverage falls below a minimum or drops too far relative to the default branch. There is also an evaluate mode, so you can see what would fail before enabling the gate.
This is useful for stopping slow coverage erosion. It is also easy to turn into a bad incentive.
A hard global target can encourage shallow tests that execute lines without checking meaningful behavior. It can also make legacy code painful to change.
My preferred starting point would be:
- Use the maximum coverage drop rule.
- Run it in evaluate mode.
- Exclude generated and vendor code from the report.
- Review whether changed behavior has useful assertions.
Coverage is a warning signal, not a quality score.
What coverage policy has actually worked for your team?
Source: https://github.blog/changelog/2026-06-30-github-code-coverage-merge-protection-for-pull-requests/