Skip to content

Add routine to add changelog news fragment#181

Merged
kitchoi merged 5 commits into
masterfrom
change-fragments
Nov 5, 2020
Merged

Add routine to add changelog news fragment#181
kitchoi merged 5 commits into
masterfrom
change-fragments

Conversation

@kitchoi
Copy link
Copy Markdown
Contributor

@kitchoi kitchoi commented Nov 4, 2020

This PR proposes a small developer workflow to add news fragments for the generation of Changelog.

The idea is that a PR will contribute a small fragment to the changelog, if the changes from the PR is news worthy for the end-users. This will ease the process of having to parse and digest many PRs at the time of making a release. That manual process is particular tedious for PRs that are merged around the time of a previous release but not actually included in that release (this is more of an issue for projects that run a maintenance branch and have many PR activities).

Similar routines can be found in CPython, NumPy, SymPy and various other projects. This is a cheap first-cut solution, without nice tooling like GitHub bots etc.

This PR

  • Adds GitHub Pull Request template to remind us of news fragments
  • Adds two commands in etstool.py for creating news fragments and building the changelog from the fragments.
  • Adds README for the folder that will contains the fragment (also referred to by the GitHub PR template).

Currently this is an experiment, and maybe be removed or replaced in the future subject to evaluation.

Comment thread docs/releases/README.rst

Add a news fragment
-------------------
Create a new file with a name like ``<pull-request>.<type>.rst``, where
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The obvious flaw here is that if you try to do this before opening a PR, you don't know the PR number. So you would either have to guess it, or do this step right after opening a PR. This is why having a GitHub bot would be nice, but it is the best we could do with the least effort right now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a step towards making life easier for ourselves so for now, it's fine if PR authors have to add the news fragment after opening the PR.

Copy link
Copy Markdown
Contributor

@aaronayres35 aaronayres35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I tested both the python etstool.py changelog create and python etstool.py changelog build commands locally and they seem to work as expected.

As you mentioned this is a first-cut generation, so the results still need a little tweaking but that is perfectly fine for now. Some tweaks could be made so that the new updates get added to the changelog after the

Apptools CHANGELOG
==================

at the start of the file. Similarly the version number could be extracted from setup.py. In any case we don't need to address these minor things now (ignore me).

@kitchoi
Copy link
Copy Markdown
Contributor Author

kitchoi commented Nov 4, 2020

Thank you @aaronayres35

@rahulporuri is this okay to be merged? We can treat this as a trial and then evaluate (probably after the next release) whether we should keep / change this.

Copy link
Copy Markdown
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome :D I tested the two click commands and they work as expected.

Just to be sure, the release process now involves removing the files - which needs to happen in the PR which bumps version to continue development on master branch. Is that correct?

@kitchoi
Copy link
Copy Markdown
Contributor Author

kitchoi commented Nov 5, 2020

Just to be sure, the release process now involves removing the files - which needs to happen in the PR which bumps version to continue development on master branch. Is that correct?

Ah good point. Initially I was thinking of doing the changelog in a PR separate from the one that bump the version. But then I think I was thinking of the maintenance branch + release candidate scenario in Traits, TraitsUI and Pyface where the maintenance branch is created before the release: One would update the changelog and clear the news fragments in the maintenance branch. After a release is made, the updated changelog (including the 'deletion' of new fragments) are merged back to the master. That is where we can avoid missing changes that are merged around a release but not included in the release. The news fragments made for changes on master that are not included in a release will not be affected (I think git hashes/indexes files, not folders).
(e.g. traitsui#1383 was not included in TraitsUI 7.1.0 but was merged before the release PR, so it is at risk of being lost in the next changelog update if one just scans the list of merged PR).

Your idea of doing the changelog update and the removal of files in the same PR that bumps the version makes sense in the scenario where we are doing the simple single PR release process from master without release candidates.

@kitchoi kitchoi merged commit 3b7d4c1 into master Nov 5, 2020
@kitchoi kitchoi deleted the change-fragments branch November 5, 2020 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants