Refactor logs_parsing.go into focused modules under 300-line limit #9978
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pkg/cli/logs_parsing.goexceeded the 300-line complexity limit at 616 lines, mixing core parsing, engine-specific formats, firewall analysis, and JavaScript execution.Changes
Split into 4 focused modules:
logs_parsing_core.go(240 lines) - aw_info.json parsing, artifact discovery (parseAwInfo,extractEngineFromAwInfo,findAgentLogFile,findAgentOutputFile)logs_parsing_engines.go(57 lines) - Engine-specific log parsing and fallback (parseLogFileWithEngine)logs_parsing_firewall.go(231 lines) - Firewall log analysis and markdown generation (parseFirewallLogs)logs_parsing_javascript.go(152 lines) - JavaScript parser execution with mocked Actions environment (parseAgentLog)Technical Notes
Renamed from
logs_parsing_js.gotologs_parsing_javascript.go- Go's build system ignores files with_jssuffix.All functions remain package-private; no behavioral changes.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.