Skip to content

Monorepo / path filters might exclude tags #1122

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

Open
JP-Ellis opened this issue Mar 27, 2025 · 4 comments
Open

Monorepo / path filters might exclude tags #1122

JP-Ellis opened this issue Mar 27, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@JP-Ellis
Copy link

JP-Ellis commented Mar 27, 2025

Background

Let's suppose we have a monorepo with two projects and the following structure:

.github/
project-foo/
project-bar/
README.md

Releases are tagged foo-vX.Y.Z and bar-vX.Y.Z for the two projects.

Let us suppose, for this scenario, that I just made some changes to the way the packages are released in .github/ and I release new version of bar, tagging that commit that only modifies files within .github/.

Problem

It would appear that Git Cliff filters commits first and then looks for release tags within these commits.

The problem here is that by filtering commits first and listing tags from the resulting subset, the commit (and therefore associated tag) in the scenario above also gets removed.

While it is correct to filter out the commit from the changelog for bar since it doesn't touch any files within project-bar/, I would say that it is incorrect for Git Cliff to be filtering the tags as well.

Solution

I'm not familiar with Git Cliff's internals, but I think Git Cliff needs to:

  1. Match the release tags irrespective of the associated commit's changes; and then,
  2. Generate the changelog from the subset of commits that match the include/exclude paths, with the tags from (1) merely providing labels to help group the commits.

Expected behavior

The version tag is correctly picked up, even if the associated commit does not touch any files within the path filters.

Software information

  • Operating system: Darwin 24.3.0 (macOS 15.3)
  • Rust version: N/A
  • Project version: 2.8.0

Additional context

See this Discord thread

@JP-Ellis JP-Ellis added the bug Something isn't working label Mar 27, 2025
Copy link

welcome bot commented Mar 27, 2025

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@orhun
Copy link
Owner

orhun commented Mar 27, 2025

@Cyclonit are you adding a fixture for this and testing it out? 👀

@Cyclonit
Copy link
Contributor

@orhun, yes I'll work on this in the evening. I reckon we don't really have to care about path filters etc. Instead I would change the commit processing, such that ignored commits aren't dropped outright. They need to be kept until all of the release tags have been found and processed.

@JP-Ellis
Copy link
Author

Is there any help I can offer here? Perhaps through a PR review, or to do some testing?

Cyclonit added a commit to Cyclonit/git-cliff that referenced this issue Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants