Skip to content

[log] Add debug logging to 5 pkg/ files#18906

Merged
pelikhan merged 2 commits intomainfrom
add-debug-logging-2026-02-28-82272acabecf4992
Feb 28, 2026
Merged

[log] Add debug logging to 5 pkg/ files#18906
pelikhan merged 2 commits intomainfrom
add-debug-logging-2026-02-28-82272acabecf4992

Conversation

@github-actions
Copy link
Contributor

Adds meaningful DEBUG=* debug logging to five files that previously had no logging or minimal logging, following the pkg:filename naming convention from AGENTS.md.

Files changed

File Logger New log calls
pkg/parser/schema_validation.go schemaValidationLog (new) 4 — logs entry to both public validate functions and reports forbidden-field findings
pkg/parser/schedule_time_utils.go existing scheduleTimeUtilsLog 2 — logs time-string input in parseTime() and warns on unrecognised weekday names in mapWeekday()
pkg/parser/yaml_error.go existing yamlErrorLog 1 — logs the line-number adjustment offset in adjustLineNumbersInFormattedError()
pkg/workflow/mcp_config_playwright_renderer.go existing mcpPlaywrightLog 2 — logs rendering options (copilot fields, inline args) and custom-arg counts
pkg/workflow/copilot_mcp.go existing copilotMCPLog 1 — logs whether localhost URL rewriting is enabled per custom MCP tool

All log arguments are constants or already-computed local variables — no side-effecting expressions.

Validation

  • make build passes (binary compiles without errors)
  • go test is unavailable in the sandbox due to network restrictions preventing module downloads, but the successful build confirms correct syntax and type-checking

Test plan

  • Enable DEBUG=parser:schema_validation and compile a workflow — expect log lines on entry and for any forbidden-field hits
  • Enable DEBUG=parser:schedule_time_utils and compile a schedule workflow with a UTC offset — expect Parsing time string: lines
  • Enable DEBUG=workflow:mcp_config_playwright_renderer and compile a Playwright workflow — expect option and custom-arg logs
  • Enable DEBUG=workflow:copilot_mcp and compile a Copilot workflow with custom MCP — expect rewrite-enabled log per tool

🤖 Generated with [Claude Code]((claude.com/redacted)

Generated by Go Logger Enhancement

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

  • expires on Mar 2, 2026, 8:28 PM UTC

- 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>
@github-actions github-actions bot added automation enhancement New feature or request labels Feb 28, 2026
@pelikhan pelikhan marked this pull request as ready for review February 28, 2026 20:32
Copilot AI review requested due to automatic review settings February 28, 2026 20:32
@pelikhan pelikhan merged commit 2fee289 into main Feb 28, 2026
47 of 49 checks passed
@pelikhan pelikhan deleted the add-debug-logging-2026-02-28-82272acabecf4992 branch February 28, 2026 20:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 schemaValidationLog logger in pkg/parser/schema_validation.go and 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) and pkg/parser/yaml_error.go (line-adjustment offset)
  • Adds 2 debug log calls to the existing mcpPlaywrightLog in pkg/workflow/mcp_config_playwright_renderer.go (rendering options and custom arg counts)
  • Adds 1 debug log call to the existing copilotMCPLog in pkg/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)
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
copilotMCPLog.Printf("Localhost URL rewriting for tool %s: enabled=%t", toolName, rewriteLocalhost)
copilotMCPLog.Printf("Localhost URL rewriting: enabled=%t", rewriteLocalhost)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants