Skip to content

Add PR links to the issue #501

Closed

Description

@ezio-melotti

Currently, bedevere adds a convenient link to issue gh-NNNNN to the first message of a PR that includes gh-NNNNN in the title when the PR is created:
image

However, if you look at the corresponding issue, the link to the PR is lost in the issue timeline among comments, metadata changes, and mentions from other issues and PRs:

Click to see an excerpt of the issue timeline

image

The only way to find related PRs is to scroll through the whole issue history looking for mentions, and figure out which of these are PRs that solve the issue.


When a PR that includes gh-NNNNN in the title is created bedevere should:

  • add a link to the issue in the first message of the PR (this already works)
  • add a link to the PR in the first message of the issue

If more PRs that include the same gh-NNNNN are created (e.g. backports), the list of PRs in the first message of the issue should be updated accordingly. This will provide an easy way to track all related PRs.


About the implementation:

  • only PRs that include the issue in the title should be added to the list
  • PRs/issues that simply mention this issue in comments could be added to separate lists, but that's out of the scope of this issue
  • the PRs could be listed using a checklist (or even better, the upcoming improved tasklists)
  • a short notice (possibly with a link) could be added to clarify that the the list wasn't added by the OP, but by bedevere
  • this could replace the messages that bedevere adds when backport PRs are created

Activity

  1. zware commented on Aug 18, 2022

    @zware
    Member

    GitHub does now offer actual links between issues and PRs (see the "Development" section in the right sidebar of this or other issues). However, I have yet to figure out how it's actually supposed to work; the dropdown menu frequently fails to offer me anything approaching relevant, and the magic linking words to include in a message body really are quite magical. If we could that linking working reliably (possibly with help from Sir Bedevere), we could hopefully move away from having to have Bedevere edit any messages. There may be some useful documentation on this somewhere, but I have failed to find it after not looking at all :)

  2. ezio-melotti commented on Aug 18, 2022

    @ezio-melotti
    MemberAuthor

    I created this issue exactly because that feature seems to be kind of useless for our use case. As far as I understand:

    • using special keywords links the issue and PR, but also implies that once the PR is merged the issue will be closed. Since an issue might require multiple PRs (e.g. backports), we don't usually want to do that;
    • manually adding an issue to the "Development" section of a PR has the same effect as using the special keywords: i.e. it links the issue and closes it once the PR is merged.
    • I'm not sure if adding a PR to the "Development" section of an issue is also the same, but I think it is.

    In other words, currently linking and closing are coupled. We want the linking but not the closing, so we can't use the feature unless GitHub decouples them. Maybe there's already a way to do it that I'm not aware of?

  3. CAM-Gerlach commented on Aug 18, 2022

    @CAM-Gerlach
    Member

    Additionally, somewhat orthogonal, but PRs can't close other PRs, which is often useful as far as the closing aspect is concerned.

    As a sidenote, these cannot be added/changed/removed by triagers unless/until python/core-workflow#460 is resolved.

    I'm not sure if adding a PR to the "Development" section of an issue is also the same, but I think it is.

    Yes.

  4. ezio-melotti commented on Aug 18, 2022

    @ezio-melotti
    MemberAuthor

    I'm not sure if adding a PR to the "Development" section of an issue is also the same, but I think it is.

    I can confirm, I just tried to add a PR to an issue and:
    image
    and
    image

    In the PR I see:
    image
    and
    image

  5. zware commented on Aug 18, 2022

    @zware
    Member

    Ah. I had not previously realized how closely coupled they had "linking" and "closing", and some testing shows that there isn't really any way around it :(

    On the other hand, links can be made to closed issues, and issues can be reopened; it might not be a bad thing to use the GH linking as is. I for one am not great at always remembering to close an issue after merging its PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions