Skip to content

[chores:fix] Commitizen: added unhandled valid cases, moved code to releaser/ dir #110#590

Merged
nemesifier merged 2 commits intomasterfrom
fix-cz-rules
Feb 7, 2026
Merged

[chores:fix] Commitizen: added unhandled valid cases, moved code to releaser/ dir #110#590
nemesifier merged 2 commits intomasterfrom
fix-cz-rules

Conversation

@nemesifier
Copy link
Member

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • N/A I have updated the documentation.

Reference to Existing Issue

Related to #110.

Description of Changes

Added unhandled valid cases, the reference to issue was allowing only "Fixes", but we need more cases like "Closes", "Related to" and other typical cases allowed by github.

I also moved the commitizen logic to the releaser/ dir so we can keep all the release management logic in one place.

@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

Walkthrough

The changes relocate the OpenWispCommitizen class from a standalone module (cz_openwisp.py) to the openwisp_utils/releaser/commitizen.py package structure. The entry point in setup.py is updated to reference the new location. The commit message validation pattern is extended to accept multiple verb forms (Close, Closes, Closed, Fix, Fixes, Fixed, Resolve, Resolves, Resolved, Related to) before issue numbers. Corresponding tests are added for the new verb forms, and the old test module reference is removed from the test runner configuration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

releaser

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: adding unhandled valid commit message cases and moving commitizen code to the releaser directory.
Description check ✅ Passed The description follows the template structure, completes checklist items, references issue #110, and clearly explains the changes made.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-cz-rules

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
openwisp_utils/releaser/commitizen.py (1)

155-156: Consider adding test coverage for more verb forms.

The regex now accepts 10 verb forms (Close, Closes, Closed, Fix, Fixes, Fixed, Resolve, Resolves, Resolved, Related to), but only Fixes, Closes, and Related to have corresponding tests. While the alternation is straightforward, a parameterized test covering all variants would guard against accidental regex breakage.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 904d454 and 8cbf453.

📒 Files selected for processing (5)
  • cz_openwisp.py
  • openwisp_utils/releaser/commitizen.py
  • openwisp_utils/releaser/tests/test_commitizen_rules.py
  • runtests.py
  • setup.py
💤 Files with no reviewable changes (2)
  • runtests.py
  • cz_openwisp.py
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 560
File: openwisp_utils/commitizen/openwisp.py:9-25
Timestamp: 2026-02-06T20:46:32.980Z
Learning: In openwisp-utils, the commit message prefix "chores" (plural) is intentionally used instead of "chore" (singular) in the Commitizen ALLOWED_PREFIXES configuration.
📚 Learning: 2026-02-06T20:46:32.980Z
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 560
File: openwisp_utils/commitizen/openwisp.py:9-25
Timestamp: 2026-02-06T20:46:32.980Z
Learning: In openwisp-utils, the commit message prefix "chores" (plural) is intentionally used instead of "chore" (singular) in the Commitizen ALLOWED_PREFIXES configuration.

Applied to files:

  • openwisp_utils/releaser/commitizen.py
🧬 Code graph analysis (1)
openwisp_utils/releaser/tests/test_commitizen_rules.py (1)
openwisp_utils/releaser/commitizen.py (1)
  • message (76-88)
🪛 Ruff (0.14.14)
openwisp_utils/releaser/tests/test_commitizen_rules.py

[warning] 46-46: Unpacked variable out is never used

Prefix it with an underscore or any other dummy variable pattern

(RUF059)


[warning] 46-46: Unpacked variable err is never used

Prefix it with an underscore or any other dummy variable pattern

(RUF059)


[warning] 57-57: Unpacked variable out is never used

Prefix it with an underscore or any other dummy variable pattern

(RUF059)


[warning] 57-57: Unpacked variable err is never used

Prefix it with an underscore or any other dummy variable pattern

(RUF059)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=5.0.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=5.2.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.10 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=5.0.0
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.0.0
  • GitHub Check: Python==3.11 | django~=4.2.0
🔇 Additional comments (3)
openwisp_utils/releaser/commitizen.py (1)

171-173: LGTM!

Module-level __all__ export is appropriate.

setup.py (1)

23-25: LGTM!

Entry point correctly updated to the new module path openwisp_utils.releaser.commitizen:OpenWispCommitizen.

openwisp_utils/releaser/tests/test_commitizen_rules.py (1)

39-58: LGTM!

New tests correctly validate Closes and Related to keyword support, following the existing test patterns.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added the releaser Related to the OpenWISP Release Tool label Feb 7, 2026
@github-project-automation github-project-automation bot moved this from To do (general) to In progress in OpenWISP Contributor's Board Feb 7, 2026
@nemesifier nemesifier merged commit 8cbf453 into master Feb 7, 2026
34 checks passed
@nemesifier nemesifier deleted the fix-cz-rules branch February 7, 2026 16:09
@github-project-automation github-project-automation bot moved this from In progress to Done in OpenWISP Contributor's Board Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement releaser Related to the OpenWISP Release Tool

Projects

Development

Successfully merging this pull request may close these issues.

1 participant