Skip to content

Conversation

cfc4n
Copy link
Member

@cfc4n cfc4n commented May 18, 2025

This pull request includes updates to dependencies, bug fixes, and minor code improvements. The most important changes include upgrading several Go module dependencies, fixing redundant parentheses in string formatting, and adding a log message for truncated events.

Dependency Updates:

  • Updated multiple Go module dependencies in go.mod, including github.com/jschwinger233/elibpcap (v1.0.0 → v1.0.2), github.com/rs/zerolog (v1.33.0 → v1.34.0), and several golang.org/x modules. These updates improve compatibility and security. [1] [2]

Bug Fixes:

  • Removed redundant parentheses in unix.ByteSliceToString calls across multiple files (event_mysqld.go, event_postgres.go, probe_bash.go) to simplify code and prevent potential issues. [1] [2] [3]

Code Improvements:

  • Added a log message in pkg/event_processor/iworker.go to notify when events are truncated, improving debugging and observability.

@cfc4n cfc4n requested a review from Copilot May 18, 2025 07:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves logging and code clarity by updating dependencies, removing redundant parentheses from string formatting, and adding a log message for truncated events.

  • Upgraded several Go module dependencies to enhance compatibility and security.
  • Simplified string formatting in event logging by removing unnecessary parentheses.
  • Added a log message in the event processor to indicate when events are truncated.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
user/module/probe_bash.go Removed redundant parentheses in unix.ByteSliceToString calls.
user/event/event_postgres.go Simplified string formatting by removing extra parentheses.
user/event/event_mysqld.go Streamlined string formatting by eliminating redundant parentheses.
pkg/event_processor/processor_test.go Removed an extra empty line in the test file.
pkg/event_processor/iworker.go Added a log message for truncated events, improving observability.
go.mod Updated dependency versions to improve compatibility and security.

Copy link

Failed to generate code suggestions for PR

@dosubot dosubot bot added dependencies Pull requests that update a dependency file 🐞 bug Something isn't working labels May 18, 2025
@cfc4n cfc4n force-pushed the chore-improve-logging-for-truncated-events branch from fb62984 to 3635ebc Compare May 26, 2025 15:48
cfc4n added 4 commits May 27, 2025 00:04
…rmatter settings

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…iple files

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…tency

assets目录下的文件需要执行make后才能生成。

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…ting

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
@cfc4n cfc4n requested a review from Copilot May 28, 2025 15:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves logging for truncated events and updates string formatting while also upgrading several Go dependencies for compatibility and security.

  • Bug fix: Removed redundant parentheses in string formatting error messages and standardized error messages to use lowercase.
  • Dependency update: Upgraded several Go modules and updated Go version references in configuration files and build scripts.
  • Code improvement: Enhanced logging by adding a log message for truncated events and replaced deprecated patterns with improved error wrapping.

Reviewed Changes

Copilot reviewed 72 out of 72 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/event_processor/http2_response.go Updated error message wording and improved resource cleanup.
pkg/event_processor/http2_request_test.go Standardized test error messages and improved EOF checks.
pkg/event_processor/http2_request.go Similar error message and EOF check updates.
pkg/event_processor/base_event.go Replaced fmt.Sprintf with fmt.Fprintf for better error handling.
go.mod Updated Go version and dependency versions.
functions.mk Adjusted Go version check requirements.
cli/http/server.go Reordered imports and removed redundant return statements.
cli/http/logger.go Adjusted import order.
cli/cobrautl/help.go Replaced strings.Replace with strings.ReplaceAll for clearer template parsing.
cli/cmd/upgrade.go Improved error wrapping using %w.
cli/cmd/tls.go, cli/cmd/gotls.go Adjusted import order consistency.
cli/cmd/root.go Updated error message formatting and modified module Close() handling.
cli/cmd/env_detection.go Applied improved error wrapping.
builder/init_env.sh Updated GOBIN_ZIP variable to reflect new Go version.
builder/Dockerfile Changed Go download URL to new version.
.golangci.yml Added updated linter configurations.
.github/workflows/* Updated Go versions and linter settings in CI workflows.

cfc4n added 3 commits May 28, 2025 23:59
@cfc4n cfc4n merged commit 78ce2b7 into master May 29, 2025
6 of 7 checks passed
@cfc4n cfc4n deleted the chore-improve-logging-for-truncated-events branch May 29, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant