[log] Add debug logging to 5 pkg/ files#18906
Conversation
- parser/schema_validation.go: new schemaValidationLog, logs entry to both public validation functions and when shared-workflow forbidden fields are found - parser/schedule_time_utils.go: log time-string input in parseTime() and warn on unrecognised weekday names in mapWeekday() - parser/yaml_error.go: log line-number adjustment offset in adjustLineNumbersInFormattedError() - workflow/mcp_config_playwright_renderer.go: log copilot/inline options and custom-arg counts in renderPlaywrightMCPConfigWithOptions() - workflow/copilot_mcp.go: log whether localhost URL rewriting is enabled for each custom MCP tool Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds DEBUG=*-style debug logging to five previously unlogged (or minimally logged) Go source files in pkg/, following the pkg:filename namespace convention established in AGENTS.md.
Changes:
- Introduces a new
schemaValidationLoglogger inpkg/parser/schema_validation.goand adds 4 debug log calls at function entry points and forbidden-field detection - Adds 2 debug log calls to existing loggers in
pkg/parser/schedule_time_utils.go(time string input) andpkg/parser/yaml_error.go(line-adjustment offset) - Adds 2 debug log calls to the existing
mcpPlaywrightLoginpkg/workflow/mcp_config_playwright_renderer.go(rendering options and custom arg counts) - Adds 1 debug log call to the existing
copilotMCPLoginpkg/workflow/copilot_mcp.go(localhost URL rewriting decision per tool)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pkg/parser/schema_validation.go |
Adds new logger import and variable, plus 4 debug log calls for validation entry points and forbidden field detection |
pkg/parser/schedule_time_utils.go |
Adds debug logging for time string input in parseTime() and unrecognized weekday names in mapWeekday() |
pkg/parser/yaml_error.go |
Adds a single debug log for the line-adjustment offset in adjustLineNumbersInFormattedError() |
pkg/workflow/mcp_config_playwright_renderer.go |
Adds debug logging for rendering options and custom arg application |
pkg/workflow/copilot_mcp.go |
Adds debug logging for the localhost URL rewriting decision per MCP tool |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Determine if localhost URLs should be rewritten to host.docker.internal | ||
| // This is needed when firewall is enabled (agent is not disabled) | ||
| rewriteLocalhost := shouldRewriteLocalhostToDocker(workflowData) | ||
| copilotMCPLog.Printf("Localhost URL rewriting for tool %s: enabled=%t", toolName, rewriteLocalhost) |
There was a problem hiding this comment.
The new log line at line 91 redundantly includes toolName in the format string ("Localhost URL rewriting for tool %s: enabled=%t"), even though toolName was already logged on the immediately preceding line 86 ("Rendering custom MCP config for tool: %s"). Since both log lines are always executed together, repeating toolName adds noise to the log output. The new line should convey only the new information — i.e., whether localhost URL rewriting is enabled — without repeating the tool name that is already in context from the previous log message.
| copilotMCPLog.Printf("Localhost URL rewriting for tool %s: enabled=%t", toolName, rewriteLocalhost) | |
| copilotMCPLog.Printf("Localhost URL rewriting: enabled=%t", rewriteLocalhost) |
Adds meaningful
DEBUG=*debug logging to five files that previously had no logging or minimal logging, following thepkg:filenamenaming convention from AGENTS.md.Files changed
pkg/parser/schema_validation.goschemaValidationLog(new)pkg/parser/schedule_time_utils.goscheduleTimeUtilsLogparseTime()and warns on unrecognised weekday names inmapWeekday()pkg/parser/yaml_error.goyamlErrorLogadjustLineNumbersInFormattedError()pkg/workflow/mcp_config_playwright_renderer.gomcpPlaywrightLogpkg/workflow/copilot_mcp.gocopilotMCPLogAll log arguments are constants or already-computed local variables — no side-effecting expressions.
Validation
make buildpasses (binary compiles without errors)go testis unavailable in the sandbox due to network restrictions preventing module downloads, but the successful build confirms correct syntax and type-checkingTest plan
DEBUG=parser:schema_validationand compile a workflow — expect log lines on entry and for any forbidden-field hitsDEBUG=parser:schedule_time_utilsand compile a schedule workflow with a UTC offset — expectParsing time string:linesDEBUG=workflow:mcp_config_playwright_rendererand compile a Playwright workflow — expect option and custom-arg logsDEBUG=workflow:copilot_mcpand compile a Copilot workflow with custom MCP — expect rewrite-enabled log per tool🤖 Generated with [Claude Code]((claude.com/redacted)
Warning
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.