Utilizing keywords and correctly linking pull requests to issues can automate tedious parts of the workflow, such as closing related issues. This guide will look into how to use pull request keywords and references effectively, and how tools like Graphite's PR Inbox can optimize these processes.
Using GitHub PR keywords
Common GitHub PR keywords
GitHub supports several keywords that help automate the closure of issues when a pull request (PR) is merged. Here are the most commonly used ones:
close
closes
closed
fix
fixes
fixed
resolve
resolves
resolved
How to use keywords in pull requests
To link a PR to an issue and automate its closure upon the PR's merge, include one of the above keywords followed by the issue number in your PR description. For example:
Fixes #123
This will link the PR to issue #123, and once the PR is merged, the issue will automatically close, indicating that the problem or task the issue addressed has been resolved through the changes in the PR.
Best practices for using keywords
- Be precise: Link PRs only to the issues they are meant to resolve to avoid accidentally closing unrelated issues.
- Use in the main description: Place the keyword linkage at the end of your PR's main description for visibility.
- Review linked issues: Always review which issues are linked before merging a PR to ensure accuracy.
Using Graphite's PR Inbox to manage links
[Graphite's PR Inbox]!(https://graphite.dev/docs/use-pr-inbox) provides an interface to manage PRs efficiently. Key features include:
- Aggregated views: See all linked issues and their status directly from the PR Inbox.
- Quick actions: Easily link or unlink issues without navigating away from the inbox.
- Integrated search: Find and link relevant issues using the advanced search capabilities.
Leveraging Graphite's PR Inbox allows teams to manage their pull requests and issues more dynamically and with better oversight.
Summary
By using PR keywords and references judiciously, you automate part of the workflow, reducing the manual tracking efforts. Plus, bringing in tools like Graphite's PR Inbox further enhances visibility and control, ensuring that PRs and their linked issues are managed more efficiently and with less overhead.