Skip to content

Commit b202642

Browse files
fix: ClassifyByKeywords recognises CI/CD patterns (ci/ prefix) (#147)
'CI/CD pipeline completed' was not classified as build because ClassifyByKeywords only checked for 'ci ' (trailing space), missing the 'CI/CD' style where a slash follows 'CI'. Adding the 'ci/' check catches: - 'CI/CD pipeline completed' - 'CI/CD workflow triggered' - Any pattern where 'CI' is immediately followed by a slash False-positive analysis: common English words containing 'ci' (recipe, social, special, facial...) are followed by letters, not '/', so the new check introduces no false matches. Regression tests: two new InlineData entries in KeywordFallback_BackwardCompatible. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]>
1 parent dbfe57d commit b202642

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/OpenClaw.Shared/NotificationCategorizer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public static (string title, string type) ClassifyByKeywords(string text)
123123
return ("⚠️ Error", "error");
124124
if (text.Contains("build", StringComparison.OrdinalIgnoreCase) ||
125125
text.Contains("ci ", StringComparison.OrdinalIgnoreCase) ||
126+
text.Contains("ci/", StringComparison.OrdinalIgnoreCase) ||
126127
text.Contains("deploy", StringComparison.OrdinalIgnoreCase))
127128
return ("🔨 Build", "build");
128129
return ("🤖 OpenClaw", "info");

tests/OpenClaw.Shared.Tests/NotificationCategorizerTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class NotificationCategorizerTests
2828
[InlineData("Exception occurred", "error")]
2929
[InlineData("Build succeeded", "build")]
3030
[InlineData("CI pipeline completed", "build")]
31+
[InlineData("CI/CD pipeline completed", "build")]
32+
[InlineData("CI/CD workflow triggered", "build")]
3133
[InlineData("Deploy finished", "build")]
3234
[InlineData("Hello world", "info")]
3335
public void KeywordFallback_BackwardCompatible(string message, string expectedType)

0 commit comments

Comments
 (0)