From 9a1f55c625091e85037290bfa170f1f3db51a234 Mon Sep 17 00:00:00 2001 From: "ilya.kuznetsov" Date: Wed, 11 Nov 2026 15:29:50 +0000 Subject: [PATCH 1/3] Skip tests in testmask for docs and agent config changes Co-authored-by: Isaac --- tools/testmask/targets.go | 34 +++++++++++++++++++++++++++++++--- tools/testmask/targets_test.go | 27 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/tools/testmask/targets.go b/tools/testmask/targets.go index 4c00c55780b..0b40795a089 100644 --- a/tools/testmask/targets.go +++ b/tools/testmask/targets.go @@ -4,6 +4,7 @@ import ( "fmt" "maps" "os" + "path" "slices" "strings" @@ -29,9 +30,21 @@ var commonTriggerPatterns = []string{ "tools/task/", } -// ignoredFiles lists files that never affect test results. -var ignoredFiles = []string{ +// ignoredPatterns lists files that never affect test results. Patterns use +// path.Match syntax, and a trailing "/**" matches everything under a directory. +// Nested READMEs are not listed because many are test fixtures or embedded templates. +var ignoredPatterns = []string{ + ".agents/**", + ".claude/**", + ".cursor/**", ".github/CODEOWNERS", + ".github/ISSUE_TEMPLATE/**", + ".github/PULL_REQUEST_TEMPLATE.md", + ".nextchanges/*/*.md", + "AGENTS.md", + "CHANGELOG.md", + "README.md", + "SECURITY.md", } type targetMapping struct { @@ -106,13 +119,28 @@ func sourceToPrefix(src string) string { return src } +func isIgnored(file string) bool { + for _, pattern := range ignoredPatterns { + if dir, ok := strings.CutSuffix(pattern, "**"); ok { + if strings.HasPrefix(file, dir) { + return true + } + continue + } + if ok, _ := path.Match(pattern, file); ok { + return true + } + } + return false +} + // GetTargets matches files to targets based on patterns and returns the matched targets. func GetTargets(files []string, mappings []targetMapping) []string { targetSet := make(map[string]bool) unmatchedFiles := []string{} for _, file := range files { - if slices.Contains(ignoredFiles, file) { + if isIgnored(file) { continue } diff --git a/tools/testmask/targets_test.go b/tools/testmask/targets_test.go index fdb14212bd5..b8716efdbc1 100644 --- a/tools/testmask/targets_test.go +++ b/tools/testmask/targets_test.go @@ -103,6 +103,33 @@ func TestGetTargets(t *testing.T) { }, targets: []string{"test"}, }, + { + name: "docs_and_agent_files_only", + files: []string{ + ".agents/rules/testing.md", + ".claude/settings.json", + ".cursor/rules/testing.mdc", + ".github/PULL_REQUEST_TEMPLATE.md", + ".nextchanges/cli/7483.md", + "AGENTS.md", + "README.md", + }, + targets: []string{}, + }, + { + name: "nested_readme_not_ignored", + files: []string{ + "libs/template/templates/default/README.md", + }, + targets: []string{"test"}, + }, + { + name: "nextchanges_version_not_ignored", + files: []string{ + ".nextchanges/version", + }, + targets: []string{"test"}, + }, } for _, tt := range tests { From f11dfdffd3d9576fcccb5c60d36b50bab3280109 Mon Sep 17 00:00:00 2001 From: "ilya.kuznetsov" Date: Wed, 11 Nov 2026 15:48:08 +0000 Subject: [PATCH 2/3] Use acceptance output README in test case Co-authored-by: Isaac --- tools/testmask/targets_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testmask/targets_test.go b/tools/testmask/targets_test.go index b8716efdbc1..69ad2379f40 100644 --- a/tools/testmask/targets_test.go +++ b/tools/testmask/targets_test.go @@ -117,9 +117,9 @@ func TestGetTargets(t *testing.T) { targets: []string{}, }, { - name: "nested_readme_not_ignored", + name: "acceptance_output_readme_not_ignored", files: []string{ - "libs/template/templates/default/README.md", + "acceptance/bundle/templates/default-python/classic/output/my_default_python/README.md", }, targets: []string{"test"}, }, From bdbe804468a896275a92f95027195d1dd6f84a6d Mon Sep 17 00:00:00 2001 From: "ilya.kuznetsov" Date: Wed, 11 Nov 2026 15:48:59 +0000 Subject: [PATCH 3/3] Add embedded template README test case Co-authored-by: Isaac --- tools/testmask/targets_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testmask/targets_test.go b/tools/testmask/targets_test.go index 69ad2379f40..8464fcb7c6c 100644 --- a/tools/testmask/targets_test.go +++ b/tools/testmask/targets_test.go @@ -123,6 +123,13 @@ func TestGetTargets(t *testing.T) { }, targets: []string{"test"}, }, + { + name: "embedded_template_readme_not_ignored", + files: []string{ + "libs/template/templates/default-sql/template/{{.project_name}}/scratch/README.md", + }, + targets: []string{"test"}, + }, { name: "nextchanges_version_not_ignored", files: []string{