-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(commands/bump): prevent using incremental changelog when it is set to false in config #996
base: master
Are you sure you want to change the base?
fix(commands/bump): prevent using incremental changelog when it is set to false in config #996
Conversation
661a140
to
d4894e5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #996 +/- ##
==========================================
+ Coverage 97.33% 97.45% +0.11%
==========================================
Files 42 55 +13
Lines 2104 2398 +294
==========================================
+ Hits 2048 2337 +289
- Misses 56 61 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…t to false in config
d4894e5
to
45b9352
Compare
|
||
@property | ||
def settings(self) -> Settings: | ||
return self._settings | ||
|
||
@property | ||
def mutated_settings(self) -> Settings: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a docstring to this function explaining it a bit further? thanks
Right now it seems it does the same as mutated_settings
, but I think the intention is different, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've added it. Could you help check it, thanks!
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? |
Fix #883
Description
Since the default behavior of
cz bump --changelog
is 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 inBaseConfig
to record which property is defined from users so that we could distinguish the value is from default setting or users.Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
cz bump --changelog
should work asfalse
when user configurechangelog_incremental
tofalse
.Steps to Test This Pull Request
Modify the CHANGELOG file
Configure
pyproject.toml
withchangelog_incremental = false
Run
cz bump --changelog
Check the CHANGELOG, which the new added content should be replaced
Additional context
ditto.