Extract shared base for access and firewall log summaries#46079
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Consolidates shared access and firewall summary fields while aligning counter names.
Changes:
- Adds the embedded
FirewallSummaryBase. - Renames access counters and verifies flattened JSON serialization.
- Updates both summary builders to initialize the shared base.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/logs_report_firewall.go |
Defines and populates the shared summary base. |
pkg/cli/logs_report_test.go |
Updates assertions and tests JSON field names. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
This comment has been minimized.
This comment has been minimized.
|
Hey
|
|
/matt |
|
/review |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ PR Code Quality Reviewer completed the code quality review. |
🧪 Test Quality Sentinel Report✅ Test Quality Score: 88/100 — Excellent
📊 Metrics (5 tests)
Verdict
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /codebase-design — one minor suggestion on test coverage symmetry.
📋 Key Themes & Highlights
Key Themes
- Good deduplication:
FirewallSummaryBasecleanly eliminates the duplicate struct fields and aligns counter names across both summary types. - Test coverage gap:
TestAccessLogSummaryJSONUsesEmbeddedBaseFieldscovers onlyAccessLogSummaryJSON serialization;FirewallLogSummarylacks a parallel test for the same embedded fields.
Positive Highlights
- ✅
FirewallSummaryBaseembedding is the right abstraction — single source of truth for shared fields. - ✅ Counter name alignment (
AllowedRequests/BlockedRequests) improves consistency across the API surface. - ✅ JSON serialization test correctly asserts that legacy field names are absent from the output.
- ✅ Constructor functions cleanly populate the base literal rather than scattering assignments.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 19.6 AIC · ⌖ 4.57 AIC · ⊞ 6.7K
Comment /matt to run again
There was a problem hiding this comment.
Two issues require attention before merging
The refactor cleanly eliminates duplication, but has a breaking wire-format change and a naming problem.
1. Silent breaking JSON rename (high) — AccessLogSummary previously serialized AllowedCount as allowed_count and BlockedCount as blocked_count. After this PR those keys become allowed_requests and blocked_requests. Any consumer parsing the old keys will silently see zeros. No migration path or deprecation notice is provided.
2. Misleading shared-base name (medium) — FirewallSummaryBase is now embedded in AccessLogSummary, which is not a firewall type. The name implies firewall ownership. Rename to something neutral like RequestSummaryBase.
🔎 Code quality review by PR Code Quality Reviewer · 56.2 AIC · ⌖ 4.61 AIC · ⊞ 5.6K
Comment /review to run again
🤖 PR Triage
Score breakdown: Impact 18 + Urgency 10 + Quality 15 Rationale: Consolidates near-duplicate structs in
|
|
🎉 This pull request is included in a new release. Release: |
pkg/cli/logs_report_firewall.gohad two near-duplicate summary structs that carried the same request/domain aggregate fields with inconsistent counter names. This refactor consolidates the shared shape into one embedded base and aligns access-log summary counters with the firewall summary.Shared summary base
FirewallSummaryBasefor:TotalRequestsAllowedRequestsBlockedRequestsAllowedDomainsBlockedDomainsAccessLogSummaryandFirewallLogSummaryCounter name alignment
AllowedCount/BlockedCounttoAllowedRequests/BlockedRequestsRequestsByDomain) only onFirewallLogSummaryConstruction updates
Focused coverage
allowed_requests/blocked_requests