Skip to content

Conversation

@ncode
Copy link
Owner

@ncode ncode commented Mar 20, 2025

This pull request includes updates to dependencies, enhancements to the outbound_test.go file, and several improvements to the IPTablesManager in iptables_manager.go. The most important changes include updating Go and dependencies, adding context to test functions, and refactoring error handling and rule management in the IPTablesManager.

Dependency Updates:

  • Updated Go version from 1.23 to 1.24 and toolchain from go1.23.5 to go1.24.1 in go.mod.
  • Added golang.org/x/text v0.23.0 and updated golang.org/x/sys from v0.29.0 to v0.31.0 in go.mod.

Test Enhancements:

  • Added context to several test functions in outbound_test.go to improve test isolation and clarity. [1] [2] [3] [4] [5] [6] [7] [8]

IPTablesManager Improvements:

  • Replaced %v with %w in error formatting to wrap errors properly in iptables_manager.go. [1] [2] [3] [4] [5] [6] [7]
  • Refactored buildDefaultActionSpecs and buildRuleSpecs methods to improve readability and maintainability. [1] [2]
  • Added new helper methods shouldLogAction, getLogPrefix, getActualAction, and findRuleWithJumpToChain to encapsulate logic and reduce duplication. [1] [2]
  • Introduced verifyDefaultRules method to check the presence of default action rules and added corresponding tests. [1] [2]

@codecov
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 99.14530% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.94%. Comparing base (0c33daa) to head (566975a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
outbound.go 98.67% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
+ Coverage   95.57%   96.94%   +1.36%     
==========================================
  Files           2        2              
  Lines         656      491     -165     
==========================================
- Hits          627      476     -151     
+ Misses         25       12      -13     
+ Partials        4        3       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ncode ncode force-pushed the juliano/refactoring branch from 2604f11 to 566975a Compare March 20, 2025 20:34
@ncode ncode marked this pull request as ready for review April 15, 2025 13:01
@ncode ncode merged commit 0236d3e into main Apr 15, 2025
7 checks passed
@ncode ncode deleted the juliano/refactoring branch April 15, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant