All articles
Article 3 min read

Ayo GitHub Quietly Killed the Unreviewable Mega-PR

If you've ever opened a PR with 47 changed files and a diff so long GitHub just gives up and shows...

Introduction

GitHub, known for its user-friendly interface and extensive documentation, has recently made significant changes to how they handle pull requests (PRs). One of the notable adjustments involves dealing with mega-PRs – those that exceed certain limits in terms of file modifications. The article "Ayo GitHub Quietly Killed the Unreviewable Mega-PR" by Lovestaco highlights a change in behavior where GitHub stopped allowing extremely long diffs, effectively ending mega-PRs.

Prior to this adjustment, PRs with up to 47 changed files would not trigger any specific warnings or limitations. However, when these PRs grew larger, users often encountered issues like lengthy diffs that became impractical for review and caused the diff viewer to crash. This led to a frustrating experience for contributors who had to constantly manage their code changes.

Prior Handling of Mega-PRs

The previous approach by GitHub meant that mega-PRs could still be opened, but they were marked as "unreviewable." Essentially, these PRs became dead ends if not resolved quickly due to the impracticality of review. Users found themselves in a situation where their work was essentially stagnant until it could either resolve or close.

New Approach: Unreviewable Mega-PRs

With the introduction of new guidelines, GitHub now categorizes mega-PRs as "unreviewable." This means that once these PRs exceed the limit (presumably 47 changed files), they cannot be opened. Instead, contributors receive an immediate notification indicating that their proposed changes would not meet GitHub’s standards for reviewability.

#### Example Code to Illustrate New Guidelines

For instance, if a contributor were to submit a PR with over 47 different file modifications:

python
def handle_mega_pr(changed_files_count):
    """Handles mega-PRs by marking them as unreviewable."""
    if changed_files_count > 47:
        print("PR is unreviewable due to excessive changes.")

This function mirrors the current GitHub policy shift, where once a PR exceeds a certain threshold (in this case, 47 files), it triggers an immediate message indicating that review would be impractical. The implication here is that contributors should aim for more manageable PR sizes to ensure their work is reviewed promptly.

Impact and Future Considerations

This new approach not only improves the user experience but also streamlines GitHub's operations by ensuring that reviews are efficient and focused. It helps maintain a healthy workflow where code contributions can be quickly evaluated without being hindered by overly large or unmanageable PRs. As a result, developers may find themselves more motivated to organize their changes in smaller batches, fostering better coding practices.

In conclusion, GitHub's decision to mark mega-PRs as "unreviewable" underscores the importance of maintaining user-friendly interfaces while also implementing practical solutions for managing and reviewing code contributions efficiently. This change highlights GitHub’s ongoing commitment to improving developer workflows and user satisfaction.