Skip to content

Fix tags filtering resulting in paths filter being ignored #437

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
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

C85297
Copy link

@C85297 C85297 commented Apr 9, 2025

Fix #292 - currently if a tag filter is specified then any other filters, such as the path filter are ignored. The version_depth parameter is also incorrectly ignored.

We have added a tag_behaviour option, with a default value of match_tagged. match_tagged implements the previous expected behaviour of the tag filter options operating in an AND manner with the other specified filters.

The match_tag_ancestors value implements new functionality which will be useful for those using a tag filter. This will output commits which match the other specified filters, and are ancestors of a commit matching one of the tag filters. For example, if you filter for the 2.0.0 tag, but the commit tagged with 2.0.0 did not change one of the specified paths, the git resource will return a commit that is an ancestor of the 2.0.0 commit which did change one of the paths. This is useful when operating with semver versions to find a commit within a version that modifies a tag.

We also updated the version of Ubuntu used as the resource base image due to the previous version including a version of jq which incorrectly treated an empty input as valid JSON. This could result in tests incorrectly passing, when an empty output from the resource type should result in failure.

An illustration of the previously described functionality of the tag_behaviour option

Note that while making these changes we discovered that the tests it_skips_all_non_included_commits and it_returns_list_of_all_tags_in_metadata are non deterministic and can occasionally incorrectly fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

paths filter does not work in conjunction with tag_filter
1 participant