-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] DOC Encourage contributors to use keywords to close issue automatically #9954
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
[MRG] DOC Encourage contributors to use keywords to close issue automatically #9954
Conversation
@@ -218,10 +218,13 @@ rules before submitting a pull request: | |||
``sklearn.utils`` submodule. A list of utility routines available | |||
for developers can be found in the :ref:`developers-utils` page. | |||
|
|||
* If your pull request addresses an issue, please use the title to describe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave in:
* Give your pull request a helpful title that summarises what your contribution does. In some cases "Fix <ISSUE TITLE>" is enough. "Fix #<ISSUE NUMBER>" is not enough.
doc/developers/contributing.rst
Outdated
the issue and mention the issue number in the pull request description to | ||
ensure a link is created to the original issue. | ||
|
||
* If your pull request addresses an issue or continues other's work, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this more explicit:
Often pull requests resolve one or more other issues (or pull requests). If merging your pull request means that some other issues or PRs should be closed, you should `use keywords <https://help.github.com/articles/closing-issues-using-keywords/>`_ (e.g., ``Fixes #1234``, ``Closes #1234``; multiple are allowed as long as each is preceded by "Fixes", "Closes" or "Resolves"). Upon merging, those issues will automatically be closed by GitHub.
PULL_REQUEST_TEMPLATE.md
Outdated
@@ -1,9 +1,9 @@ | |||
<!-- | |||
Thanks for contributing a pull request! Please ensure you have taken a look at | |||
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#Contributing-Pull-Requests | |||
the contribution guidelines: http://scikit-learn.org/dev/developers/contributing.html#contributing-pull-requests | |||
--> | |||
#### Reference Issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "Reference Issues"
PULL_REQUEST_TEMPLATE.md
Outdated
--> | ||
#### Reference Issue | ||
<!-- Example: Fixes #1234 --> | ||
<!-- Example: Fixes #1234 / Closes #1234 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnothman Thanks :) comments addressed along with some minor improvement from myself. See the page from Circle CI. |
PULL_REQUEST_TEMPLATE.md
Outdated
#### Reference Issue | ||
<!-- Example: Fixes #1234 --> | ||
#### Reference Issues/PRs | ||
<!-- Example: Fixes #1234 / Closes #2345 / See also #3456 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was quite intentional in using . not / in my comment, to suggest that these can be used together. Is there a way that this can be clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnothman Sorry for not reading carefully for your comment.
From my perspective, "Example: Closes(Fixes?) #1234. Closes #2345. See also #3456." make me feel a bit confused. For more complex situation, seems that it might be better to mention in the contribution guide.
My original intention here is to add Closes here, since sometimes contributors may not feel that they are fixing something (e.g., continue a PR) and they can use Closes. So, I might use "Example: Fixes #1234 / Closes #2345" here.
Maybe we can add something like "If your PR is simply related to some other issues/PRs, create a link to them without using the keywords (e.g., See also #1234)" in contribution guide, but I'm not sure how useful it will be.
WDYT? I'll follow your final decision. Thanks :)
@jnothman I updated according to your suggestion along with some personal improvement. Please have a look. Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments
PULL_REQUEST_TEMPLATE.md
Outdated
@@ -1,9 +1,9 @@ | |||
<!-- | |||
Thanks for contributing a pull request! Please ensure you have taken a look at | |||
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#Contributing-Pull-Requests | |||
the contribution guidelines: http://scikit-learn.org/dev/developers/contributing.html#contributing-pull-requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather link to the markdown because it is guaranteed to be up-to-date. Also CONTRIBUTING.md is supposed to be more concise, so it is more likely that people will actually read it (or part of it).
PULL_REQUEST_TEMPLATE.md
Outdated
#### Reference Issue | ||
<!-- Example: Fixes #1234 --> | ||
#### Reference Issues/PRs | ||
<!-- Example: Fixes #1234. Closes #2345. See also #3456. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think people are more likely to read what is the template than in the doc. I would add a short sentence mentioning that this is important to automatically close the issue/PR when the PR is merged and maybe add the link to https://github.com/blog/1506-closing-issues-via-pull-requests. Proposal (feel free to reword and improve it):
<! -- Example: Fixes #1234. Closes #2345. See also #3456.
#1234 and #2345 will be closed when this PR is merged. A link will be added to #3456. This is important to keep our tracker organised. More details at: https://github.com/blog/1506-closing-issues-via-pull-requests
-->
doc/developers/contributing.rst
Outdated
* Often pull requests resolve one or more other issues (or pull requests). | ||
If merging your pull request means that some other issues/PRs should | ||
be closed, you should `use keywords to create link to them | ||
<https://help.github.com/articles/closing-issues-using-keywords/>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this link better https://github.com/blog/1506-closing-issues-via-pull-requests (which also links to you special keyword link). The reason is your link is more about closing issues via commit message and people may be confused.
@lesteve Thanks for the review :)
I have changed back the link. (note that the original link is not correct because we don't have such a session in .md file.)
I firmly agree but we might need a balance. It seems that your message is too long and make contributors hard to fill the form. It's hard for me to reply in the next couple of hours, so if you have some change in mind, you might commit directly. |
In my mind, the CONTRIBUTING.md is a subset of the other. This is what is at the top of CONTRIBUTING.md: Note also that a link to CONTRIBUTING.md is shown when opening a PR in github. It may well be that both checklists has diverged slightly. If that's true it should be fixed.
The goal is to help them to fill it better, feel free to rephrase and/or shorten it. I think I wanted to make it clearer why this was important to use this special syntax. |
@lesteve Thanks for the reply :)
Seems that it's not the fact now. E.g., The last point in the checklist in .md file is not included in the checklist in .rst file. I think we might need a copy paste between the two lists and I have done that for my part. If you disagree, I'll revert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
PULL_REQUEST_TEMPLATE.md
Outdated
@@ -1,9 +1,15 @@ | |||
<!-- | |||
Thanks for contributing a pull request! Please ensure you have taken a look at | |||
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#Contributing-Pull-Requests | |||
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use this link (goes to the right subsection):
https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#pull-request-checklist
PULL_REQUEST_TEMPLATE.md
Outdated
|
||
#### Reference Issues/PRs | ||
<!-- | ||
Example: Fixes #1234. Closes #2345. See also #3456. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use only only Fix or only Close (here and everywhere else). Fix and Close do the same and the user can look at the link for the list of possible keywords if he wants some variety.
@lesteve Thanks, comments addressed. |
CONTRIBUTING.md
Outdated
allowed as long as each one is preceded by a keyword). Upon merging, | ||
those issues/PRs will automatically be closed by GitHub. If your pull | ||
request is simply related to some other issues/PRs, create a link to | ||
them without using the keywords (e.g., ``See also #1234``). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I missed that but you need only single backticks for markdown. Please make sure that there are no other similar copy-and-paste issues.
CONTRIBUTING.md
Outdated
If merging your pull request means that some other issues/PRs should | ||
be closed, you should `use keywords to create link to them | ||
<https://github.com/blog/1506-closing-issues-via-pull-requests/>`_ | ||
(e.g., ``Fixes #1234``, ``Closes #1234``; multiple issues/PRs are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I said "use only Fix or only Close" I meant everywhere. Can you fix it here too and in all the other places this happens. Just use "Fix" or just use "Close" but not both.
@lesteve Thanks. Comments addressed. |
Thanks again @qinhanmin2014 |
Reference Issue
Fixes #9948
What does this implement/fix? Explain your changes.
It seems useful to encourage users to use keywords to create link to issue/PR they solve so that these issue/PR can be automatically closed after merging. I also provide a link to the GitHub help page, which seems useful from my perspective.
Any other comments?
I also correct the link in the pull request template.