Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(commands/bump): prevent using incremental changelog when it is set to false in config#996

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
josix wants to merge2 commits intocommitizen-tools:master
base:master
Choose a base branch
Loading
fromjosix:fix/changelog-default-changelog-incremental

Conversation

josix
Copy link
Contributor

@josixjosix commentedFeb 29, 2024
edited
Loading

Fix#883

Description

Since the default behavior ofcz 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

  • Add test cases to all the changes you introduce
  • Run./scripts/format and./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

cz bump --changelog should work asfalse when user configurechangelog_incremental tofalse.

Steps to Test This Pull Request

  1. Modify the CHANGELOG file
    image

  2. Configurepyproject.toml withchangelog_incremental = false

  3. Runcz bump --changelog

  4. Check the CHANGELOG, which the new added content should be replaced
    image

Additional context

ditto.

woile and JakeTRogers reacted with heart emoji
@josixjosixforce-pushed thefix/changelog-default-changelog-incremental branch from661a140 tod4894e5CompareFebruary 29, 2024 18:01
@codecovCodecov
Copy link

codecovbot commentedFeb 29, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.45%. Comparing base(120d514) to head(d439c38).
Report is 538 commits behind head on master.

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
FlagCoverage Δ
unittests97.45% <100.00%> (+0.11%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

@josixjosixforce-pushed thefix/changelog-default-changelog-incremental branch fromd4894e5 to45b9352CompareFebruary 29, 2024 18:25
@josixjosix marked this pull request as ready for reviewMarch 8, 2024 08:34
@josixjosix requested a review fromwoileMarch 8, 2024 11:40
@noirbizarre
Copy link
Member

Just opening the debate: wouldn't it be easier and more consistent to fix/align the defaultbump behavior to the default settings (even if this is a breaking change) ?

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.

josix, woile, and Lee-W reacted with thumbs up emoji

@josix
Copy link
ContributorAuthor

josix commentedMar 11, 2024
edited
Loading

Just opening the debate: wouldn't it be easier and more consistent to fix/align the defaultbump behavior to the default settings (even if this is a breaking change) ?

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 thebump --changelog.

@woile
Copy link
Member

Just opening the debate: wouldn't it be easier and more consistent to fix/align the default bump behavior to the default settings (even if this is a breaking change) ?

Could you make a proposal for this? It sounds interesting, would be nice if we can simplify the settings

josix and Lee-W reacted with thumbs up emoji

@Lee-W
Copy link
Member

I'm a bit confused here. I thought we could solve it by reading the value from config?

@josix
Copy link
ContributorAuthor

I thought we could solve it by reading the value from config?

I think there are total three combinations of configurations here:

  1. user didn't specifychangelog_incremental, the Config would store the value asFalse and the value passing intoChangelog should beTrue
  2. user did specifychangelog_increamental: true, the Config would store the value asTrue, so the value passing intoChangelog would also beTrue
  3. user did specifychangelog_increamental: false, the Config would store the value asFalse, so the value passing intoChangelog would also beFalse

The 1st & 3rd cases would cause ambiguity when we're reading the value fromConfig, we couldn't tell if the False value is set from the default value or user configuration, according to different source of the value we would take different value to pass into the initialization ofChangelog. To address this, I introduce one more property that trace the value set from users to help us differentiate them in this PR.

@Lee-W
Copy link
Member

Lee-W commentedApr 2, 2024
edited
Loading

we couldn't tell if the False value is set from the default value or user configuration,

I thought the one from the config should overwrite the default. Or did I miss anything?

@Lowaiz
Copy link
Contributor

Hello,

Do you guys have any news on this fix ?
This setting is blocking thechangelog_merge_prerelease option, as the argincremental take the precedence, causing us to split the bump and the changelog generation in order to have proper release changelog with every changes from release-x to release-x+1 concatenated, and not with every intermediate pre-release.

Copy link
Member

@Lee-WLee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I probably won't say I love this idea, but it is an acceptable workaround before we introduce a better config system.@josix, could you please rebase it and add some tests to verify it?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Lee-WLee-WLee-W left review comments

@noirbizarrenoirbizarreAwaiting requested review from noirbizarrenoirbizarre is a code owner

@woilewoileAwaiting requested review from woilewoile is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
4.9.0
Development

Successfully merging this pull request may close these issues.

changelog_incremental is set as default when calling changelog from cz bump
5 participants
@josix@noirbizarre@woile@Lee-W@Lowaiz

[8]ページ先頭

©2009-2025 Movatter.jp