Skip to content
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

Tip for generating release notes with GH handles #2398

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/source/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,19 @@ This task has two parts:
1. Make sure that `CHANGELOG.md` has an entry for each pull request
(PR) since the last release. This can be generated from the commit
history using `git log vX.Y.Z.. --pretty=format:"- %s [%an]"`
where `vX.Y.Z` is the last version of mitiq which was released.
where `vX.Y.Z` is the last version of Mitiq which was released.
The author names need to then be replaced with the author's GitHub
handle. An example might look like `- Update python-rapidjson requirement from <=1.6 to <1.8 (#1389) [@dependabot[bot]]`
once completed.
2. The release author should add a "Summary" section with a couple

```{tip}
Alternatively, the list of released changes can be generated via [GitHub CLI](https://cli.github.com/) with the following commands:

LATEST_TAG=$(gh release list --repo unitaryfund/mitiq --limit 1 --json tagName --jq '.[0].tagName')
gh api repos/unitaryfund/mitiq/compare/$LATEST_TAG...main --paginate --jq '.commits | reverse | .[] | (.commit.message | split("\n")[0]) + " [@" + .author.login + "]"'
Copy link
Member

Choose a reason for hiding this comment

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

Checking my understanding here: --paginate is required to ensure we don't just get the first "page" of commits in the case where there are a large number of commits in the release. Is that right?

Copy link
Contributor Author

@cosenal cosenal Jun 3, 2024

Choose a reason for hiding this comment

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

I copied that --paginate option from an example in the gh api docs, and my interpretation of it was the same as yours.

This method requires installing (and authenticating on) the Github CLI, but has the advantage that the output list comes already with Github handles, hence removing a tedious step for the release manager.
```
2. The release manager should add a "Summary" section with a couple
sentences describing the latest release, and then update the title
of the release section to include the release date and remove the
"In Development" designation.
Expand Down