Skip to content

[plan] Split logs_report.go by report section #26264

@github-actions

Description

@github-actions

Objective

Split pkg/cli/logs_report.go (1,065 lines) into section-focused files.

Context

Discussion: #26221

This file contains 15+ independent builder functions, each constructing a completely separate section of the logs report. These functions share no state and can be cleanly separated.

Approach

Move builder functions to dedicated files:

  • logs_report_tools.gobuildToolUsageSummary, isValidToolName
  • logs_report_mcp.gobuildMCPFailuresSummary, buildMCPToolUsageSummary
  • logs_report_firewall.gobuildFirewallLogSummary, buildRedactedDomainsSummary, buildAccessLogSummary, aggregateDomainStats, convertDomainsToSortedSlices
  • logs_report_errors.gobuildCombinedErrorsSummary, buildMissingToolsSummary, buildMissingDataSummary
  • Keep top-level buildLogsData, renderLogsConsole, renderLogsJSON, writeSummaryFile, and helper types in logs_report.go

Files to Modify

  • Split: pkg/cli/logs_report.go
  • Create: pkg/cli/logs_report_tools.go
  • Create: pkg/cli/logs_report_mcp.go
  • Create: pkg/cli/logs_report_firewall.go
  • Create: pkg/cli/logs_report_errors.go

Acceptance Criteria

  • Original logs_report.go is ≤ 300 lines
  • Each new file is ≤ 300 lines
  • make build && make test-unit pass without errors
  • make fmt && make lint pass without errors

Generated by Plan Command for issue #discussion #26221 · ● 150.1K ·

  • expires on Apr 16, 2026, 5:18 PM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions