Refactor, add packet drops, API docs, CI#1
Merged
Merged
Conversation
3a7b4b4 to
69c4fa9
Compare
912e3cc to
d335a50
Compare
2811579 to
b71a576
Compare
b669c94 to
86ce033
Compare
075d499 to
22118c7
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces comprehensive CI/CD improvements, packet drop monitoring capabilities, and API documentation enhancements. The PR refactors the codebase to use a new system abstraction, adds packet drop eBPF program monitoring, implements Swagger API documentation with UI, and establishes GitHub Actions workflows for automated testing and code quality checks.
Key Changes:
- Added GitHub Actions CI/CD pipeline with testing, linting, and build automation
- Implemented new packet drop monitoring eBPF program with dedicated event parsing
- Integrated Swagger API documentation generation and serving with interactive UI
- Refactored server architecture to use a system abstraction for improved modularity and testability
Reviewed Changes
Copilot reviewed 33 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/system/system.go | New system orchestrator providing unified interface for eBPF program management |
| internal/storage/memory.go | In-memory event storage implementation with concurrent access and query capabilities |
| internal/storage/memory_test.go | Comprehensive test suite for memory storage functionality |
| internal/programs/packet_drop/ | New packet drop monitoring program with binary event parsing and tracepoint attachment |
| internal/programs/connection/ | Connection monitoring program with IPv4/IPv6 support and protocol detection |
| internal/programs/manager.go | Program manager for orchestrating multiple eBPF programs with unified event streaming |
| internal/programs/base.go | Base eBPF program implementation with ring buffer reading and backpressure monitoring |
| internal/events/events.go | Event abstractions with boot time calculation and timestamp conversion |
| internal/core/types.go | Core interface definitions for the eBPF monitoring system |
| internal/api/handlers_test.go | Updated API handler tests with system abstraction support |
Comments suppressed due to low confidence (2)
internal/storage/memory.go:184
- [nitpick] The error message at line 187-188 contains detailed information that could be useful for debugging but may also expose sensitive system information. Consider whether including PID and event type in the error message is appropriate for production environments.
if err := s.storage.Store(s.ctx, event); err != nil {
internal/programs/base.go:251
- [nitpick] The error message includes sensitive information (PID and event type) that could be useful for attackers. Consider logging this information at debug level instead of error level, or sanitizing the sensitive details in production environments.
logger.Errorf("Event stream full for %s, DROPPED EVENT (PID: %d, Type: %s). "+
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
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.
This pull request introduces significant enhancements to the project’s CI/CD pipeline, API documentation, and packet drop monitoring capabilities. It adds a comprehensive GitHub Actions workflow for testing, linting, and building, integrates Swagger-based API documentation generation and serving, and implements a new eBPF program for tracking packet drops. The server and tests are refactored to support these new features, and several dependencies are updated to enable API documentation and Swagger UI.
CI/CD Pipeline Improvements:
.github/workflows/ci.ymlfile to automate testing (across multiple Go versions), linting, building, and code coverage reporting using GitHub Actions. This ensures code quality and reliability for every push and pull request.API Documentation and Developer Experience:
Makefilewith a newdocstarget to auto-generate Swagger API documentation usingswag, and provides instructions for accessing interactive and external docs.cmd/server/main.go) and serves documentation endpoints (/docs/,/docs/swagger.json, etc.), making API exploration and testing easier for developers. [1] [2] [3]Packet Drop Monitoring:
bpf/packet_drop.c) to trace packet drop events using both tracepoints and kprobes, and exports these events via a ring buffer for user-space consumption./api/packet-drop-summary,/api/list-packet-drops) to expose packet drop data, and updates the root endpoint to document these additions. [1] [2]Server and Test Refactoring:
systempackage abstraction, improving modularity and testability. Updates signal handling and shutdown logic for graceful cleanup. [1] [2] [3]Dependency Updates:
go.modto support Swagger documentation generation and serving (e.g.,swaggo/swag,swaggo/http-swagger).These changes collectively improve the project’s observability, developer experience, and maintainability.