MCPcopy Create free account
hub / github.com/github/gh-aw / buildCrossRunDomainEntry

Function buildCrossRunDomainEntry

pkg/cli/audit_cross_run.go:379–402  ·  view source on GitHub ↗
(domain string, agg *crossRunDomainAgg, runIDs []int64)

Source from the content-addressed store, hash-verified

377}
378
379func buildCrossRunDomainEntry(domain string, agg *crossRunDomainAgg, runIDs []int64) DomainInventoryEntry {
380 presentRuns := make(map[int64]DomainRunStatus, len(agg.perRun))
381 for _, status := range agg.perRun {
382 presentRuns[status.RunID] = status
383 }
384
385 fullPerRun := make([]DomainRunStatus, 0, len(runIDs))
386 for _, rid := range runIDs {
387 status, ok := presentRuns[rid]
388 if !ok {
389 status = DomainRunStatus{RunID: rid, Status: "absent"}
390 }
391 fullPerRun = append(fullPerRun, status)
392 }
393
394 return DomainInventoryEntry{
395 Domain: domain,
396 SeenInRuns: len(agg.perRun),
397 TotalAllowed: agg.totalAllowed,
398 TotalBlocked: agg.totalBlocked,
399 OverallStatus: classifyFirewallDomainStatus(DomainRequestStats{Allowed: agg.totalAllowed, Blocked: agg.totalBlocked}),
400 PerRunStatus: fullPerRun,
401 }
402}
403
404// metricsRawRow holds per-run raw metric values for aggregation.
405type metricsRawRow struct {

Callers 1

Calls 1

Tested by

no test coverage detected