fix: support multi-part prefixes in issue ID extraction (#398)

This commit is contained in:
Kris Hansen
2025-11-26 17:42:14 -08:00
committed by GitHub
parent 0d32c6e982
commit 9931ac9bd9
7 changed files with 104 additions and 23 deletions

View File

@@ -42,14 +42,18 @@ func TestExtractPrefix(t *testing.T) {
{"bd-123", "bd"},
{"custom-1", "custom"},
{"TEST-999", "TEST"},
{"no-number", "no"}, // Has hyphen, so "no" is prefix
{"no-number", "no"}, // Has hyphen, suffix not numeric, first hyphen
{"nonumber", ""}, // No hyphen
{"", ""},
// Multi-part suffixes (bd-fasa regression tests)
// Multi-part non-numeric suffixes (bd-fasa regression tests)
{"vc-baseline-test", "vc"},
{"vc-92cl-gate-test", "vc"},
{"bd-multi-part-id", "bd"},
{"prefix-a-b-c-d", "prefix"},
// Multi-part prefixes with numeric suffixes
{"beads-vscode-1", "beads-vscode"},
{"alpha-beta-123", "alpha-beta"},
{"my-project-42", "my-project"},
}
for _, tt := range tests {