-
-
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
Add support for scoped changelog generation: cz changelog --scope myscope #530
Comments
I'm might not be a user of this feature but I'm ok with it. @woile What do you think? |
I like the idea, it's quite interesting. I think we should also have a stance on how to use commitizen with a monorepo. If you create multiple changelogs, are you also supposed to create multiple tags? |
+1 for this. Been trying to use commitizen in a monorepo setup, without much success.. From what I understand,
c.f. https://stackoverflow.com/a/56558343 Would love for this to become a reality! |
I am looking at using commitizen in a monorepo too and I hit issues when trying to do this by using different While testing the fix locally I found the issue with commits from different components where then included in the changeling which made them hard to understand. I have solved this issue by using a custom config with If it is useful I can try to create an example repo layout to demonstrate this |
That'd be really nice, I'd like to see an example with what we currently have |
@woile so this isn't strictly with what we have now it would need the fix I am proposing for changelog generation with tag_format in #995 that I have raised. I used that version to do all the tag/changlogs in this repo. I kept it simple just using 2 directories each with an independent config. Be great to hear your thoughts on this approach. |
Looks really clever! I like how you use the pattern to define which commits go to which changelog. Most "monorepo" tools end up behaving like that ( Some thoughts:
I'm thinking that we could experiment in a new package for monorepos with cz. Where at the root of your project, you add a [tool.commitizen.workspace]
members = [
"packages/*",
"legacy_one"
] and then run: cz workspace bump and it goes to each member and bumps and creates changelog, if necessary. To identify if things have changed, one option is to use
We could try adding a new config parameter to commitizen to bump based on files changed 🤔 |
Our CI validates that the commits only have files for the component in the scope, build fails so that doesn't get to trunk and won't be released. We are also quite strict keeping PRs scoped to one component, then the component with changes is the only ones built and released. The idea of adding some of this logic to commitizen is interesting, my thought was to leave that detection to the build toolset and use commitizen for version bump/conventional commit validation. The idea looks interesting and I might have a play around with it. |
I like this idea. For monorepos it's a game changer.
Having the ability to generate scope-based changelog (including a scope prefix handling to be able to handle things like Project having this kind of workflow often rely on tag in the form of |
PR for tag template - #692 |
An approach that can be taken is to use the output of
|
Description
Consider a monorepo with multiple projects (e.g.
proja
andprojb
), each project with its own.cz.toml
file. Commits are scoped according to project, e.g:The changelog for
proja
, should ignore all commits except those scoped withproja
.Possible Solution
This could be achieved by setting
scope = proja
in theproja/.cz.toml
file, or by runningcz changelog --scope proja
. This means that only commit messages with the specified scope will be considered when generating the changelog.Additional context
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: