Skip to content

Commit

Permalink
Fix missing changelog entries when running bin/manage changelog.
Browse files Browse the repository at this point in the history
Fixes #60
  • Loading branch information
mauritsvanrees committed Sep 21, 2023
1 parent f379ce5 commit 0bac2e6
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
2 changes: 2 additions & 0 deletions news/60.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix missing changelog entries when running ``bin/manage changelog``.
[maurits]
2 changes: 1 addition & 1 deletion plone/releaser/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def heading(x):
if x.rawsource in HEADINGS:
return x.rawsource
# Might be an old heading or unknown.
return OLD_HEADING_MAPPING.get(x.rawsource, "")
return OLD_HEADING_MAPPING.get(x.rawsource, "other")

def is_list_item(x):
return x.tagname == "list_item"
Expand Down
9 changes: 8 additions & 1 deletion plone/releaser/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@
)
HEADERS = [BREAKING_TEXT, FEATURE_TEXT, BUGFIXES_TEXT]
# Used by changelog.py:
HEADINGS = ["Breaking changes:", "New features:", "Bug fixes:"]
HEADINGS = [
"Breaking changes:",
"New features:",
"Bug fixes:",
"Documentation:",
"Tests",
"Internal:",
]
# For compatibility with previous names of the headers.
INCOMPATIBILITIES_TEXT = """
Incompatibilities:
Expand Down
32 changes: 32 additions & 0 deletions plone/releaser/tests/input/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Example changelog from plone.dexterity.
At some point the bug fixes were missing, and the internal item was filed under bug fixes.
See https://github.com/plone/plone.releaser/issues/60


3.0.3 (2023-09-01)
------------------

Bug fixes:


- Respect locally allowed types when pasting objects [cekk] (#146)
- Fix a memory leak as reported in https://github.com/plone/Products.CMFPlone/issues/3829, changing interface declaration type as suggested by @d-maurer in https://github.com/plone/plone.dexterity/issues/186 [mamico] (#187)


Internal:


- Update configuration files.
[plone devs] (55bda5c9)


3.0.2 (2023-03-14)
------------------

Bug fixes:


- Type error is removed and none is returned.
In this modified version of the code, if no primary field adapter is found, the fieldname and field attributes are set to None.
The value property checks whether the field attribute is None, and returns None if it is, instead of raising an error.
[Coder-aadarsh] (#59)
26 changes: 26 additions & 0 deletions plone/releaser/tests/test_changelog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from plone.releaser.changelog import Changelog

import pathlib


TESTS_DIR = pathlib.Path(__file__).parent
INPUT_DIR = TESTS_DIR / "input"
CHANGES_FILE = INPUT_DIR / "changes.rst"


def test_get_changes():
cf = Changelog(CHANGES_FILE)
assert "3.0.2" in cf
assert "3.0.3" in cf
assert sorted(list(cf.get("3.0.3").keys())) == ["Bug fixes:", "Internal:", "other"]
assert cf.get_changes("3.0.3") == []
assert cf.get_changes("3.0.2") == [
"Bug fixes:",
"Respect locally allowed types when pasting objects [cekk] (#146)",
"Fix a memory leak as reported in "
"https://github.com/plone/Products.CMFPlone/issues/3829, changing interface "
"declaration type as suggested by @d-maurer in "
"https://github.com/plone/plone.dexterity/issues/186 [mamico] (#187)",
"Internal:",
"Update configuration files.\n[plone devs] (55bda5c9)",
]

0 comments on commit 0bac2e6

Please sign in to comment.