Read Anthropic’s case study about Graphite Reviewer

How to label pull requests based on review status

Sara Verdi
Sara Verdi
Graphite software engineer
Try Graphite


Note

This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.


By effectively using GitHub pull request labels, teams can easily track the progress of their PRs and prioritize their reviews. This guide will explain how to implement a labeling system for PRs based on their review status for teams to maintain consistent communications.

Pull request labels are tags that can be applied to PRs to indicate their status, category, or any other relevant information. They help teams quickly identify the state of a PR and facilitate better project management. To effectively organize PRs, you can implement the following review status labels:

  • Needs review: This label indicates that the PR is ready for review and requires attention from reviewers.
  • In review: Use this label when the PR is currently being reviewed by one or more team members.
  • Changes requested: This label signifies that the reviewer has requested changes to the PR, indicating it cannot be merged until the issues are addressed.
  • Approved: When the PR has been reviewed and approved, this label should be applied, indicating it’s ready for merging.
  • Waiting for response: This label is used when the reviewer is awaiting feedback or responses from the author before proceeding.
  • Merged: Once the PR has been successfully merged, this label marks its completion.
  • Closed: This label can be applied when a PR is closed without merging, indicating that the work is not going forward.
  1. Access your GitHub repository: Navigate to the repository where you want to set up your labels.

  2. Go to the "Labels" tab: On the main page of the repository, click on the “Issues” tab, then select the “Labels” option from the submenu. Alternatively, you can access the labels through the "Pull requests" tab.

  3. Create new labels: Click on the “New label” button to create your desired labels. For example:

    • Label name: Needs review
    • Color: Choose a distinctive color (e.g., yellow)

    Repeat this for each label you want to create for review status.

Now that you have your labels set up, you can begin labeling PRs based on their review status. Here’s how:

  1. Open a pull request: Go to the “Pull requests” tab in your repository and select a PR that needs labeling.
  2. Add labels: On the right side of the PR page, you will see a “Labels” section. Click on the gear icon to manage labels. Select the appropriate label based on the current status of the PR (e.g., if it’s ready for review, select “Needs review”).

As the review process continues, it’s essential to update the labels on the PR to reflect its current status. For instance:

  • When a reviewer starts looking at the PR, change the label from Needs review to In review.
  • If changes are requested, update the label to Changes requested.
  • Once the PR is approved, switch the label to Approved.

This practice keeps all team members informed about the PR’s status and helps prioritize which PRs require immediate attention.

By labeling PRs based on review status, you can easily organize and filter them in GitHub. Here’s how:

  1. Filter by labels: In the “Pull requests” tab, use the filter option to display PRs based on specific labels. For example, you can filter to show only PRs labeled as Needs review to focus on those that require immediate attention.
  2. Utilize the GitHub Projects feature: If you use GitHub Projects for task management, you can link your labeled PRs to specific columns based on their status (e.g., “In Review,” “Awaiting Response”). This integration enhances visibility and tracking.

Graphite's PR inbox provides a centralized view of all pull requests associated with your project. It not only displays the current status of each PR but also integrates the labeling system to provide insights into their review status. By using Graphite’s PR inbox, teams can easily visualize and manage their PRs, which makes it simpler to filter and sort them based on the applied labels.

In addition to using tools like Graphite, here are some other best practices for managing and labeling your PRs:

  • Keep it consistent: Ensure all team members understand the labeling system and apply labels consistently.
  • Automate labeling: Consider using GitHub Actions to automate the labeling process based on specific events (e.g., automatically labeling PRs as Needs review when they are opened).
  • Review label relevance: Periodically review the labels in your repository to ensure they still serve their purpose and make adjustments as needed.

By implementing an effective system for labeling pull requests based on status, your team can improve collaboration and help keep your projects on track. Plus, clear visibility into PR statuses allows for better prioritization and smoother workflows, ultimately leading to more efficient feedback and development cycles.

Built for the world's fastest engineering teams, now available for everyone