Commit 4b3ec86c2f47
Changed files (3)
tools
review-tool
internal
filter
tools/review-tool/internal/filter/filter.go
@@ -55,10 +55,11 @@ func (f *Filter) FilterItems(items []activity.ActivityItem) []activity.ActivityI
func (f *Filter) Match(item activity.ActivityItem) bool {
folders := itemFolders(item)
- // Items with no folder metadata are dropped when any folder filter is active.
- // They can't be classified, so they shouldn't slip through.
+ // Items with no folder metadata (e.g. Jira issues) pass through
+ // exclude filters (they can't match) but are dropped by include
+ // filters (they can't satisfy the constraint).
if len(folders) == 0 {
- return false
+ return len(f.IncludeFolders) == 0
}
// Exclude check: if any folder matches an exclude pattern, reject
tools/review-tool/internal/filter/filter_test.go
@@ -49,7 +49,7 @@ func TestFilter_ExcludeFolder(t *testing.T) {
{"excludes home project", item(map[string]string{"project": "~/src/home (homelab)"}), false},
{"excludes home dir", item(map[string]string{"directory": "~/src/home"}), false},
{"keeps tektoncd", item(map[string]string{"project": "tektoncd/pipeline"}), true},
- {"no metadata excluded", item(map[string]string{}), false},
+ {"no metadata passes through", item(map[string]string{}), true},
}
for _, tt := range tests {
tools/review-tool/default.nix
@@ -8,7 +8,7 @@
buildGoModule {
pname = "review-tool";
- version = "0.1.0";
+ version = "0.3.0";
src = ./.;
vendorHash = null;