-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: changelog action & example #408
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
This is great @klmcadams! I will try to review it today |
Just curious - why did we close #357? Commits get squashed and merged anyway. |
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.
Apart from my comments - looks amazing
@klmcadams - could you add to docs/source/migration_guide.rst this new feature? (not as a breaking change - just new feature) Explain as well in migration steps the changes needed to make it work. |
I closed it because there were a ton of comments and commits, so I thought it would be easier to review if I started a new PR |
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.
We have to discuss the location of all these steps. I don't believe it's a migration guide because it is not a breaking change, but a new feature.
PS.: I know I said "add it to the migration steps guide" in my initial comment, the content is great in any case, let's just discuss where to put it =)
The changelog action uses towncrier and adds fragments (files) to a directory of your choice based on your pyproject.toml settings for towncrier. Each fragment is named in the format
pr_number
.pr_label
.md. Thepr_label
is determined by the labels in the pull request. For example, if you have the "enhancement" and "maintenance" labels, it will set thepr_label
as "added". This means the fragment will be added to the changelog under the "Added" subsection. Side note - it seems like the majority of PRs have the maintenance label, so that's why I chose to categorize the PR based on other labels other than maintenance.I think it would make the most sense to put this action at the end of the .github/workflows/label.yml file. For this action to work, you have to add the "types" line under "pull_request:" in label.yml file:
Here is an example of how to set up your repository to use towncrier/this action: https://github.com/ansys/ansys-templates/compare/demo/changelog-action?expand=1
This action will only create the fragments for the changelog. You will have to run
towncrier build --yes --version <version>
to create the changelog using these fragments. Here is an example: https://towncrier.readthedocs.io/en/stable/markdown.htmlThis PR is the same as #357 but has less commits so it would be easier to review. I figured I could go over this with everyone at the team meeting to get everyone's opinions :)