Skip to content

Conversation

@github-actions
Copy link
Contributor

Summary

Enhanced debug logging in 5 key Go files to improve troubleshooting and development workflow visibility. All files already had logger declarations but minimal logging calls, making them ideal candidates for enhancement.

Files Enhanced

1. pkg/workflow/copilot_engine.go (882 lines, 2→8 logging calls)

  • ✅ Log execution steps generation with workflow name and firewall status
  • ✅ Log firewall mode selection (simplified vs standard arguments)
  • ✅ Log custom model and agent file configuration
  • ✅ Log tool permission arguments count
  • ✅ Log Squid logs collection decisions

2. pkg/workflow/frontmatter_extraction.go (714 lines, 2→6 logging calls)

  • ✅ Log YAML section extraction operations
  • ✅ Log processing of 'on' section field commenting
  • ✅ Log expansion of 'all: read' permissions
  • ✅ Log feature extraction with counts (using log.Enabled())

3. pkg/workflow/safe_jobs.go (383 lines, 2→8 logging calls)

  • ✅ Log safe-jobs parsing from frontmatter with counts
  • ✅ Log parsed safe-job configuration details
  • ✅ Log safe-jobs building with threat detection status
  • ✅ Log safe-job creation with dependencies and steps
  • ✅ Log completion and error conditions

4. pkg/workflow/claude_tools.go (371 lines, 2→5 logging calls)

  • ✅ Log neutral tool expansion to Claude-specific tools
  • ✅ Log default Claude tools addition
  • ✅ Log allowed tools string generation (using log.Enabled())

5. pkg/workflow/claude_engine.go (296 lines, 2→6 logging calls)

  • ✅ Log custom model configuration
  • ✅ Log max turns setting
  • ✅ Log MCP configuration addition
  • ✅ Log custom agent file usage

Logging Guidelines Followed

✅ Added logging at function entry points with key parameters
✅ Logged important control flow decisions
✅ Logged state changes and configuration applications
✅ Used existing variables without side effects (no function calls in log args)
✅ Applied log.Enabled() checks for verbose operations
✅ Followed project naming convention (pkg:filename)
✅ Maximum 5 files per PR (focused and reviewable)
✅ No test files modified

Validation

  • ✅ Successfully built with make build (no compilation errors)
  • ✅ Tested with DEBUG=* ./gh-aw compile dev - logging output verified
  • ✅ All logging calls use meaningful messages
  • ✅ No duplicate logging with existing statements

Example Output

workflow:copilot_engine Generating execution steps for Copilot: workflow=Dev, firewall=false
workflow:copilot_engine Using standard mode with full arguments
workflow:copilot_engine Adding 46 tool permission arguments
workflow:copilot_engine Firewall disabled, skipping Squid logs collection
workflow:frontmatter_extraction Extracting YAML section: permissions
workflow:frontmatter_extraction Processing 'on' section to comment out fields
workflow:safe_jobs Building 2 safe-jobs, threatDetectionEnabled=true
workflow:claude_tools Expanding 3 neutral tools to Claude-specific tools

Quality Checklist

  • ✅ Maximum 5 files modified
  • ✅ No test files modified (*_test.go)
  • ✅ Each file has logger declaration with correct naming convention
  • ✅ Logger arguments don't compute anything or cause side effects
  • ✅ Logging messages are meaningful and helpful
  • ✅ No duplicate logging with existing logs
  • ✅ Changes validated with make build
  • ✅ Workflow compilation tested with DEBUG=* ./gh-aw compile dev

🤖 Generated with Claude Code

AI generated by Go Logger Enhancement

Add meaningful debug logging statements to 5 key Go files to improve
troubleshooting and development workflow visibility:

**Files Enhanced:**

1. **pkg/workflow/copilot_engine.go**
   - Log execution steps generation with workflow name and firewall status
   - Log firewall mode selection (simplified vs standard arguments)
   - Log custom model and agent file configuration
   - Log tool permission arguments count
   - Log Squid logs collection decisions

2. **pkg/workflow/frontmatter_extraction.go**
   - Log YAML section extraction operations
   - Log processing of 'on' section field commenting
   - Log expansion of 'all: read' permissions
   - Log feature extraction with counts (using log.Enabled())

3. **pkg/workflow/safe_jobs.go**
   - Log safe-jobs parsing from frontmatter with counts
   - Log parsed safe-job configuration details
   - Log safe-jobs building with threat detection status
   - Log safe-job creation with dependencies and steps
   - Log completion and error conditions

4. **pkg/workflow/claude_tools.go**
   - Log neutral tool expansion to Claude-specific tools
   - Log default Claude tools addition
   - Log allowed tools string generation (using log.Enabled())

5. **pkg/workflow/claude_engine.go**
   - Log custom model configuration
   - Log max turns setting
   - Log MCP configuration addition
   - Log custom agent file usage

**Logging Guidelines Followed:**
- Added logging at function entry points with key parameters
- Logged important control flow decisions
- Logged state changes and configuration applications
- Used existing variables without side effects
- Applied log.Enabled() checks for verbose operations
- Followed project naming convention (pkg:filename)

All changes validated with `make build` and tested with
`DEBUG=* ./gh-aw compile dev` to verify logging output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Nov 19, 2025
@pelikhan pelikhan merged commit 4654667 into main Nov 19, 2025
4 checks passed
@pelikhan pelikhan deleted the log/enhance-debug-logging-copilot-claude-safe-jobs-99c6ce3f8476853d branch November 19, 2025 14:01
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