Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 9, 2025

Summary

Enhanced 4 CLI utility files with strategic debug logging following project guidelines from AGENTS.md. These files handle core CLI operations like JQ filtering, file tracking, import processing, and frontmatter manipulation.

Files Enhanced

  1. pkg/cli/jq.go (cli:jq)

    • JQ filter operations with filter and input size
    • JQ binary path detection
    • Command execution success/failure with output size
  2. pkg/cli/file_tracker.go (cli:file_tracker)

    • File tracker initialization with git root
    • File creation and modification tracking with paths
    • Staging operations with file counts
    • Rollback operations for created and modified files
  3. pkg/cli/imports.go (cli:imports)

    • Import processing with workflowspec parameters
    • Frontmatter extraction and import count
    • Import conversions from local to workflowspec format
    • @include directive processing
  4. pkg/cli/frontmatter_utils.go (cli:frontmatter_utils)

    • Field update operations with names and values
    • Raw frontmatter line usage tracking
    • Field update in-place vs append decisions

Logging Best Practices Followed

✅ Proper logger naming convention (pkg:filename)
✅ No side effects in logger arguments
✅ Meaningful messages for debugging
✅ Logging at function entry and key operations
✅ Success and failure path tracking
✅ No duplicate logging with user-facing messages

Testing

  • ✅ Build validated with make build
  • ✅ Compilation tested with DEBUG=* ./gh-aw compile dev
  • ✅ No compilation errors
  • ✅ Logger infrastructure working correctly

Cache Updated

Cache files updated in /tmp/gh-aw/cache-memory/go-logger/:

  • processed-files.json: Now tracks 29 enhanced files
  • last-run.json: Updated to commit 0d0ab2f

🤖 Generated with Claude Code

AI generated by Go Logger Enhancement

Enhanced 4 CLI utility files with strategic debug logging following
project guidelines from AGENTS.md:

1. **pkg/cli/jq.go** (cli:jq):
   - Log JQ filter operations with filter and input size
   - Track JQ binary path detection
   - Log command execution success/failure with output size

2. **pkg/cli/file_tracker.go** (cli:file_tracker):
   - Log file tracker initialization with git root
   - Track file creation and modification with paths
   - Log staging operations with file counts
   - Track rollback operations for both created and modified files

3. **pkg/cli/imports.go** (cli:imports):
   - Log import processing with workflowspec parameters
   - Track frontmatter extraction and import count
   - Log import conversions from local to workflowspec format
   - Track @include directive processing

4. **pkg/cli/frontmatter_utils.go** (cli:frontmatter_utils):
   - Log field update operations with names and values
   - Track raw frontmatter line usage
   - Log whether fields are updated in-place or appended

All logging follows best practices:
- Uses proper logger naming convention (pkg:filename)
- Logger arguments have no side effects
- Meaningful messages for debugging
- Logs at function entry and key operations
- Tracks success and failure paths

🤖 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 9, 2025
@pelikhan pelikhan merged commit 13b219e into main Nov 9, 2025
4 checks passed
@pelikhan pelikhan deleted the log/enhance-cli-logging-20251109-121406-da57d32bd51deb25 branch November 9, 2025 15:14
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