Skip to content

Improve formatting of PR links added to issues #517

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

Closed
ezio-melotti opened this issue Nov 6, 2022 · 1 comment · Fixed by #518
Closed

Improve formatting of PR links added to issues #517

ezio-melotti opened this issue Nov 6, 2022 · 1 comment · Fixed by #518

Comments

@ezio-melotti
Copy link
Member

This is a follow-up of:

Currently the code generated when multiple PRs are linked to an issue looks like:

<!-- gh-pr-number: gh-98920 -->
* PR: gh-98920
<!-- /gh-pr-number -->


<!-- gh-pr-number: gh-98952 -->
* PR: gh-98952
<!-- /gh-pr-number -->


<!-- gh-pr-number: gh-98969 -->
* PR: gh-98969
<!-- /gh-pr-number -->

And the output looks like:
image

It would be better to:

  1. combine these into a single multi-item list, rather than multiple single-item lists
  2. use a checklist or tasklist instead of a regular bullet list

If the PRs are combined in a single list, we won't be able to just append a new PR to the end, but we will need to add the PR link before the closing tag (<!-- /gh-pr-number -->). In addition, the opening tag lists the PR number, so that will need to be updated too -- unless we remove the number from the tag, since it's already included in the list.

Using tasklists is probably better than checklists, and for that, the generated source should look like:

<!-- gh-linked-prs -->
``` [tasklist]
### Linked PRs
- [ ] gh-98920
- [ ] gh-98952
- [ ] gh-98969
```
<!-- /gh-linked-prs -->

(there should be no space between ``` and [tasklist], I added it here otherwise the output breaks).

Since tasklists support a title (e.g. ### Linked PRs), there is no need to repeat PR: before each PR number. (Note that tasklists are a beta feature enabled for the python org, and don't work for other orgs (yet).)

(cc @saadmk11)

@saadmk11
Copy link
Contributor

saadmk11 commented Nov 7, 2022

Hi @ezio-melotti, Thanks for creating such a detailed issue. I have added a PR with the required changes here:

As I do not have access to any repo/org with the tasklist beta feature enabled, I was only able to test the generated markdown but I was not able to test how it looks after rendering. (This PR generates markdown exactly same as the markdown you provided in the Issue body)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants