Commit by Pull Request

Tracking the Scale of Feature Pull Requests

Overview
Large features that touch many areas of the codebase often come with significant risk due to the volume of changes they introduce. Monitoring the scale of pull requests (PRs) can help you identify high-risk areas, avoid delays in merging, and prevent code rot—issues like unmerged PRs that can lead to forgotten changes or duplicated work.


What Does This Metric Measure?

This metric helps track large pull requests that have not been merged or closed. By analyzing the number of changes (lines modified) in open pull requests, you can identify PRs that might be at risk of lingering for too long and avoid bottlenecks in the development process.

The metric highlights potential blockers that could delay progress, ensuring these PRs get reviewed and merged in a timely manner to maintain steady development.


How Is This Metric Calculated?

This data is generated by:

  1. Identifying open pull requests: All open pull requests that are not closed or merged are considered.

  2. Counting the number of changes: For each open PR, the metric counts the total number of lines changed in the associated commits.

This provides a quantitative measure of the scale of changes in each open PR.


What Questions Can I Answer from This Data?

This metric helps answer several key questions about pull request activity:

  1. What is the average number of commits per pull request?
    Understanding the average commit volume per PR helps gauge whether PRs are becoming larger or more granular over time.

  2. Are there correlations between PR commit volume and other factors (e.g., team size, project complexity)?
    Explore if PR size is influenced by team size, project complexity, or other factors, helping you anticipate how different variables affect the scale of changes.

  3. What trends are emerging over specific time periods for PR commit volume?
    Track how commit volume in PRs changes over time—whether it increases during certain phases of development or correlates with specific project milestones.


What Should I Take Away from This Data?

  1. Size and Complexity
    Larger PRs, indicated by higher commit volume, often correspond to more complex features or changes. These larger PRs require careful attention and thorough review to ensure they don’t introduce issues.

  2. Review and Integration Effort
    PRs with a high number of commits generally require more in-depth reviews and extensive testing to ensure the quality of the code. Teams should plan for additional time to thoroughly test and integrate large PRs to avoid introducing bugs or regressions.

  3. Risk Management
    Large pull requests that are left open for extended periods may signal development blockers or lack of focus. Regularly monitoring PR size and merge times helps to prevent delays and ensures smoother, more predictable delivery.


Conclusion

Tracking the scale of pull requests is essential for identifying potential bottlenecks and risks in your development process. By keeping an eye on large PRs and their commit volume, you can ensure that complex features are merged on time, reducing the risk of code rot, and maintaining steady project momentum.