Skip to content

Provide a bump level setting for path filters in monorepos #1425

Description

@H0R5E

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 = 2

With 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-a depends on pkg-b
  • if pkg-b gets an update, I also want to release pkg-a with the new version of pkg-b as a dependency
  • to do this, I set a path filter in pkg-a to watch pkg-b for changes
  • the changes made to pkg-b are major or breaking
  • the path filters as they are now will then force the change to pkg-a to 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.

Activity

  1. added
    featureA new feature or a feature request
    triagewaiting for initial maintainer review
    on Jan 29, 2026
  2. H0R5E commented on Jan 30, 2026

    @H0R5E
    ContributorAuthor

    Hi, so I have a first try at a custom parser for this here, with an example of the configuration used here. Not sure if this is of any interest to you?

    I've done some manual testing and I can force the bump level for a given path now. I need to try and test some of the edge cases for when multiple paths and scopes are defined. I'll report back next week.

  3. github-actions commented on May 6, 2026

    @github-actions

    This issue is stale because it has not been confirmed or planned by the maintainers and has been open 90 days with no recent activity. It will be closed in 7 days, if no further activity occurs. Thank you for your contributions.

  4. H0R5E commented on May 6, 2026

    @H0R5E
    ContributorAuthor

    OK, before this goes stale, I want to report that I've been successfully using my updated parser in the dtocean repository. The configuration got a bit more complex, as I needed to set the bump level required to trigger a release along with the maximum bump level setting. Below is a snippet of one of the most complex configurations I created:

    [release.commit_parser_options]
    scope_prefix = "dtocean-app"
    
    [tool.semantic_release.commit_parser_options.path_filters.main]
    paths = ["."]
    
    [tool.semantic_release.commit_parser_options.path_filters.polite-config]
    paths = ["../polite-config"]
    max_bump_level = 2
    trigger_bump_level = 4
    
    [tool.semantic_release.commit_parser_options.path_filters.mdo-engine]
    paths = ["../mdo-engine"]
    max_bump_level = 2
    trigger_bump_level = 4
    
    [tool.semantic_release.commit_parser_options.path_filters.dtocean-core]
    paths = ["../dtocean-core"]
    max_bump_level = 2
    trigger_bump_level = 4
    
    [tool.semantic_release.commit_parser_options.path_filters.dtocean-qt]
    paths = ["../dtocean-qt"]
    max_bump_level = 2
    trigger_bump_level = 4

    Note that this could be simplified as:

    [release.commit_parser_options]
    scope_prefix = "dtocean-app"
    
    [tool.semantic_release.commit_parser_options.path_filters.main]
    paths = ["."]
    
    [tool.semantic_release.commit_parser_options.path_filters.modules]
    paths = [
      "../polite-config",
      "../mdo-engine",
      "../dtocean-core",
      "../dtocean-qt",
    ]
    max_bump_level = 2
    trigger_bump_level = 4

    I chose to use a configuration for each module dependency for future flexibility.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new feature or a feature requesttriagewaiting for initial maintainer review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions