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

Better auto-closing issues in PR template #35979

Closed
1 task done
Michael21107 opened this issue Jan 17, 2025 · 9 comments
Closed
1 task done

Better auto-closing issues in PR template #35979

Michael21107 opened this issue Jan 17, 2025 · 9 comments
Labels
content This issue or pull request belongs to the Docs Content team contributing docs Content related to our contributing docs

Comments

@Michael21107
Copy link
Contributor

Michael21107 commented Jan 17, 2025

Code of Conduct

What article on docs.github.com is affected?

N/A

What part(s) of the article would you like to see updated?

N/A

Additional information

The PULL_REQUEST_TEMPLATE.md is currently set up so that the issue linked, that the PR is supposed to close, is under ''Closes:''. This makes it, so the issue, although linked, isn't automatically assigned as one that is closed upon merging the PR. I think it would be nice to make it ''natural'', to link such an issue somewhere where it is auto-assigned as a ''closing'' one.

Example of a PR, that didn't trigger the closes automation of a linked issue upon merging.

@Michael21107 Michael21107 added the content This issue or pull request belongs to the Docs Content team label Jan 17, 2025
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Jan 17, 2025
@nguyenalex836
Copy link
Contributor

@Michael21107 Good to hear from you again! 💛 Thank you so much for opening this issue. Just to make sure I'm following you, I'll do a quick recap:

  1. When Add a section for the Important alert type to the style guide #35875 merged, the corresponding issue (the ''important'' alert isn't documented #35860) didn't close as the Closes keyword and the issue itself were on two separate lines, as noted by here!

Was written like this:

Closes:
https://github.com/github/docs/issues/35860

instead of like this:

Closes: https://github.com/github/docs/issues/35860
  1. Given your comment:

I think it would be nice to make it ''natural'', to link such an issue somewhere where it is auto-assigned as a ''closing'' one.

what would you think of modifying line 7 of the PULL_REQUEST_TEMPLATE.md to read something like this? 🤔

Closes: [Be sure to link the issue on this line!]

This would hopefully prevent folks from accidentally linking their corresponding issue on a different line, and keep the Closes automation intact ✨ Eager to hear your thoughts!

@nguyenalex836 nguyenalex836 added contributing docs Content related to our contributing docs and removed triage Do not begin working on this issue until triaged by the team labels Jan 17, 2025
@Michael21107
Copy link
Contributor Author

I think that's good. I'd also remove the empty line between the comment and the ''closes'' line as that is IMO encouraging people to use the empty line, and not continue right after Closes:.

@nguyenalex836
Copy link
Contributor

Awesome! Let me loop in one of our technical writers @subatoi to get his thoughts on the potential changes to the PULL_REQUEST_TEMPLATE.md 💛

@subatoi
Copy link
Contributor

subatoi commented Jan 20, 2025

👋 Hi, thanks for the ping.

I think all that sounds fine—I would recommend using a placeholder that follows our guidelines for placeholder format and which is enclosed in backticks to ensure it's parsed as we'd like:

Closes: <YOUR ISSUE>

Happy to open this up.

@Haywhy28

This comment was marked as spam.

@nguyenalex836
Copy link
Contributor

Thank you for the guidance @subatoi! ✨

@Michael21107 Would you be willing to open up a PR for this? 💛

@Michael21107
Copy link
Contributor Author

@Michael21107 Would you be willing to open up a PR for this? 💛

On it.

@subatoi Could the text say #<issue number>?

@subatoi
Copy link
Contributor

subatoi commented Jan 21, 2025

In hindsight my guidance was a little out of date: here's our formalised placeholder guidance https://docs.github.com/en/contributing/style-guide-and-content-model/style-guide#placeholders

So to answer your question, I would say yes, but with a small further tweak (uppercase/kebab-case, but no </> characters)

Closes ISSUE-NUMBER

@nguyenalex836
Copy link
Contributor

nguyenalex836 commented Jan 22, 2025

@Michael21107 Howdy! An internal PR on which you were added as a co-committer will be merged shortly 💛

We decided to opt for using ISSUE_NUMBER (with an underscore) as the placeholder, as one of our engineers pointed out this enables selecting the entire placeholder when double clicking ✨

Thank you again for helping us improve this template! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team contributing docs Content related to our contributing docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants