Skip to content

Put issue numbers in PR description, not in PR title #8735

Closed
@tianyizheng02

Description

@tianyizheng02

Feature description

Currently the PR template includes the following checklist item:

If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

I think it's better to ask contributors to put issue numbers in the PR description rather than the commit message for the following reasons:

  1. The vast majority of contributors to this repo (myself included) don't put closing keywords in commit messages. In my experience, the norm on GitHub is to put them in the PR description.

  2. Since contributors typically make their commits in their local git repos and not directly on GitHub, it's less convenient to include the issue number because git can't autocomplete GitHub issue numbers.

  3. A PR that resolves an issue often includes multiple commits, so no single commit single-handedly resolves the issue. Thus, putting the issue number in the PR description makes more sense IMO.

  4. From the GitHub docs:

    You can also use closing keywords in a commit message. The issue will be closed when you merge the commit into the default branch, but the pull request that contains the commit will not be listed as a linked pull request.

    Therefore, even if one puts the issue number with a closing keyword in a commit, GitHub won't automatically link the PR that it's a part of, which makes it slightly harder to refer back to the original issue.

We can also link to the GitHub docs (see above) in the checklist item to help contributors use the closing keywords correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis PR modified some existing files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions