Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions pkg/cli/access_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,7 @@ func parseSquidAccessLog(logPath string, verbose bool) (*DomainAnalysis, error)
}
defer file.Close()

analysis := &DomainAnalysis{
DomainBuckets: DomainBuckets{
AllowedDomains: []string{},
BlockedDomains: []string{},
},
}
analysis := &DomainAnalysis{}

allowedDomainsSet := make(map[string]bool)
blockedDomainsSet := make(map[string]bool)
Expand Down Expand Up @@ -189,12 +184,7 @@ func analyzeMultipleAccessLogs(accessLogsDir string, verbose bool) (*DomainAnaly
verbose,
parseSquidAccessLog,
func() *DomainAnalysis {
return &DomainAnalysis{
DomainBuckets: DomainBuckets{
AllowedDomains: []string{},
BlockedDomains: []string{},
},
}
return &DomainAnalysis{}
},
)
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/cli/add_workflow_pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/github/gh-aw/pkg/console"
"github.com/github/gh-aw/pkg/logger"
"github.com/github/gh-aw/pkg/sliceutil"
)

var addWorkflowPRLog = logger.New("cli:add_workflow_pr")
Expand Down Expand Up @@ -116,10 +117,9 @@ func addWorkflowsWithPR(workflows []*ResolvedWorkflow, opts AddOptions) (int, st
prTitle = fmt.Sprintf("Add agentic workflow %s", joinedNames)
prBody = fmt.Sprintf("Add agentic workflow %s", joinedNames)
} else {
workflowNames := make([]string, len(workflows))
for i, wf := range workflows {
workflowNames[i] = wf.Spec.WorkflowName
}
workflowNames := sliceutil.Map(workflows, func(wf *ResolvedWorkflow) string {
return wf.Spec.WorkflowName
})
joinedNames = strings.Join(workflowNames, ", ")
commitMessage = fmt.Sprintf("Add agentic workflows: %s", joinedNames)
prTitle = fmt.Sprintf("Add agentic workflows: %s", joinedNames)
Expand Down
8 changes: 4 additions & 4 deletions pkg/cli/audit_report_analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/github/gh-aw/pkg/console"
"github.com/github/gh-aw/pkg/sliceutil"
"github.com/github/gh-aw/pkg/timeutil"
)

Expand Down Expand Up @@ -90,10 +91,9 @@ func generateFindings(processedRun ProcessedRun, metrics MetricsData, errors []E

// MCP failure findings
if len(processedRun.MCPFailures) > 0 {
serverNames := make([]string, len(processedRun.MCPFailures))
for i, failure := range processedRun.MCPFailures {
serverNames[i] = failure.ServerName
}
serverNames := sliceutil.Map(processedRun.MCPFailures, func(failure MCPFailureReport) string {
return failure.ServerName
})
findings = append(findings, Finding{
Category: "tooling",
Severity: "high",
Expand Down
8 changes: 0 additions & 8 deletions pkg/cli/firewall_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ func parseFirewallLog(logPath string, verbose bool) (*FirewallAnalysis, error) {
defer file.Close()

analysis := &FirewallAnalysis{
DomainBuckets: DomainBuckets{
AllowedDomains: []string{},
BlockedDomains: []string{},
},
RequestsByDomain: make(map[string]DomainRequestStats),
}

Expand Down Expand Up @@ -391,10 +387,6 @@ func analyzeMultipleFirewallLogs(logsDir string, verbose bool) (*FirewallAnalysi
parseFirewallLog,
func() *FirewallAnalysis {
return &FirewallAnalysis{
DomainBuckets: DomainBuckets{
AllowedDomains: []string{},
BlockedDomains: []string{},
},
RequestsByDomain: make(map[string]DomainRequestStats),
}
},
Expand Down
Loading