-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: address code review feedback on logs stats/summary commands #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 tasks
- Move duplicate StatsFormat/SummaryFormat types to shared LogStatsFormat in types.ts - Simplify colorize fallback using Proxy pattern instead of object literal - Add null checks for source.path and source.containerName before usage - Extract duplicated format validation into validateFormat helper function - Refactor duplicated command handler logic into shared logs-command-helpers module - Document intentional logging suppression difference between stats and summary commands - Fix uniqueDomains count discrepancy by showing valid domain count when "-" present - Add guard for empty sortedDomains to prevent -Infinity in maxDomainLen calculation Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add commands for firewall log statistics and summaries
refactor: address code review feedback on logs stats/summary commands
Dec 19, 2025
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...] |
Smoke Test: Copilot Engine - PASSGitHub MCP: ✅
File Writing: ✅
|
Smoke Test Results - Claude EngineLast 2 Merged PRs:
Test Results:
Status: PASS
|
Mossaka
added a commit
that referenced
this pull request
Dec 19, 2025
* feat: add `awf logs stats` and `awf logs summary` commands Add built-in log aggregation and summary generation to reduce complexity of parsing firewall logs in GitHub Actions workflows. New commands: - `awf logs stats` - Show aggregated statistics (default: pretty format) - `awf logs summary` - Generate summary report (default: markdown format) Both commands support --format json|markdown|pretty for flexible output. Example GitHub Actions usage: awf logs summary >> $GITHUB_STEP_SUMMARY This replaces 150+ lines of custom JavaScript log parsing with a single command. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: address code review feedback on logs stats/summary commands (#126) * Initial plan * refactor: address code review comments from PR #118 - Move duplicate StatsFormat/SummaryFormat types to shared LogStatsFormat in types.ts - Simplify colorize fallback using Proxy pattern instead of object literal - Add null checks for source.path and source.containerName before usage - Extract duplicated format validation into validateFormat helper function - Refactor duplicated command handler logic into shared logs-command-helpers module - Document intentional logging suppression difference between stats and summary commands - Fix uniqueDomains count discrepancy by showing valid domain count when "-" present - Add guard for empty sortedDomains to prevent -Infinity in maxDomainLen calculation Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses 9 code review comments from PR #118 focusing on code duplication, type safety, and edge case handling in the new
awf logs statsandawf logs summarycommands.Changes
Type consolidation
StatsFormat/SummaryFormattype definitions to sharedLogStatsFormatintypes.tsReduced duplication
validateFormat()helper (eliminates 3 identical validation blocks)logs-command-helpers.tswith:discoverAndSelectSource()- handles log source discovery and selection with conditional loggingloadLogsWithErrorHandling()- wraps aggregation with error handlingType safety improvements
source.pathandsource.containerNamebefore use (replaces non-null assertions)Edge case fixes
-InfinityinformatStatsPretty()when all domains filtered outCode quality
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.