[change] Included commit bodies in releaser changelog#702
Conversation
Release changelogs need the full commit body when a title is too terse. Git trailers and Dependabot metadata are filtered so generated entries remain readable, while links use the target changelog format.
📝 WalkthroughWalkthroughThe PR extends the changelog generation pipeline to support multi-line commit messages. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The CI is failing due to transient infrastructure issues (not related to your code). I have restarted the failed jobs automatically (1/3). |
|
The CI is failing due to transient infrastructure issues (not related to your code). I have restarted the failed jobs automatically (2/3). |
|
The CI is failing due to transient infrastructure issues (not related to your code). I have restarted the failed jobs automatically (3/3). |
Test Failures in Selenium TestsHello @nemesifier, The CI failed due to Fix: Modify the For example, you could change the assertion from: self.assertEqual(self.get_browser_logs(), [])to: self.assertIsNone(self.get_browser_logs()) # If None is the expected outcomeor, if an empty list is always expected: self.assertEqual(self.get_browser_logs() or [], [])Alternatively, ensure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@openwisp_utils/releaser/changelog.py`:
- Around line 111-119: The Dependabot metadata detection in the conditional
block starting at dependabot_metadata_start.match currently scans all remaining
lines in the file for updated-dependencies:, causing it to incorrectly identify
metadata from later commits and skip unrelated content from the current block.
Modify the lookahead check to only scan contiguous lines that belong to the same
OW_CHANGELOG_BODY block (stopping when reaching a line that marks the end of the
current block), rather than checking all remaining lines. Additionally, add a
regression test case that verifies a normal changelog body containing ---
followed by another commit with Dependabot metadata does not cause unrelated
lines from the first body to be dropped.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 81632463-8629-4e28-929f-0e97f4d77e43
📒 Files selected for processing (5)
openwisp_utils/cliff.tomlopenwisp_utils/releaser/changelog.pyopenwisp_utils/releaser/release.pyopenwisp_utils/releaser/tests/samples/changelogs/full_changelog.rstopenwisp_utils/releaser/tests/test_changelog.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{py,html,txt}
📄 CodeRabbit inference engine (Custom checks)
For Django pull requests, ensure all user-facing strings are marked as translatable using the Django i18n framework
Files:
openwisp_utils/releaser/release.pyopenwisp_utils/releaser/changelog.pyopenwisp_utils/releaser/tests/test_changelog.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Place imports at the top of the file; only defer imports when necessary (e.g., Django model imports inside functions or methods where the app registry is not yet ready)
Avoid unnecessary blank lines inside function and method bodies
Add or update tests for every behavior change
Runopenwisp-qa-formatafter editing
Prefer in-process tests so coverage tools can measure changed code
When checking coverage for a changed module, usepython -m pytest <test_path> --cov=<dotted.module.path> --cov-report=term-missing
Watch for unsafe file paths, unsafe subprocess usage, token or secret exposure, and changes that could weaken QA or release safeguards
Write comments and docstrings only when they explain why code is shaped a certain way; place comments before the relevant code block instead of scattering them inside it
Files:
openwisp_utils/releaser/release.pyopenwisp_utils/releaser/changelog.pyopenwisp_utils/releaser/tests/test_changelog.py
**/*.{md,rst,txt}
📄 CodeRabbit inference engine (AGENTS.md)
Update documentation when behavior, settings, public APIs, setup steps, QA rules, or supported versions change
Files:
openwisp_utils/releaser/tests/samples/changelogs/full_changelog.rst
**/tests/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
For bug fixes, write the regression test first, run it against the unfixed code, confirm it fails for the expected reason, then implement the fix
Files:
openwisp_utils/releaser/tests/test_changelog.py
🧠 Learnings (1)
📚 Learning: 2026-06-15T22:45:01.529Z
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 701
File: setup.py:72-72
Timestamp: 2026-06-15T22:45:01.529Z
Learning: When reviewing changes that require a minimum Selenium Python version for specific APIs (e.g., BiDi features like `Options.enable_bidi`, console/message handlers like `Script.add_console_message_handler`, or event handlers like `BrowsingContext.add_event_handler`), do not use the Selenium API docs site (`https://www.selenium.dev/selenium/docs/api/py/`) as the source of introduction/version history, since it reflects the latest API shape. Instead, confirm feature availability by checking the official Python changelog (`py/CHANGES` in the Selenium repo) and/or inspecting the Selenium source (tags/commits corresponding to candidate versions). Only accept the stated minimum version after verifying that the referenced APIs exist in that Selenium version (e.g., Selenium 4.32.0 includes the BiDi APIs used by openwisp-utils’ BiDi-related PR `#701` as of that version).
Applied to files:
openwisp_utils/releaser/release.pyopenwisp_utils/releaser/changelog.pyopenwisp_utils/releaser/tests/test_changelog.py
🪛 ast-grep (0.43.0)
openwisp_utils/releaser/tests/test_changelog.py
[error] 137-137: Command coming from incoming request
Context: subprocess.run(["git", "add", "."], check=True, capture_output=True)
Note: [CWE-20].
(subprocess-from-request)
[error] 138-143: Command coming from incoming request
Context: subprocess.run(
["git", "commit", "--file=-"],
input=message.encode("utf-8"),
check=True,
capture_output=True,
)
Note: [CWE-20].
(subprocess-from-request)
🔇 Additional comments (3)
openwisp_utils/cliff.toml (1)
20-24: LGTM!Also applies to: 44-48, 59-63, 74-78, 90-94
openwisp_utils/releaser/release.py (1)
222-224: LGTM!openwisp_utils/releaser/tests/samples/changelogs/full_changelog.rst (1)
12-14: LGTM!Also applies to: 18-22, 26-27, 37-40, 49-50, 56-61, 64-69, 72-77, 80-88, 96-97, 101-107
| if dependabot_metadata_start.match(stripped_line): | ||
| has_dependabot_metadata = any( | ||
| _get_changelog_line_content(remaining_line) == "updated-dependencies:" | ||
| for remaining_index, remaining_line in enumerate(lines) | ||
| if remaining_index > index | ||
| ) | ||
| if has_dependabot_metadata: | ||
| skip_dependabot_metadata = True | ||
| continue |
There was a problem hiding this comment.
Dependabot metadata detection can drop unrelated commit body content.
When a body line is ---, the current lookahead scans all remaining lines for updated-dependencies:. If a later commit contains Dependabot metadata, skip mode starts too early and removes unrelated lines until ....
Please constrain the check to subsequent contiguous OW_CHANGELOG_BODY: lines in the same block, and add a regression case where a normal body contains --- before another commit that has Dependabot metadata.
Suggested fix
- if dependabot_metadata_start.match(stripped_line):
- has_dependabot_metadata = any(
- _get_changelog_line_content(remaining_line) == "updated-dependencies:"
- for remaining_index, remaining_line in enumerate(lines)
- if remaining_index > index
- )
+ if is_body_line and dependabot_metadata_start.match(stripped_line):
+ has_dependabot_metadata = False
+ for remaining_line in lines[index + 1 :]:
+ if not remaining_line.strip().startswith(CHANGELOG_BODY_MARKER):
+ break
+ remaining_content = _get_changelog_line_content(remaining_line)
+ if remaining_content == "updated-dependencies:":
+ has_dependabot_metadata = True
+ break
+ if remaining_content:
+ break
if has_dependabot_metadata:
skip_dependabot_metadata = True
continue🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@openwisp_utils/releaser/changelog.py` around lines 111 - 119, The Dependabot
metadata detection in the conditional block starting at
dependabot_metadata_start.match currently scans all remaining lines in the file
for updated-dependencies:, causing it to incorrectly identify metadata from
later commits and skip unrelated content from the current block. Modify the
lookahead check to only scan contiguous lines that belong to the same
OW_CHANGELOG_BODY block (stopping when reaching a line that marks the end of the
current block), rather than checking all remaining lines. Additionally, add a
regression test case that verifies a normal changelog body containing ---
followed by another commit with Dependabot metadata does not cause unrelated
lines from the first body to be dropped.
Checklist
Reference to Existing Issue
I have not opened an issue for this change.
Description of Changes
Includes commit bodies in releaser changelog entries so release notes do not lose important context when commit titles are terse.
Filters Git trailers, cherry-pick metadata, and Dependabot metadata blocks from generated changelog entries.
Converts markdown links to anonymous RST links for RST changelogs while preserving markdown links for markdown changelogs.
Screenshot
Not applicable.