Skip to content
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

Clarify how to add issue numbers in PR template and CONTRIBUTING.md #8833

Merged
merged 6 commits into from
Jun 23, 2023

Conversation

tianyizheng02
Copy link
Contributor

Describe your change:

Fixes #8735

Per the discussion in #8735, I've updated the last checkbox in the PR template to specify that issue numbers should go in the description of the PR. There's also a link to the GitHub docs page on the topic for those contributors who care to look into it further.

I've also elaborated on the paragraph discussing issue numbers in the contributing guidelines by providing an example of adding an issue number. Hopefully that'll be enough for most contributors (who actually read the guidelines) to know what to do.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@@ -17,4 +17,4 @@
* [ ] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
* [ ] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
* [ ] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
* [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.
* [ ] If this pull request resolves one or more open issues then the description above includes the issue number(s) with a [closing keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue): "Fixes #ISSUE-NUMBER".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [ ] If this pull request resolves one or more open issues then the description above includes the issue number(s) with a [closing keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue): "Fixes #ISSUE-NUMBER".
* [ ] If this pull request resolves one or more open issues then the commit body (not commit title) includes the issue number(s) with a [closing keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue): "Fixes #ISSUE-NUMBER".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worded it as "PR description" rather than "commit body" because I was thinking that we should have the issue number here:
PR text box with issue number
because only then does GitHub link the PR itself to the issue. When you put the issue number in the commit title/body but not the PR description, GitHub only links that specific commit but not the rest of the PR:

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.

I believe this means that we wouldn't see indications like this:
screenshot 2
which would make it harder to track linked issues/PRs.

While it's true that adding the issue number to the commit body means that GitHub can automatically add it to the PR description as well, that doesn't happen if the PR consists of multiple commits.

tianyizheng02 and others added 2 commits June 23, 2023 02:20
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@cclauss cclauss enabled auto-merge (squash) June 23, 2023 13:56
@cclauss cclauss merged commit 267a8b7 into TheAlgorithms:master Jun 23, 2023
@tianyizheng02 tianyizheng02 deleted the update-pr-template branch June 23, 2023 19:53
sedatguzelsemme pushed a commit to sedatguzelsemme/Python that referenced this pull request Sep 15, 2024
…heAlgorithms#8833)

* updating DIRECTORY.md

* Clarify wording in PR template

* Clarify CONTRIBUTING.md wording about adding issue numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add suggested change from review to CONTRIBUTING.md

Co-authored-by: Christian Clauss <cclauss@me.com>

* Incorporate review edit to CONTRIBUTING.md

Co-authored-by: Christian Clauss <cclauss@me.com>

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@isidroas isidroas mentioned this pull request Jan 25, 2025
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Put issue numbers in PR description, not in PR title
2 participants