-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
Description
Objective
Add structured debug logging to critical error paths in workflow compilation, MCP configuration, and validation systems to improve troubleshooting capabilities.
Context
Currently only 11 debug logs exist for error paths - insufficient for troubleshooting production issues. The top 5 high-impact error sites need comprehensive debug logging to aid developers in diagnosing workflow issues.
Files to Modify
High-impact files with complex error paths:
pkg/workflow/compiler_orchestrator.go(44 error returns)pkg/workflow/mcp-config.go(999 LOC)pkg/workflow/runtime_setup.go(1,016 LOC)pkg/workflow/permissions.go(953 LOC)pkg/workflow/safe_outputs_config_generation.go(854 LOC)
Approach
Add debug logging using the existing logger package:
import "github.com/githubnext/gh-aw/pkg/logger"
var log = logger.New("workflow:compiler_orchestrator")
func someValidation() error {
log.Printf("Starting validation for workflow: %s", workflowName)
if err := validate(); err != nil {
log.Printf("Validation failed: %v (context: %+v)", err, contextData)
return fmt.Errorf("validation failed: %w", err)
}
log.Printf("Validation completed successfully")
return nil
}Follow logger naming convention: "workflow:filename" (e.g., "workflow:compiler_orchestrator")
Add logging for:
- Operation start/completion
- Validation failures with context
- Configuration parsing steps
- Permission checks
- MCP server initialization
Acceptance Criteria
- Debug logging added to all 5 high-impact error sites
- Logs include structured context (file, operation, input values)
- Uses existing
loggerpackage with appropriate namespaces - Logs only appear when DEBUG environment variable matches
- No performance impact when debug logging disabled
- Follows
"workflow:filename"naming convention
Validation
Test debug logging:
# Enable debug logs
DEBUG=workflow:* ./gh-aw compile test-workflow.md
# Verify logs appear for error paths
DEBUG=workflow:compiler_orchestrator ./gh-aw compile invalid-workflow.md
# Check performance (no impact when disabled)
time ./gh-aw compile test-workflow.mdRelated to #9236
AI generated by Plan Command for discussion #9231
Copilot