Skip to content

Conversation

@blotus
Copy link
Member

@blotus blotus commented Dec 6, 2025

Update maxminddb-golang to v2.

The v2 of geoip2-golang has changed the name of some fields (IsoCode -> ISOCode), which would break any expression trying to access the IsoCode field of the value returned by GeoIPEnrich().
As such, drop usage of geoip2-golang, as it was just a thin wrapper on top of the reader, and use a custom struct to have better control of the struct fields.
This also allows us to create one less reader, we had 3 before:

  • 1 lower level for the GeoIPRangeEnrich helper
  • 1 wrapper for GeoIPEnrich
  • 1 wrapper for GeoIPASNEnrich

With this change, we now only have 2 lower-level readers, one per database loaded.

Note: hub test failures need to be fixed in the hub before we merge.

@blotus blotus added this to the 1.7.5 milestone Dec 6, 2025
@github-actions
Copy link

github-actions bot commented Dec 6, 2025

@blotus: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

@blotus: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@blotus
Copy link
Member Author

blotus commented Dec 6, 2025

/kind chore

@codecov
Copy link

codecov bot commented Dec 6, 2025

Codecov Report

❌ Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.84%. Comparing base (469b374) to head (ed5d10e).

Files with missing lines Patch % Lines
pkg/exprhelpers/geoip.go 78.94% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4112      +/-   ##
==========================================
- Coverage   62.96%   62.84%   -0.12%     
==========================================
  Files         464      464              
  Lines       33286    33288       +2     
==========================================
- Hits        20957    20920      -37     
- Misses      10212    10243      +31     
- Partials     2117     2125       +8     
Flag Coverage Δ
bats 46.21% <70.37%> (+0.02%) ⬆️
unit-linux 35.67% <70.37%> (-0.07%) ⬇️
unit-windows 25.01% <7.40%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants