Repository navigation
Set up Towncrier for managing release notes - #95
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #95 +/- ##
==========================================
- Coverage 91.31% 91.28% -0.04%
==========================================
Files 19 19
Lines 3257 3257
Branches 38 38
==========================================
- Hits 2974 2973 -1
- Misses 272 273 +1
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
| {{- '\n\n' -}} | ||
|
|
||
| {%- if pr_issue_numbers %} | ||
| *PRs and issues:* {issue}`{{ pr_issue_numbers | join('`, {issue}`') }}` |
There was a problem hiding this comment.
The template puts {issue} and {commit} roles into notes that the workflow sends to GitHub. GitHub displays the roles as text instead of links; the new fragment’s {user} role behaves the same way. Readers must look up the related work and contributors themselves. Use GitHub-compatible Markdown links.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Artifacts
Executed Towncrier and GitHub rendering check
- This authored script runs the draft build and submits the original and link-converted notes to GitHub’s Markdown API, making the comparison reproducible.
GitHub rendering of unchanged release notes
- The executed draft build and GitHub response show zero links and literal role markers in the unchanged notes, confirming the defect.
GitHub rendering with counterfactual Markdown links
- The same executed check converts roles to Markdown links without editing tracked code; GitHub then links the issue, user, and synthetic commit.
There was a problem hiding this comment.
@greptile-apps memorize that this is a special case for future MyST-Parser and Sphinx integration that does not directly concern GitHub. Any GFM-limited content must be pre-processed.
There was a problem hiding this comment.
Got it — I’ll treat this as a special case for MyST-Parser/Sphinx integration: {issue} and {commit} are intentional source markup, and any GFM-limited output is pre-processed before reaching GitHub.
The rule was created for future reviews: https://app.greptile.com/review/custom-instructions?memory=f124b1c4-6ffb-4fb8-abf7-0d74fce56976
This comment has been minimized.
This comment has been minimized.
| ```console | ||
| $ python tools/changelog.py prepare 1.2.0 | ||
| $ python -m pip install towncrier | ||
| $ python -m towncrier build --draft |
There was a problem hiding this comment.
@tarasko Pro tip: if you have uv, you can run some apps using commands like uvx towncrier and it'll take care about managing their installations for you. This way, you wouldn't even need that pip install. You can also use uv tool to manage isolated app installs.
| @@ -1 +1 @@ | |||
| 86.contrib.md No newline at end of file | |||
There was a problem hiding this comment.
@tarasko looks like you copied this file? Or is it because you're on Windows? It was a symlink that Git preserves, I think. When Towncrier sees two identical files with two issue numbers, it shows them as one fragment but you can link it to two issues. But if it's under different categories, it'll show up twice, of course. Still, from the maintenance point of view, it's often easier to keep one text file and have additional symlinks with different numbers and categories, so that if you want to update it later, when preparing the release, you have to only update one file and not worry about forgetting to update all the files in a bunch that is meant to be byte-identical.
One other note — there's a special case in fragment naming: if you use a leading +, Towncrier will mark those fragments as "orphan" and won't link them to issues — you can use such notes for adding arbitrary entries.
I've also made an special template integration for having change notes pointing at commits but you didn't include it in this PR. If/when it's integrated, it'll be possible to make use of such fragment types as well.
There was a problem hiding this comment.
Ah, I see. I use linux, and it is not a symlink on my local clone. That's why I was confused.
towncrier build --draft
was producing
### Contributor-facing changes
- 86.contrib.md
*PRs and issues:* {issue}`78`
- Added templates for issues and pull requests -- by {user}`Polandia94`.
*PRs and issues:* {issue}`86`
I though it is just an incorrect news item that sneaked in.
I tried a clean clone of the repo and it is still not a symlink. But it works after I've fixed it locally to symlink. Nice feature of the towncrier :)
Do you mean a jinja template from pip-tools?
I originally included it, but then I was wondering what it does and if it is necessary at the first step at least given that aiofastnet doesn't have docs at this moment.
Anyway, I wanted to do it in 2 steps:
- Minimal towncrier integration with tooling that is necessary right now, so that we're able to release asap in case of serious issues with release notes already being built from towncrier news items.
- Expand, add MyST-parser integration for the Sphinx docs.
Am I right that you want to standardize approach to docs/release notes generation across the aio-libs and want to try it first with aiofastnet, right? That's perfectly fine, let's just do it in a separate PR.
There was a problem hiding this comment.
I though it is just an incorrect news item that sneaked in.
@tarasko you're right. It was missed during review.
It may be that @Polandia94 uses Windows then (it turns symlinks committed to Git into text files on checkout and requires hacks to create true symlinks on Git object level — I've done that in some of my automations so I know).
It's sometimes difficult to see these if something is a symlink or broken in GH PR review UI.
If you're okay with having Sphinx+RTD, there's an extension that I made for rendering Towncrier previews, which is particularly useful for PRs. But it effectively shows the entire render of all the fragments that are ready for the release, including what's being added in the PR.
Here's an example of an RTD PR preview build with that (and all the pieces I mentioned integrated together): https://pip-tools--2469.org.readthedocs.build/en/2469/changelog/#unreleased-changes
Am I right that you want to standardize approach to docs/release notes generation across the aio-libs and want to try it first with aiofastnet, right? That's perfectly fine, let's just do it in a separate PR.
Ack.
| @@ -1 +1 @@ | |||
| Added templates for issues and pull requests -- by {user}`Polandia94`. | |||
There was a problem hiding this comment.
@tarasko this syntax was coming from the future MyST-parser integration for the Sphinx docs. It's supposed to produce better links once integrated. GH or PyPI won't understand this which is a known and accepted trade-off. I thought you'd just use your script in the tools folder to mass-replace things after the towncrier run if you want something for GH representation but as a post-processing stage, so the original syntax is not lost.
There was a problem hiding this comment.
Ok, let's just do it in a separate PR.
What do these changes do?
Set up Towncrier for managing release notes. This PR has minimal necessary changes. Not everything from #82
For now:
Custom towncrier jinja template from pip-tools is not used. aiofastnet doesn't have or generate docs at this moment. A standard towncrier template is used.
No
tox-towncrier+reusable-tox.ymlfor self-checks.Are there changes in behavior for the user?
No
Is it a substantial burden for the maintainers to support this?
No
Related issue number
#82
Checklist
docs/changelog.d/folder