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

Switch from Reno to Towncrier for release notes #1501

Merged
merged 21 commits into from
Mar 14, 2024

Conversation

Eric-Arellano
Copy link
Collaborator

@Eric-Arellano Eric-Arellano commented Mar 11, 2024

Why Reno broke

Closes Qiskit/documentation#979 and Qiskit/documentation#978.

Reno stopped working correctly with Runtime 0.21. The release notes for 0.16+ were all being included in the 0.15 release note entry, incorrectly. #1486 attempted to fix this and it worked locally, but in CI the stable/0.15 entry was missing all release notes before 0.15 and we could not figure out how to fix that.

Reno got into a bad state because of the feature branch experimental-0.2. That branch was based off of main at the time of 0.15.0. It was not merged back into main until preparing 0.21.0 when we merged 32b0dbc into main . During the feature branch's life, ec8f5a4 merged main into experimental-0.2, which we think messed things up by copying over Git tags into the feature branch. git log --tags --simplify-by-decoration shows all the tags in order, but between 0.20.0 and 0.21.0 is that commit ec8f5a4.

We think the problem is that Reno gets confused when you merge a branch that itself has Git tags back into main. This blog warns

There is one case when reno may skip release note, and it’s a single known ‘don’t do it’ case, documented and articulated: Do not merge stable branch with release tags back into master branch.

We think Reno ended up confusing some of the same Git tags between the feature branch and main.

We could not think of a safe fix for Reno because we cannot safely force push changes to the Git history. We couldn't find a way to teach Reno which release notes correspond to which version because it tries automating this all via Git.

Switching to Towncrier

Towncrier is a popular release notes generator in the Python community used by projects like pip and pytest.

It is much simpler than Reno because it is less magical: it doesn't even look at Git. Instead, Towncrier has a simple workflow:

  • Until a release, each change has a dedicated release note file describing it.
  • When preparing a release note, you manually run towncrier build and it will combine all the separate release notes together and add them to an aggregated release note file for the entire release, like 0.20.0.rst. It will also delete the individual release note files since they are now moved into the aggregated file.

Unlike Reno, this means that you only have standalone release notes files for unreleased versions. If you want to make changes to prior release notes, you simplify modify the aggregated file for that release, like changing 0.20.0.rst.

This means there is a new step to preparing releases: you have to first create a PR to prep the release notes.

Why do we have one release note file per release?

By default, towncrier writes every release note to a single file like CHANGES.rst. We instead have one file per release, like 0.20.0.rst. We do this because it makes patch releases like 0.20.1 simpler; when we do a patch release, we need to cherry-pick the release prep from the stable/x branch back into main so that the release note file for 0.20.1 shows up on main. By having the release notes be separated files per release, we avoid that cherry-pick from having a merge conflict with main.

We have a helper script that Tox and Make call to concatenate all these separate release note files into a single release_notes.rst to be used by the Sphin build.

@Eric-Arellano Eric-Arellano changed the title Switch from Reno to Towncrier for release notes [wip] Switch from Reno to Towncrier for release notes Mar 11, 2024
@coveralls
Copy link

coveralls commented Mar 11, 2024

Pull Request Test Coverage Report for Build 8285402559

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 82.297%

Totals Coverage Status
Change from base Build 8269393108: 0.0%
Covered Lines: 5769
Relevant Lines: 7010

💛 - Coveralls

arnaucasau and others added 4 commits March 13, 2024 15:13
- fix CONTRIBUTING.md to not talk about CHANGES.rst
- use pathlib more
- convert new release note to Towncrier
- fix requirements.txt
@Eric-Arellano Eric-Arellano changed the title [wip] Switch from Reno to Towncrier for release notes Switch from Reno to Towncrier for release notes Mar 13, 2024
@Eric-Arellano Eric-Arellano marked this pull request as ready for review March 13, 2024 15:55
CONTRIBUTING.md Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
release-notes/0.1.0.rst Show resolved Hide resolved
tools/concat_release_notes.py Show resolved Hide resolved
Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@Eric-Arellano Eric-Arellano merged commit 8b26998 into Qiskit:main Mar 14, 2024
20 checks passed
@Eric-Arellano Eric-Arellano deleted the towncrier branch March 14, 2024 22:06
@Eric-Arellano Eric-Arellano added the backport potential The bug might be minimal and/or important enough to be port to stable label Mar 14, 2024
kt474 pushed a commit to kt474/qiskit-ibm-runtime that referenced this pull request Mar 18, 2024
## Why Reno broke

Closes Qiskit/documentation#979 and Qiskit/documentation#978.

Reno stopped working correctly with Runtime 0.21. The release notes for 0.16+ were all being included in the 0.15 release note entry, incorrectly. Qiskit#1486 attempted to fix this and it worked locally, but in CI the `stable/0.15` entry was missing all release notes before 0.15 and we could not figure out how to fix that.

Reno got into a bad state because of the feature branch `experimental-0.2`. That branch was based off of `main` at the time of 0.15.0. It was not merged back into `main` until preparing 0.21.0 when we merged 32b0dbc into `main` . During the feature branch's life, ec8f5a4 merged main into experimental-0.2, which we think messed things up by copying over Git tags into the feature branch. `git log --tags --simplify-by-decoration` shows all the tags in order, but between 0.20.0 and 0.21.0 is that commit ec8f5a4.

We think the problem is that Reno gets confused when you merge a branch that itself has Git tags back into `main`. This [blog warns](https://medium.com/opsops/software-discovery-reno-b072827ad883)

> There is one case when reno may skip release note, and it’s a single known ‘don’t do it’ case, documented and articulated: Do not merge stable branch with release tags back into master branch.

We think Reno ended up confusing some of the same Git tags between the feature branch and main.

We could not think of a safe fix for Reno because we cannot safely force push changes to the Git history. We couldn't find a way to teach Reno which release notes correspond to which version because it tries automating this all via Git.

## Switching to Towncrier

[Towncrier](https://towncrier.readthedocs.io/en/stable/) is a popular release notes generator in the Python community used by projects like pip and pytest. 

It is much simpler than Reno because it is less magical: it doesn't even look at Git. Instead, Towncrier has a simple workflow:

- Until a release, each change has a dedicated release note file describing it.
- When preparing a release note, you manually run `towncrier build` and it will combine all the separate release notes together and add them to an aggregated release note file for the entire release, like `0.20.0.rst`. It will also delete the individual release note files since they are now moved into the aggregated file.

Unlike Reno, this means that you only have standalone release notes files for unreleased versions. If you want to make changes to prior release notes, you simplify modify the aggregated file for that release, like changing `0.20.0.rst`.

This means there is a new step to preparing releases: you have to first create a PR to prep the release notes.

### Why do we have one release note file per release?

By default, towncrier writes every release note to a single file like `CHANGES.rst`. We instead have one file per release, like `0.20.0.rst`. We do this because it makes patch releases like 0.20.1 simpler; when we do a patch release, we need to cherry-pick the release prep from the `stable/x` branch back into `main` so that the release note file for 0.20.1 shows up on `main`. By having the release notes be separated files per release, we avoid that cherry-pick from having a merge conflict with `main`.

We have a helper script that Tox and Make call to concatenate all these separate release note files into a single `release_notes.rst` to be used by the Sphin build.
kt474 added a commit that referenced this pull request Mar 18, 2024
* Switch from Reno to Towncrier for release notes (#1501)

## Why Reno broke

Closes Qiskit/documentation#979 and Qiskit/documentation#978.

Reno stopped working correctly with Runtime 0.21. The release notes for 0.16+ were all being included in the 0.15 release note entry, incorrectly. #1486 attempted to fix this and it worked locally, but in CI the `stable/0.15` entry was missing all release notes before 0.15 and we could not figure out how to fix that.

Reno got into a bad state because of the feature branch `experimental-0.2`. That branch was based off of `main` at the time of 0.15.0. It was not merged back into `main` until preparing 0.21.0 when we merged 32b0dbc into `main` . During the feature branch's life, ec8f5a4 merged main into experimental-0.2, which we think messed things up by copying over Git tags into the feature branch. `git log --tags --simplify-by-decoration` shows all the tags in order, but between 0.20.0 and 0.21.0 is that commit ec8f5a4.

We think the problem is that Reno gets confused when you merge a branch that itself has Git tags back into `main`. This [blog warns](https://medium.com/opsops/software-discovery-reno-b072827ad883)

> There is one case when reno may skip release note, and it’s a single known ‘don’t do it’ case, documented and articulated: Do not merge stable branch with release tags back into master branch.

We think Reno ended up confusing some of the same Git tags between the feature branch and main.

We could not think of a safe fix for Reno because we cannot safely force push changes to the Git history. We couldn't find a way to teach Reno which release notes correspond to which version because it tries automating this all via Git.

## Switching to Towncrier

[Towncrier](https://towncrier.readthedocs.io/en/stable/) is a popular release notes generator in the Python community used by projects like pip and pytest. 

It is much simpler than Reno because it is less magical: it doesn't even look at Git. Instead, Towncrier has a simple workflow:

- Until a release, each change has a dedicated release note file describing it.
- When preparing a release note, you manually run `towncrier build` and it will combine all the separate release notes together and add them to an aggregated release note file for the entire release, like `0.20.0.rst`. It will also delete the individual release note files since they are now moved into the aggregated file.

Unlike Reno, this means that you only have standalone release notes files for unreleased versions. If you want to make changes to prior release notes, you simplify modify the aggregated file for that release, like changing `0.20.0.rst`.

This means there is a new step to preparing releases: you have to first create a PR to prep the release notes.

### Why do we have one release note file per release?

By default, towncrier writes every release note to a single file like `CHANGES.rst`. We instead have one file per release, like `0.20.0.rst`. We do this because it makes patch releases like 0.20.1 simpler; when we do a patch release, we need to cherry-pick the release prep from the `stable/x` branch back into `main` so that the release note file for 0.20.1 shows up on `main`. By having the release notes be separated files per release, we avoid that cherry-pick from having a merge conflict with `main`.

We have a helper script that Tox and Make call to concatenate all these separate release note files into a single `release_notes.rst` to be used by the Sphin build.

* remove unreleased change only in main

---------

Co-authored-by: Eric Arellano <[email protected]>
@kt474 kt474 added this to the 0.22.0 milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport potential The bug might be minimal and/or important enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate alternatives to Reno for Runtime and Provider
4 participants