diff --git a/actions/setup/js/push_repo_memory.cjs b/actions/setup/js/push_repo_memory.cjs index 0315da51032..6dd889373f2 100644 --- a/actions/setup/js/push_repo_memory.cjs +++ b/actions/setup/js/push_repo_memory.cjs @@ -195,11 +195,8 @@ async function main() { // Validate file name patterns if filter is set if (fileGlobFilter) { - const patterns = fileGlobFilter - .trim() - .split(/\s+/) - .filter(Boolean) - .map(pattern => globPatternToRegex(pattern)); + const patternStrs = fileGlobFilter.trim().split(/\s+/).filter(Boolean); + const patterns = patternStrs.map(pattern => globPatternToRegex(pattern)); // Test patterns against the relative file path within the memory directory // Patterns are specified relative to the memory artifact directory, not the branch path @@ -212,8 +209,7 @@ async function main() { const matchResults = patterns.map((pattern, idx) => { const matches = pattern.test(normalizedRelPath); - const patternStr = fileGlobFilter.trim().split(/\s+/).filter(Boolean)[idx]; - core.debug(` Pattern ${idx + 1}: "${patternStr}" -> ${pattern.source} -> ${matches ? "✓ MATCH" : "✗ NO MATCH"}`); + core.debug(` Pattern ${idx + 1}: "${patternStrs[idx]}" -> ${pattern.source} -> ${matches ? "✓ MATCH" : "✗ NO MATCH"}`); return matches; }); @@ -222,7 +218,6 @@ async function main() { core.warning(`Skipping file that does not match allowed patterns: ${normalizedRelPath}`); core.info(` File path being tested (relative to artifact): ${normalizedRelPath}`); core.info(` Configured patterns: ${fileGlobFilter}`); - const patternStrs = fileGlobFilter.trim().split(/\s+/).filter(Boolean); patterns.forEach((pattern, idx) => { core.info(` Pattern: "${patternStrs[idx]}" -> Regex: ${pattern.source} -> ${matchResults[idx] ? "✅ MATCH" : "❌ NO MATCH"}`); }); diff --git a/pkg/cli/gateway_logs.go b/pkg/cli/gateway_logs.go index 3078c635bcc..7211187f5fb 100644 --- a/pkg/cli/gateway_logs.go +++ b/pkg/cli/gateway_logs.go @@ -617,39 +617,28 @@ func renderGatewayMetricsTable(metrics *GatewayMetrics, verbose bool) string { if server.RequestCount > 0 { avgTime = server.TotalDuration / float64(server.RequestCount) } + row := []string{ + serverName, + strconv.Itoa(server.RequestCount), + strconv.Itoa(server.ToolCallCount), + fmt.Sprintf("%.0fms", avgTime), + strconv.Itoa(server.ErrorCount), + } if hasFiltered { - serverRows = append(serverRows, []string{ - serverName, - strconv.Itoa(server.RequestCount), - strconv.Itoa(server.ToolCallCount), - fmt.Sprintf("%.0fms", avgTime), - strconv.Itoa(server.ErrorCount), - strconv.Itoa(server.FilteredCount), - }) - } else { - serverRows = append(serverRows, []string{ - serverName, - strconv.Itoa(server.RequestCount), - strconv.Itoa(server.ToolCallCount), - fmt.Sprintf("%.0fms", avgTime), - strconv.Itoa(server.ErrorCount), - }) + row = append(row, strconv.Itoa(server.FilteredCount)) } + serverRows = append(serverRows, row) } + headers := []string{"Server", "Requests", "Tool Calls", "Avg Time", "Errors"} if hasFiltered { - output.WriteString(console.RenderTable(console.TableConfig{ - Title: "Server Usage", - Headers: []string{"Server", "Requests", "Tool Calls", "Avg Time", "Errors", "Filtered"}, - Rows: serverRows, - })) - } else { - output.WriteString(console.RenderTable(console.TableConfig{ - Title: "Server Usage", - Headers: []string{"Server", "Requests", "Tool Calls", "Avg Time", "Errors"}, - Rows: serverRows, - })) + headers = append(headers, "Filtered") } + output.WriteString(console.RenderTable(console.TableConfig{ + Title: "Server Usage", + Headers: headers, + Rows: serverRows, + })) } // DIFC filtered events table