Linking pull requests (PRs) to issues in GitHub can make sure that code changes are traceable to specific requirements and facilitate automatic issue closure upon PR merge. This guide will explain the process and how you can manage these links within the Graphite PR inbox.
Using GitHub to link PRs to issues
1. Mentioning an issue in your PR
The simplest way to link a PR to an issue is by mentioning the issue number in your PR description or in a comment within the PR. GitHub automatically creates a link to the mentioned issue. For example, if your issue number is 123
, you can mention it in your PR like this: #123. This method will automatically link the PR to the issue, allowing anyone to navigate between the two easily.
2. Using keywords to close issues
GitHub supports several keywords like fixes
, resolves
, or closes
that you can use in your PR descriptions or commits to not only link your PR to an issue but also close the issue when the PR is merged. For example:
Fixes #123
This will close issue #123 automatically when the PR is merged into the main branch.
3. Linking without closing
If you want to link a PR to an issue without closing the issue upon the PR's merge, simply mention the issue number without using any of the closing keywords:
Related to #123
4. Using GitHub Projects to manage links
If you're using GitHub Projects, you can link PRs to specific issues by adding them to the same project board. This can be done from the issue or PR side by clicking on Add to project
and selecting the relevant project and column.
Leveraging the Graphite PR inbox for enhanced management
Graphite's PR inbox offers a structured way to view and manage PRs that are linked to issues, which helps you stay organized and keep track of PRs requiring your attention. You can readily see which PRs are returned to you, need your review, or are approved.
Custom sections and filters
You can create custom sections in your Graphite PR inbox to categorize PRs based on whether they are linked to issues, are in draft, need reviews, or are ready for merging. This helps in quickly navigating and prioritizing work.
Sharing filters and configurations
Graphite allows you to share your PR inbox configurations with teammates. By sharing filter setups that include PRs linked to specific issues, team members can replicate these sections in their own inbox, ensuring everyone is aligned on the status of linked PRs and issues.
Search capabilities
Utilize Graphite's fuzzy search feature within the PR inbox to quickly find PRs by title, description, author, or linked issue number. This can be a powerful tool when managing multiple links across a large project.
Conclusion
Linking PRs to issues in GitHub can streamline your workflow by making dependencies clear and actions traceable. Combining this practice this with tools like Graphite's PR inbox enhances visibility and coordination among team members, leading to better overall project management.