fix(commands/bump): prevent using incremental changelog when it is set to false in config#996
Conversation
661a140 to
d4894e5
Compare
❌ 20 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
d4894e5 to
45b9352
Compare
|
Just opening the debate: wouldn't it be easier and more consistent to fix/align the default By adding a fourth settings source of trust (defaults, user settings, cli flags and now mutated settings, fifth if you add the fact that plugins can override some settings), I feel that we are fixing a symptom but making the problem more complex. |
Yeah, I think that would be a better way to address the issue if possible. The implementation would be easier and also could prevent overriding the behaviors from multiple sources when running the |
Could you make a proposal for this? It sounds interesting, would be nice if we can simplify the settings |
|
I'm a bit confused here. I thought we could solve it by reading the value from config? |
I think there are total three combinations of configurations here:
The 1st & 3rd cases would cause ambiguity when we're reading the value from |
I thought the one from the config should overwrite the default. Or did I miss anything? |
|
Hello, Do you guys have any news on this fix ? |
|
@josix what is the status of this PR? Thanks! |
|
Oh I missed this comment, let me pick this up |
|
Thanks! |
d439c38 to
aef2004
Compare
c2df766 to
5ecaa15
Compare
5ecaa15 to
7162151
Compare
7162151 to
9c8f89a
Compare
commitizen/commands/bump.py
Outdated
| "incremental": incremental_setting | ||
| if incremental_setting is not None | ||
| else True, |
There was a problem hiding this comment.
This probably also works and is less confusing
| "incremental": incremental_setting | |
| if incremental_setting is not None | |
| else True, | |
| "incremental": self.config.settings.get("changelog_incremental", True), |
There was a problem hiding this comment.
yeah, thanks for pointing it out.
There was a problem hiding this comment.
weird, seems that it will let tests fail, let me investigate it.
Fix #883
Description
Since the default behavior of
cz bump --changelogis to write incremental changelog, which is different from the default value ofchangelog_incremental, it is hard to know the value is set from user or the default setting, To address it, I created one more member inBaseConfigto record which property is defined from users so that we could distinguish the value is from default setting or users.Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
cz bump --changelogshould work asfalsewhen user configurechangelog_incrementaltofalse.Steps to Test This Pull Request
Modify the CHANGELOG file

Configure
pyproject.tomlwithchangelog_incremental = falseRun
cz bump --changelogCheck the CHANGELOG, which the new added content should be replaced

Additional context
ditto.