Skip to content

[log] Add debug logging to 5 workflow-related files#15338

Merged
pelikhan merged 3 commits intomainfrom
main-984d2988f97e4d03
Feb 13, 2026
Merged

[log] Add debug logging to 5 workflow-related files#15338
pelikhan merged 3 commits intomainfrom
main-984d2988f97e4d03

Conversation

@github-actions
Copy link
Contributor

Summary

This PR enhances debug logging across 5 critical workflow compilation files to improve troubleshooting and development visibility. All files already had logger declarations, so this change adds meaningful logging calls at key execution points.

Files Enhanced

1. pkg/workflow/safe_outputs_config.go

Added logging for safe-outputs configuration extraction:

  • Configuration processing start with key count
  • Individual output handler enablement (create-issue, create-pull-request)
  • Allowed domains configuration
  • Default threat detection application
  • Final extraction status

2. pkg/workflow/concurrency_validation.go

Added logging for concurrency group expression validation:

  • Brace balance checking progress
  • Unclosed brace detection with position details
  • Expression count and validation status
  • Logical operator deep validation
  • Parse failure details

3. pkg/workflow/expression_builder.go

Added logging for GitHub Actions expression tree construction:

  • AND condition node creation
  • Disjunction term count in reaction conditions
  • Safe-output type condition building

4. pkg/workflow/redact_secrets.go

Added logging for secret masking operations:

  • Secret reference scanning with YAML size
  • Unique secret count discovered
  • No-op vs. active redaction step generation
  • Secret count in redaction steps

5. pkg/workflow/markdown_security_scanner.go

Added logging for security scanning:

  • Frontmatter stripping details (lines removed, bytes scanned)
  • Individual security category scan execution (6 categories)
  • Unicode abuse detection line count
  • Final scan results with issue and category counts
  • Added helper function countCategories() for summary logging

Quality Guidelines Followed

No side effects - All log arguments are simple values or pre-computed
Meaningful messages - Each log provides context about what's happening
Proper logger naming - All files already used correct pkg:filename pattern
Efficient logging - Used log.Enabled() check for expensive debug info
No test files - Only modified production code
Build validated - Ran make build successfully

Testing

# Build validation
make build  # ✓ PASSED

# Runtime validation
go run ./cmd/gh-aw compile --help  # ✓ Logger output visible in stderr

Cache Updated

Updated workflow cache to track these 5 newly-enhanced files, bringing total tracked files to 19.


🤖 Generated with Claude Code

AI generated by Go Logger Enhancement

  • expires on Feb 15, 2026, 7:43 AM UTC

Enhanced debug logging across critical workflow compilation files for better
troubleshooting. Added meaningful logging calls at key execution points.

Files enhanced:
- pkg/workflow/safe_outputs_config.go: Config extraction and handler setup
- pkg/workflow/concurrency_validation.go: Expression validation progress
- pkg/workflow/expression_builder.go: Condition tree construction
- pkg/workflow/redact_secrets.go: Secret scanning and masking
- pkg/workflow/markdown_security_scanner.go: Security category scans

All logging follows guidelines: no side effects, meaningful messages, and
proper use of log.Enabled() for expensive operations.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Feb 13, 2026
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove the if log.Enabled() . just call the log function

Copy link
Contributor

Copilot AI commented Feb 13, 2026

@pelikhan I've opened a new pull request, #15339, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Remove redundant if log.Enabled() checks in workflow files

Removed unnecessary `if log.Enabled()` conditionals from 8 files in pkg/workflow/.
The logger package already checks enabled state internally, making these
extra conditionals redundant. None of the logging operations were expensive
enough to warrant the conditional check (just counting lengths, time calculations).

Files updated:
- safe_outputs_config.go
- redact_secrets.go
- concurrency_validation.go
- expression_builder.go (2 instances)
- markdown_security_scanner.go (2 instances)
- claude_tools.go
- compiler.go

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan merged commit 0287b31 into main Feb 13, 2026
47 of 48 checks passed
@pelikhan pelikhan deleted the main-984d2988f97e4d03 branch February 13, 2026 07:55
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.

3 participants