Repository navigation
Automatically link PRs to issues #602
Description
Activity
I think we should have an automated action on PR creation/renaming that extracts the issue number and assigns it to the PR, so that it is visible from the issue list.
Bedevere already adds linked prs to the issue description. An example: python/cpython#150045 (see "Linked PRs" section). Maybe we could add some labels, that track the issue has some open prs, or that all linked PRs are merged (perhaps, it's a case to add "pending" label). Though, I'm not sure if this will be helpful.
But keep in mind, that issue can have multiple prs. Not only backports: some issues are complex and prs address them only partially. That means, if issue has linked prs - it doesn't mean you can't contribute.
I would like to work on this
So far, I don't see a clear proposal from you.
Perhaps, it's a duplicate of #581
Thanks for the suggestion.
Please could you clarify what assigning an issue to a PR means?
Is it a GitHub feature? Can you show some screnshots/links to how it's used in other repos, and link the docs?
Hi, thanks for your reply.
Yes, basically GitHub allows you to "link" PRs to issues. What this basically means is that the PR shows up on the Development section of the issue. This is useful because:
- It shows the related PR(s) in a standarized way that is easier to track
- It allows to close the issue when the PR gets merged
- On the issue list, it identifies issues that already have linked PRs, making it easier to discover those who don't (either through the UI, the API, or using agents).
=================
I was thinking different approaches:
- Modifying bedevere to include a linking keyword when referencing issues on the PR body (https://github.com/python/bedevere/blob/f43dfa90f2e36d857f747278ad24bf60e314e1d1/bedevere/util.py#L21)
- Create a GitHub action that automatically creates a comment with the linking keyword
- Create a GitHub action that assigns labels automatically (Improve finding issues without a pull request to work on #581)
I am personally happier with option 1 but don't know if that has been explored already.
Docs says:
When you merge a linked pull request into the default branch of a repository, its linked issue is automatically closed.
That's certainly so, if you link to issues, using keywords. Does it "works" in same way to manually linked issues? If so, I don't think it's acceptable for CPython: as I said, issue can have multiple prs.
Yes. You are right. I now realize there is not a 1:1 relationship. Maybe we could do something like a "has PR" label (non intrusive, and as you say, people can still contribute, comment or make follow up PRs)
As many, I want to start contributing to the project by finding un-claimed issues. However, by the way the repo is set up, finding them is difficult.
Taking advantage of the GH-XXXX convention, I think we should have an automated action on PR creation/renaming that extracts the issue number and assigns it to the PR, so that it is visible from the issue list.
I would like to work on this, but want to know other people's opinions/alternatives.