Skip to content

[log] Add debug logging to 5 workflow files#3481

Merged
pelikhan merged 1 commit into
mainfrom
log/enhance-workflow-logging-5-files-135cb193af8cdb63
Nov 8, 2025
Merged

[log] Add debug logging to 5 workflow files#3481
pelikhan merged 1 commit into
mainfrom
log/enhance-workflow-logging-5-files-135cb193af8cdb63

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Nov 8, 2025

Summary

This PR adds comprehensive debug logging to 5 workflow files to improve troubleshooting and development visibility. All changes follow the project's logging guidelines from AGENTS.md.

Files Enhanced

1. pkg/workflow/manual_approval.go

  • Logger: manualApprovalLog (workflow:manual_approval)
  • Logging Added:
    • Manual approval configuration processing entry
    • On: section format detection (string vs object)
    • Manual approval extraction results (found/not found)
    • Configuration success or absence messages

2. pkg/workflow/copilot_participant_steps.go

  • Logger: copilotParticipantLog (workflow:copilot_participant_steps)
  • Logging Added:
    • Function entry with participant type and count
    • Empty participants handling
    • Token preference selection (Copilot vs regular)
    • Separate logging for assignee vs reviewer step generation

3. pkg/workflow/time_delta.go

  • Logger: timeDeltaLog (workflow:time_delta)
  • Logging Added:
    • Time delta parsing entry with input parameters
    • Validation failure messages (e.g., missing '+' prefix)
    • Successful parsing confirmation with formatted output
    • Absolute date-time parsing entry and success messages

4. pkg/workflow/xml_comments.go

  • Logger: xmlCommentsLog (workflow:xml_comments)
  • Logging Added:
    • XML comment removal entry with input line count
    • Code block detection (with marker type)
    • Removal completion with statistics (removed lines, output lines)

5. pkg/workflow/secret_masking.go

  • Logger: secretMaskingLog (defined in redact_secrets.go)
  • Logging Added:
    • Extraction function entry
    • Steps count extracted from frontmatter
    • Configuration status messages (found/not found)
  • Note: File already had extensive logging in MergeSecretMasking function

Validation

Build: Compiled successfully with make build
Testing: Verified logging output with DEBUG=* ./gh-aw compile dev
No Side Effects: All logger arguments are pure values, no function calls
Naming Convention: All loggers follow pkg:filename pattern

Logging Best Practices Followed

  • ✅ No side effects in logger arguments
  • ✅ Meaningful debug messages for troubleshooting
  • ✅ Logger naming convention: pkg:filename
  • ✅ Strategic placement at function entry and key decision points
  • ✅ No duplicate logging with existing logs
  • ✅ Test files (*_test.go) not modified
  • ✅ Maximum 5 files per PR for focused review

Example Output

workflow:manual_approval Processing manual-approval configuration
workflow:manual_approval on: section is object format but no manual-approval field found
workflow:manual_approval No manual approval configured for workflow
workflow:secret_masking Extracting secret-masking configuration from frontmatter
workflow:secret_masking No secret-masking configuration found in frontmatter

Cache Updated

The logging enhancement cache has been updated to track these 5 new files, bringing the total to 25 files with enhanced logging across the codebase.

🤖 Generated with Claude Code

AI generated by Go Logger Enhancement

Enhanced the following files with debug logging statements following the project's logging guidelines:

1. **pkg/workflow/manual_approval.go** (manualApprovalLog)
   - Added logging for manual approval configuration processing
   - Logs on: section format detection and extraction results
   - Logs configuration success or absence

2. **pkg/workflow/copilot_participant_steps.go** (copilotParticipantLog)
   - Added logging for Copilot participant steps generation
   - Logs participant type, count, and token preference selection
   - Logs separate step generation for assignees and reviewers

3. **pkg/workflow/time_delta.go** (timeDeltaLog)
   - Added logging for time delta parsing operations
   - Logs input parameters and validation results
   - Logs successful parsing with formatted output
   - Logs absolute date-time parsing with multiple format attempts

4. **pkg/workflow/xml_comments.go** (xmlCommentsLog)
   - Added logging for XML comment removal process
   - Logs input line count and code block detection
   - Logs removal completion with statistics

5. **pkg/workflow/secret_masking.go** (secretMaskingLog)
   - Enhanced existing logging in extractSecretMaskingConfig
   - Logs extraction entry, steps count, and configuration status
   - Note: File already had extensive logging in MergeSecretMasking

All logging follows best practices:
- No side effects in logger arguments
- Meaningful debug messages for troubleshooting
- Logger naming convention: pkg:filename
- Strategic placement at function entry and key decision points

🤖 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 8, 2025
@pelikhan pelikhan merged commit f3fafd7 into main Nov 8, 2025
4 checks passed
@pelikhan pelikhan deleted the log/enhance-workflow-logging-5-files-135cb193af8cdb63 branch November 8, 2025 16:34
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.

1 participant