Skip to content

Commit

Permalink
fix: Fixed a bug in slap release where an unreleased changelog in t…
Browse files Browse the repository at this point in the history
…he project root was not renamed and updated in a mono repository (#105)

* fix: Fixed a bug in `slap release` where an unreleased changelog in the project root was not renamed and updated in a mono repository

* Updated PR references in 1 changelogs.

skip-checks: true

---------

Co-authored-by: GitHub Action <github-action@users.noreply.github.com>
  • Loading branch information
NiklasRosenstein and GitHub Action committed Dec 14, 2023
1 parent 6979b5d commit 955e5b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changelog/_unreleased.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ pr = "https://github.com/NiklasRosenstein/slap/pull/104"
issues = [
"https://github.com/NiklasRosenstein/slap/issues/98",
]

[[entries]]
id = "c5d94767-38b7-4b01-8669-c5aaf027d0ab"
type = "fix"
description = "Fixed a bug in `slap release` where an unreleased changelog in the project root was not renamed and updated in a mono repository"
author = "@NiklasRosenstein"
pr = "https://github.com/NiklasRosenstein/slap/pull/105"
6 changes: 5 additions & 1 deletion src/slap/ext/release/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ class ChangelogReleasePlugin(ReleasePlugin):

def create_release(self, repository: Repository, target_version: str, dry: bool) -> t.Sequence[Path]:
changed_files: list[Path] = []
for project in repository.projects():
for project in [None, *repository.projects()]:
manager = get_changelog_manager(repository, project)
unreleased = manager.unreleased()
if unreleased.path in changed_files:
# We hit this case in a single-project repository, where "None" and the single project will
# both return the same changelog manager.
continue
new_version = manager.version(target_version)
if unreleased.exists():
cwd = Path.cwd()
Expand Down

0 comments on commit 955e5b5

Please sign in to comment.