Add residential proxy data to Anonymizer record#740
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe ChangesAnonymizer residential feed
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant InsightsJSON
participant Anonymizer
participant AnonymizerFeed
participant InsightsResponseTest
InsightsJSON->>Anonymizer: Deserialize residential object
Anonymizer->>AnonymizerFeed: Construct feed metadata
Anonymizer-->>InsightsResponseTest: Return residential feed
InsightsResponseTest->>AnonymizerFeed: Assert feed fields
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a new residential field to the Anonymizer record, which is represented by a new AnonymizerFeed record containing confidence, networkLastSeen, and providerName fields. It also updates the constructors, test cases, and test data to support and verify this new field. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/com/maxmind/geoip2/record/Anonymizer.java`:
- Around line 66-84: Add a deprecated public 9-parameter bridge constructor to
the Anonymizer record, matching the previous constructor signature and parameter
order, and delegate to the canonical constructor with residential set to null.
Include the appropriate deprecation annotation and Javadoc directing callers to
the current constructor.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 63b773a6-4f3d-4cd9-8805-fea131a9f103
📒 Files selected for processing (7)
CHANGELOG.mdsrc/main/java/com/maxmind/geoip2/record/Anonymizer.javasrc/main/java/com/maxmind/geoip2/record/AnonymizerFeed.javasrc/test/java/com/maxmind/geoip2/model/InsightsResponseTest.javasrc/test/java/com/maxmind/geoip2/model/JsonTest.javasrc/test/resources/test-data/insights0.jsonsrc/test/resources/test-data/insights1.json
71f810b to
3fa9d90
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/main/java/com/maxmind/geoip2/record/Anonymizer.java (1)
66-84: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd a deprecated constructor matching the old 9-parameter signature for backward compatibility.
This was previously flagged and remains unresolved. Since 5.2.0 is a minor version release, the coding guidelines require a deprecated bridge constructor matching the old 9-parameter signature (without
residential) to maintain backward compatibility for callers that constructAnonymizerdirectly.As per coding guidelines: "For minor version releases, add a deprecated constructor matching the old signature when adding new fields to existing record classes to maintain backward compatibility."
Note: the version in the deprecation annotation should be
5.2.0, not5.1.1as suggested in the prior review.🔧 Proposed fix: add deprecated 9-parameter constructor
+ /** + * `@deprecated` Use the canonical constructor that includes the + * {`@code` residential} parameter instead. + */ + `@Deprecated`(since = "5.2.0", forRemoval = true) + public Anonymizer( + Integer confidence, + boolean isAnonymous, + boolean isAnonymousVpn, + boolean isHostingProvider, + boolean isPublicProxy, + boolean isResidentialProxy, + boolean isTorExitNode, + LocalDate networkLastSeen, + String providerName + ) { + this(confidence, isAnonymous, isAnonymousVpn, isHostingProvider, + isPublicProxy, isResidentialProxy, isTorExitNode, + networkLastSeen, providerName, null); + } + /** * Constructs an {`@code` Anonymizer} record with {`@code` null} values for all the nullable * fields and {`@code` false} for all boolean fields. */ public Anonymizer() { this(null, false, false, false, false, false, false, null, null, null); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/com/maxmind/geoip2/record/Anonymizer.java` around lines 66 - 84, Add a deprecated 9-parameter constructor to the Anonymizer record matching the previous signature without residential, annotated as deprecated since 5.2.0, and delegate to the canonical constructor with residential set to null or the appropriate default. Preserve the existing no-argument constructor and null/default handling.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@src/main/java/com/maxmind/geoip2/record/Anonymizer.java`:
- Around line 66-84: Add a deprecated 9-parameter constructor to the Anonymizer
record matching the previous signature without residential, annotated as
deprecated since 5.2.0, and delegate to the canonical constructor with
residential set to null or the appropriate default. Preserve the existing
no-argument constructor and null/default handling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d40702cc-d72a-4150-8d98-1205a21e5b72
📒 Files selected for processing (7)
CHANGELOG.mdsrc/main/java/com/maxmind/geoip2/record/Anonymizer.javasrc/main/java/com/maxmind/geoip2/record/AnonymizerFeed.javasrc/test/java/com/maxmind/geoip2/model/InsightsResponseTest.javasrc/test/java/com/maxmind/geoip2/model/JsonTest.javasrc/test/resources/test-data/insights0.jsonsrc/test/resources/test-data/insights1.json
Adds a residential field to the Anonymizer record, sourced from the GeoIP Residential Proxy feed. This data is exposed as a new reusable AnonymizerFeed record (confidence, networkLastSeen, providerName) so that future anonymizer feeds (e.g. VPN, mobile, datacenter) can share the same shape. Because the residential proxy feed is a superset of Anonymous Plus data, the anonymizer object may now contain only the residential field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3fa9d90 to
c8d5f9c
Compare
Summary
The GeoIP Insights web service is adding a
residentialsub-object to theanonymizerobject, sourced from the full-feed GeoIP Residential Proxy database. Because that feed is a superset of the residential proxies in GeoIP Anonymous Plus, theanonymizerobject may now contain only theresidentialkey.confidence,network_last_seen,provider_name) namedAnonymizerFeed, so future sibling feeds (VPN, mobile, datacenter) can share itresidentialproperty on theAnonymizerrecordNote: adding a component to the
Anonymizerrecord changes its canonical constructor signature, so the api-compat check flagsCONSTRUCTOR_REMOVED. The same category of additive record change has precedent in this repo (e.g. the ipRiskSnapshot addition to Traits).Testing
mvn -B test(104 tests),mvn -B checkstyle:check, andmvn -B javadoc:javadocall pass.🤖 Generated with Claude Code
Summary by CodeRabbit