From 3718e9a6905269c353e70e05d00c36b612cfb3d8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 23:24:56 +0000 Subject: [PATCH] fix(ci): optimize regex parsing in PR review script - Optimize regex execution loop by caching the test output string. - Ensure `debug_regex.js` is removed. - Verified local build and lint pass. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- scripts/automated-pr-review.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/automated-pr-review.mjs b/scripts/automated-pr-review.mjs index 9ce11a9f..280f3c8d 100644 --- a/scripts/automated-pr-review.mjs +++ b/scripts/automated-pr-review.mjs @@ -146,8 +146,9 @@ async function reviewPR(prNumber, baseRef) { // Extract failing test files const failingTests = []; const failureRegex = /✖\s+(tests\/[\w\-\.\/]+)\s+failed with exit code 1/g; + const testOutput = testRes.stdout + '\n' + testRes.stderr; let match; - while ((match = failureRegex.exec(testRes.stdout + '\n' + testRes.stderr)) !== null) { + while ((match = failureRegex.exec(testOutput)) !== null) { failingTests.push(match[1]); }