aiidateam / aiida-quantumespresso

The official AiiDA plugin for Quantum ESPRESSO
https://aiida-quantumespresso.readthedocs.io
Other
52 stars 77 forks source link

Devops: Add script to update `CHANGELOG.md` #921

Closed mbercx closed 1 year ago

mbercx commented 1 year ago

Add a GitHub workflow that automatically gathers the commits since the last release tag and prepends the list to the CHANGELOG.md. The pull request hashes are also converted into links to the corresponding pull request.

mbercx commented 1 year ago

Note: even though I think the GitHub workflows are fun to play around with, in hindsight it may be more sensible to have a pre-commit hook for this. Consider only having to do:

  1. git checkout -b release/v4.3.0
  2. Change version in __version__.
  3. git commit -am 'Release v4.3.0' -> pre-commit automatically does first draft update of CHANGELOG.md
  4. Finalise CHANGELOG.md
  5. git commit -a
  6. git push -u origin
  7. Open PR

The current workflow is slightly more complicated. After the first two steps:

  1. git commit -am 'Release v4.3.0'
  2. git push -u origin -> GitHub action automatically does first draft update of CHANGELOG.md
  3. git pull changes locally
  4. Finalise CHANGELOG.md
  5. git commit -a
  6. git push origin
  7. Open PR

I mean, it's two steps less 😁. That said, the GitHub action allows the check to be more specific to only release/** branches.

In any case, I'd still have to learn how to actually write a pre-commit hook, so...

... Of course, we could also just run the script manually now that I think of it. 😅 Not nearly as badass though, but:

  1. python .github/scripts/update_changelog.py -> automatically does first draft update of CHANGELOG.md
  2. Finalise CHANGELOG.md
  3. git commit -am 'Release v4.3.0'
  4. git push -u origin
  5. Open PR
mbercx commented 1 year ago

After some discussion it was decided to just convert this into a script the maintainer can run locally. Much more sensible since they can just adapt the CHANGELOG.md afterwards and then continue with the release.

@sphuber I put the scripts in a dev folder in the root folder of the repo. We can also start adding scripts there to e.g. trim output files for the text fixtures. What do you think?