-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
changelog --subdirectory #365
Comments
About this feature, I was thinking about adding a new setting to the configuration file: # .cz.toml
[tool.commitizen]
workspace = true # similar word used by rust and js Given this folder structure (as an exmaple): app/
└── packages/
├── fizzbuz/
│ ├── pyproject.toml
│ └── src/
├── foobar2/
│ ├── .cz.toml
│ └── src/
└── p1/
├── .cz.toml
└── src/ The user would have to navigate to each of the projects and run What I don't have clear is how to handle the tags? Any thoughts on this? should we attach something to the tags? otherwise they may repeat. |
I don't get how we could use |
yes, each sub-package would have it's own The alternative is to have a single members = [
"packages/fizzbuz",
"packages/foobar2",
"packages/p1",
] But this also means, they would all share the same version. Thoughts? |
Either way works for me. 👍 But we still have the problem of how are we going to handle the git tag? Maybe we could enforce different tag format for each project? |
Indeed, the tag issue only happens if you have many |
Maybe it could be part of the
We just need to check if python's pep-0440 has support as well Edit: it seems it does: In [1]: from packaging.version import Version
In [2]: v = Version("1.0.0+foobar")
In [3]: v.local
Out[3]: 'foobar' In [1]: from semver.version import Version
In [2]: v = Version.parse("1.0.0+foobar")
In [3]: v.build
Out[3]: ['foobar'] |
What about a tag format like
which represents version It's done like this in amundsen for example. We're using commitizen and are currently investigating how we could consolidate multiple projects of similar nature (terraform modules, python packages, docker images,...) into a single monorepo with independent versioning and changelog. |
It's a possibility, but I don't think I get: InvalidVersion: Invalid version: 'submodule-v1.2.3' From my understanding the way is to add the metadata at the end with a |
Regarding this, for my original purpose when opening this issue, we don't use tags on those repositories. Instead, the version is kept in a metadata file in the repo, which is specific for each module (subdirectory). So there should be a way to configure the way we obtain the tag. Maybe in
I prefer this alternative, to avoid maintaining a lot of The
If combined with the custom tag getter explained above, it wouldn't be a problem. Side note: we use versions with 5 places (like |
Thanks for the input. That makes sense. |
I foresee some issues with the changelog generation in this situations, as we do use tags to generate the changelog itself.
This seems like a contradiction to me. Instead of having one [tool.commitizen]
version = "2.18.0"
workspace = true I don't think it's such a heavy burden vs a metadata file like:
I think eventually, support for the |
Going forward, the feature of generating the changelog based only on the changes of a corresponding directory is not impacted by the choice of version format, since the pattern can be freely configured already. Thus by having a The question is, what happens with changes in the root folder, which potentially could affect all sub-project equally. |
Well it's not something we can change. That's the way Odoo modules work, and that's what we code there. They have a
This is still relevant because otherwise all subpackages will be forced to use the same range of commits when generating the changelog. The question is: if subpackage A is on version 1.2.3 and subpackage B is on version 0.0.1, when I go to A and execute One idea: what if we save in
IMHO the subdirectory should have a notion that it's a subdirectory and is related to a parent. Then, just set
OK but at least I think the child |
+1 for this feature I currently use Having version capabilities on a sub-directory bases would also be valuable. |
We have a Python monorepo with each package having its own version and changelog. The |
I'd like to tackle this. I think tagging the version on a per-package basis using the local extension (1.0.0+lib-foo) sounds like a solid idea. |
Sounds great! Would you mind opening a new ticket with a formal proposal? 🙏🏻 we can discuss it there |
I'm currently playing a bit with a mutliple possible solutions. Will open a new ticket as soon as I have something concrete. |
Hi @tabassco, have you made any progress on this so far? We'd love to see a feature like this added. |
Description
Allow to filter commits affecting only a subdirectory.
Possible Solution
Additional context
I'm considering proposing this for @OCA. There, repositories mostly are split into modules, where each one of them has its own readme and (maybe) changelog.
So, when autogenerating changelogs, only commits affecting the module should be taken into account. AFAICS that wouldn't be possible currently.
git format-patch
allows such filtering (example recipe -- for other purposes). It would be nice if commitizen could leverage that and make this a reality.The text was updated successfully, but these errors were encountered: