Regression Fix Pull Request Template
A PR template for fixing regressions with original commit reference, bisect results, test gap analysis, and prevention measures.
Detailed Explanation
Regression Fix PR Template
Regressions — features that previously worked but are now broken — require specific context that goes beyond a regular bug fix. The reviewer needs to understand what introduced the regression, why existing tests didn't catch it, and what steps will prevent similar regressions.
Template Structure
## Regression Description
<!-- What feature/behavior regressed? When was it last working? -->
## Regression Source
<!-- Which commit or PR introduced the regression? -->
<!-- git bisect result if available. -->
## Fix Description
<!-- How does this PR fix the regression? -->
## Type of Change
- [x] Bug fix (regression fix)
## Test Gap Analysis
<!-- Why didn't existing tests catch this regression? -->
<!-- What type of test was missing (unit, integration, e2e)? -->
## Checklist
- [ ] I have identified the commit that introduced the regression
- [ ] I have added a regression test
- [ ] The regression test fails against the regression-introducing commit
- [ ] The regression test passes with this fix
- [ ] All existing tests pass
## Prevention Measures
<!-- What can prevent similar regressions? -->
<!-- e.g., New test suite, CI check, code review focus area -->
## Testing
<!-- How was the fix verified? -->
## Related Issues
<!-- Fixes #(issue number) -->
<!-- Introduced by #(PR number) -->
Regression Source Identification
Knowing exactly which commit introduced the regression is valuable for understanding the root cause. git bisect is a powerful tool for finding the specific commit, and documenting the bisect result helps reviewers understand the timeline.
Test Gap Analysis
The most important section in a regression fix template. If existing tests didn't catch the regression, it means there's a gap in test coverage. Identifying this gap and explaining what type of test was missing helps the team improve their testing strategy.
Regression Test Verification
The checklist specifically asks contributors to verify that the new regression test:
- Fails when applied to the commit that introduced the regression
- Passes with the fix applied
This ensures the test actually catches the specific regression and isn't a coincidentally passing test.
Prevention Measures
Going beyond fixing the immediate problem, the Prevention Measures section asks contributors to think about systemic improvements — better test coverage, additional CI checks, or new code review guidelines.
Use Case
Teams experiencing regressions after refactoring, dependency upgrades, or large feature merges, who want to build a culture of thorough regression analysis and prevention.