8000 Add PR links to the issue · Issue #501 · python/bedevere · GitHub
[go: up one dir, main page]

Skip to content

Add PR links to the issue #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ezio-melotti opened this issue Aug 18, 2022 · 5 comments · Fixed by #511
Closed

Add PR links to the issue #501

ezio-melotti opened this issue Aug 18, 2022 · 5 comments · Fixed by #511

Comments

@ezio-melotti
Copy link
Member

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
@zware
Copy link
Member
zware commented Aug 18, 2022

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 :)

@ezio-melotti
Copy link
Member Author

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?

@CAM-Gerlach
Copy link
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.

@ezio-melotti
Copy link
Member Author

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

@zware
Copy link
Member
zware commented Aug 18, 2022

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0