Skip to content

Commit

Permalink
Change: Include pre-release changes in release changelog
Browse files Browse the repository at this point in the history
If the to be released version is not a pre releases include the changes
of the previous pre releases in the changelog.
  • Loading branch information
bjoernricks committed Mar 1, 2023
1 parent 9c1341c commit 3882de5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pontos/release/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ async def run(
)
return ReleaseReturnValue.UPDATE_VERSION_ERROR

last_release_version = get_last_release_version(self.git_tag_prefix)
last_release_version = get_last_release_version(
self.git_tag_prefix,
ignore_pre_releases=not release_version.is_prerelease,
)

self.terminal.info(
f"Creating changelog for {release_version} since "
Expand Down Expand Up @@ -252,11 +255,8 @@ async def run(

calculator = command.get_version_calculator()

next_version = (
next_version
if next_version is not None
else calculator.next_dev_version(release_version)
)
if not next_version:
next_version = calculator.next_dev_version(release_version)

try:
updated = command.update_version(next_version)
Expand Down
13 changes: 13 additions & 0 deletions tests/version/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,16 @@ def test_get_last_release_version_ignore_pre_releases(
self.assertEqual(
get_last_release_version(ignore_pre_releases=True), Version("2")
)

@patch("pontos.version.helper.Git", spec=Git)
def test_get_last_release_version_no_non_pre_release(
self, _git_interface_mock
):
git_interface = _git_interface_mock.return_value
git_interface.list_tags.return_value = [
"3.55a1",
"3.56.dev1",
"4.0.0rc1",
"4.0.1b1",
]
self.assertIsNone(get_last_release_version(ignore_pre_releases=True))

0 comments on commit 3882de5

Please sign in to comment.