vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Try to link PRs to issues mentioned in the PR title

Open alexr00 opened this issue 3 years ago • 1 comments

Users often mention issues in commits, which then end up as PR titles:

image

Ideally, we would link the PR and the issue in GitHub. GitHub will automatically do this in when the issue is mentioned in the PR description, but not in the title.

alexr00 avatar Jul 19 '22 12:07 alexr00

We might be able to use the updatePullRequest GraphQL API mutation to set the closingIssuesReferences.

alexr00 avatar Jul 19 '22 12:07 alexr00

updatePullRequest doesn't let you set closingIssuesReferences. An alternative would be to automatically include the "fix #123" string in the description.

alexr00 avatar Aug 15 '22 11:08 alexr00

Since there is no GitHub API to link PRs and issues, I've taken the approach of adding the #123 in the PR description. This feels like a work around, and I'm not sure it's worth doing. Will decide in September.

alexr00 avatar Aug 22 '22 10:08 alexr00

To verify:

  • Make a commit that has a reference to an issue number in the same repo in the first line of the commit (see the screenshot at the top of the issue for an example).
  • Using the extension, create a PR.
  • Verify that the issue reference get copied into the PR description.

alexr00 avatar Sep 26 '22 14:09 alexr00