Closed
Description
Description
Version 4.7.2 breaks cz_github_jira_conventional
because of missing defaults.bump_pattern
Steps to reproduce
- pip install commitizen cz_github_jira_conventional
- cz version --report
Current behavior
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.13/bin/cz", line 5, in <module>
from commitizen.cli import main
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/commitizen/__init__.py", line 6, in <module>
from commitizen.cz.base import BaseCommitizen
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/commitizen/cz/__init__.py", line 44, in <module>
registry: dict[str, type[BaseCommitizen]] = discover_plugins()
~~~~~~~~~~~~~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/commitizen/cz/__init__.py", line 31, in discover_plugins
mod = importlib.import_module(name)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/cz_github_jira_conventional.py", line 29, in <module>
class GithubJiraConventionalCz(BaseCommitizen):
...<256 lines>...
return parsed_message
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/cz_github_jira_conventional.py", line 30, in GithubJiraConventionalCz
bump_pattern = defaults.bump_pattern
^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'commitizen.defaults' has no attribute 'bump_pattern'
Desired behavior
cz version --report
Please add the key jira_base_url to your .cz.yaml|json|toml config file.
Screenshots
No response
Environment
4.7.2
pip3 install commitizen -U
Requirement already satisfied: commitizen in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (4.7.2)
The command cz version --report
throws
cz version --report
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.13/bin/cz", line 5, in <module>
from commitizen.cli import main
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/commitizen/__init__.py", line 6, in <module>
from commitizen.cz.base import BaseCommitizen
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/commitizen/cz/__init__.py", line 44, in <module>
registry: dict[str, type[BaseCommitizen]] = discover_plugins()
~~~~~~~~~~~~~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/commitizen/cz/__init__.py", line 31, in discover_plugins
mod = importlib.import_module(name)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/cz_github_jira_conventional.py", line 29, in <module>
class GithubJiraConventionalCz(BaseCommitizen):
...<256 lines>...
return parsed_message
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/cz_github_jira_conventional.py", line 30, in GithubJiraConventionalCz
bump_pattern = defaults.bump_pattern
^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'commitizen.defaults' has no attribute 'bump_pattern'
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]Good bug title tells us about precise symptom, not about the root cause.[/-][+]Version 4.7.2 breaks cz_github_jira_conventional because of missing defaults.bump_pattern[/+]bearomorphism commentedon May 19, 2025
I think it's because I renamed the variables in commitizen 4.7.2?
https://github.com/apheris/cz-github-jira-conventional/blob/dc1fe930d78e4fb37b62f042941b3145b8bd224f/cz_github_jira_conventional.py#L30-L33
94c02b3#diff-c951de16d627d82e01eb3ce8d7c4f0b28973ffe147520620762e7140ede2dd80R116-R127
bearomorphism commentedon May 19, 2025
This should fix the problem.
apheris/cz-github-jira-conventional#19
bearomorphism commentedon May 19, 2025
@Lee-W do you think 94c02b3 is actually a breaking change? I'm not entirely sure how you define a breaking change.
Lee-W commentedon May 19, 2025
Technically, yes. Many things can be considered a breaking change. TBH, it's not that easy to draw the line. But in this case, it is. Airflow marks many functions as private with
_func_name
ormeta: private
in the function comments. I think we should start doing something like this so we can have a better idea on what should be considered as breaking and what's not. Otherwise, all of them could be.cc @woile @noirbizarre
Lee-W commentedon May 22, 2025
#1435 (comment)
Relevant issue created.
@bearomorphism we probably could create a backward compatible layer for this one and add deprecation warning when we have time 🙂
bearomorphism commentedon May 22, 2025
Sure. Let me do it later this weekend.
Lee-W commentedon May 25, 2025
As #1447 is merged and ready to be released soon, I'll close this one