Sitelet https://github.com/python-semantic-release/python-semantic-release/issues/1380
Skip to content

[bug] Monorepo path_filters fails to reference paths outside the current package subtree #1380

Description

@guillaumecherel

Question

In a monorepo with structure like:

./
- src/: shared code
- projects
  - api/
    - pyproject.toml
    - src/
  - <other packages>
    - ...

I’d like any change in src/ to be reflected as a change of the package in projects/api by setting path_filters like:

[tool.semantic_release.commit_parser_options]
path_filters = [".", "../../src"]

But modifications in src/ don’t get added to the generated changelog:

touch src/test.txt
git add .
git commit -m "fix: test"
cd projects/api
semantic-release -v --noop version

Should I not rely on path filters to include such changes in code shared by multiple packages ?

Configuration

Semantic Release Configuration
[tool.semantic_release]
commit_parser = "conventional-monorepo"
commit_message = """\
chore(release): api@{version}`

Automatically generated by python-semantic-release
"""
tag_format = "api-v{version}"
version_toml = ["pyproject.toml:project.version"]
build_command = """
    uv lock --upgrade-package "$PACKAGE_NAME"
    git add ../../uv.lock
"""

[tool.semantic_release.commit_parser_options]
path_filters = [".", "../../src"]
scope_prefix = "api-"

[tool.semantic_release.changelog]
# Recommended patterns for conventional commits parser that is scope aware
exclude_commit_patterns = [
    '''^chore(?:\([^)]*?\))?: .+''',
    '''^ci(?:\([^)]*?\))?: .+''',
    '''^refactor(?:\([^)]*?\))?: .+''',
    '''^style(?:\([^)]*?\))?: .+''',
    '''^test(?:\([^)]*?\))?: .+''',
    '''^build\((?!deps\): .+)''',
    '''^Initial [Cc]ommit.*''',
]
mode = "update"
insertion_flag = "<!-- python-semantic-release insertion_flag -->"

[tool.semantic_release.changelog.default_templates]
changelog_file = "../../docs/api/changelog.md"
output_format = "md"

Additional context

git log --oneline --decorate --graph --all -n 50

Activity

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

    bugSomething isn't working properlyreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions