-
Notifications
You must be signed in to change notification settings - Fork 264
Description
Feature Request
Description
I would like to be able to set a fixed bump level for a given path filter when using ConventionalCommitMonorepoParser. Something along the lines of:
[tool.semantic_release.commit_parser_options.path_filters.x]
path = "../path/to/some/package/**"
max_bump_level = 2With this configuration in place, the parser should then force any commits found by this filter with a higher bump level to the given maximum.
Use cases
My motivation for this is that I have packages in my monorepo that are dependant on other packages.
For example:
- let's say
pkg-adepends onpkg-b - if
pkg-bgets an update, I also want to releasepkg-awith the new version ofpkg-bas a dependency - to do this, I set a path filter in
pkg-ato watchpkg-bfor changes - the changes made to
pkg-bare major or breaking - the path filters as they are now will then force the change to
pkg-ato also be major or breaking
In the above scenario, I just want the bump to pkg-a to be minor, unless I have made some changes specific to pkg-a that warrant a higher level.
Note that I am using a poetry plugin to automatically rewrite path dependencies to their released version when building for PyPI. I therefore don't have to make any changes to pkg-a when pkg-b updates for the dependency specification to be modified.
Possible implementation
Maybe by overriding the bump level returned from the parse_message method?
Alternative solutions
I've tried to think of a way of setting up the current configuration where I can get a similar result, but I have not had any success.
(EDIT: I've just thought about watching just the pyproject.toml file of the other project, but I would have to be careful to exclude changes to it from any commits with higher level types.)
Any help is gratefully received,
Thanks,
Mat
NEXT DAY EDIT: I just read the custom parser documentation, so I will have a go at rolling my own with this functionality.