Skip to content

[log] Add debug logging to tar, schema utilities, MCP config types, and wizard command#19651

Merged
pelikhan merged 2 commits intomainfrom
add-debug-logging-tar-schema-mcp-config-ad118a892165a80b
Mar 5, 2026
Merged

[log] Add debug logging to tar, schema utilities, MCP config types, and wizard command#19651
pelikhan merged 2 commits intomainfrom
add-debug-logging-tar-schema-mcp-config-ad118a892165a80b

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 4, 2026

Add meaningful debug logging statements to 5 files that lacked any logging, helping with troubleshooting and development diagnostics.

Changes

  • pkg/fileutil/tar.go: Adds tarLog to log tar extraction — target path, archive size, number of entries scanned, and whether the file was found or not. Useful when debugging "file not found in archive" issues.

  • pkg/parser/schema_utilities.go: Adds schemaUtilitiesLog to log ignored frontmatter field filtering — counts ignored fields to check and logs each field that is removed. Helps diagnose schema migration and field removal behavior.

  • pkg/cli/mcp_schema.go: Adds mcpSchemaLog to the AddSchemaDefault helper — logs when a schema property default is set and when a requested property doesn't exist. Aids in debugging MCP tool elicitation defaults (SEP-1024).

  • pkg/workflow/mcp_config_types.go: Adds mcpConfigTypesLog to getWellKnownContainer — logs whether a well-known container image was found for a given MCP command (npx, uvx, etc.). Helps diagnose automatic MCP server containerization.

  • pkg/cli/add_wizard_command.go: Adds addWizardLog to the wizard RunE closure — logs startup parameters and the TTY/CI environment check result. Useful when diagnosing why the wizard fails to start in certain environments.

Validation

  • make build passes with no compilation errors
  • Targeted unit tests pass: go test ./pkg/fileutil/... ./pkg/parser/... ./pkg/cli/... ./pkg/workflow/...

Logger naming convention

All loggers follow the pkg:filename pattern per project guidelines:

  • "fileutil:tar", "parser:schema_utilities", "cli:mcp_schema", "workflow:mcp_config_types", "cli:add_wizard_command"

Generated by Go Logger Enhancement ·

  • expires on Mar 6, 2026, 8:31 PM UTC

…d wizard command

- pkg/fileutil/tar.go: Log target path, archive size, entries scanned, and whether file was found
- pkg/parser/schema_utilities.go: Log ignored field filtering with counts and field names
- pkg/cli/mcp_schema.go: Log schema property default assignments and missing properties
- pkg/workflow/mcp_config_types.go: Log well-known container lookups for MCP commands
- pkg/cli/add_wizard_command.go: Log wizard startup parameters and TTY/CI detection results

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Mar 4, 2026
@pelikhan pelikhan marked this pull request as ready for review March 5, 2026 03:02
Copilot AI review requested due to automatic review settings March 5, 2026 03:02
@pelikhan pelikhan merged commit fada5ce into main Mar 5, 2026
49 checks passed
@pelikhan pelikhan deleted the add-debug-logging-tar-schema-mcp-config-ad118a892165a80b branch March 5, 2026 03:02
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

Adds debug logging to several previously silent code paths to improve troubleshooting across tar extraction, schema utilities, MCP schema defaults, MCP config container mapping, and the add-wizard command.

Changes:

  • Introduces package-scoped debug loggers (logger.New("pkg:filename")) in 5 files.
  • Adds targeted debug statements for tar extraction scanning, ignored frontmatter filtering, schema default application, well-known MCP container lookup, and add-wizard environment checks.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/fileutil/tar.go Logs tar extraction parameters and scan outcomes (found/not found, entry count).
pkg/parser/schema_utilities.go Logs ignored frontmatter filtering, including per-field removals.
pkg/cli/mcp_schema.go Logs when defaults are applied or skipped due to missing properties.
pkg/workflow/mcp_config_types.go Logs whether a well-known container mapping was found for a command.
pkg/cli/add_wizard_command.go Logs wizard startup parameters and terminal/CI eligibility checks.
Comments suppressed due to low confidence (1)

pkg/parser/schema_utilities.go:15

  • The doc comment says this function "currently does nothing", but the implementation actively filters keys listed in constants.IgnoredFrontmatterFields (currently includes "user-invokable") and now even logs removals. Please update the comment to reflect the current behavior (or, if the intent is truly no-op, consider removing the filtering logic and keeping it validated elsewhere).
// filterIgnoredFields removes ignored fields from frontmatter without warnings
// NOTE: This function is kept for backward compatibility but currently does nothing
// as all previously ignored fields (description, applyTo) are now validated by the schema
func filterIgnoredFields(frontmatter map[string]any) map[string]any {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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