Skip to content

Add residential proxy data to Anonymizer record#740

Open
oschwald wants to merge 1 commit into
mainfrom
greg/stf-997-add-residential-to-anonymizer
Open

Add residential proxy data to Anonymizer record#740
oschwald wants to merge 1 commit into
mainfrom
greg/stf-997-add-residential-to-anonymizer

Conversation

@oschwald

@oschwald oschwald commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

The GeoIP Insights web service is adding a residential sub-object to the anonymizer object, sourced from the full-feed GeoIP Residential Proxy database. Because that feed is a superset of the residential proxies in GeoIP Anonymous Plus, the anonymizer object may now contain only the residential key.

  • New reusable record for the feed shape (confidence, network_last_seen, provider_name) named AnonymizerFeed, so future sibling feeds (VPN, mobile, datacenter) can share it
  • New residential property on the Anonymizer record
  • Tests, fixtures, and changelog updated

Note: adding a component to the Anonymizer record changes its canonical constructor signature, so the api-compat check flags CONSTRUCTOR_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, and mvn -B javadoc:javadoc all pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added residential anonymizer feed support to anonymizer results.
    • Residential details include confidence, last-seen date, and provider name.
    • Residential data may be present independently of other anonymizer classifications.
  • Documentation
    • Updated the changelog and Javadoc to describe the new residential anonymizer data.
  • Tests
    • Expanded anonymizer and JSON serialization tests to cover the residential feed.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5bfec6b0-6fd3-464c-a885-2dc8f927c530

📥 Commits

Reviewing files that changed from the base of the PR and between 3fa9d90 and c8d5f9c.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • src/main/java/com/maxmind/geoip2/record/Anonymizer.java
  • src/main/java/com/maxmind/geoip2/record/AnonymizerFeed.java
  • src/test/java/com/maxmind/geoip2/model/InsightsResponseTest.java
  • src/test/java/com/maxmind/geoip2/model/JsonTest.java
  • src/test/resources/test-data/insights0.json
  • src/test/resources/test-data/insights1.json

📝 Walkthrough

Walkthrough

The Anonymizer record now includes a residential proxy feed represented by AnonymizerFeed, with JSON mappings, null initialization, updated fixtures, serialization coverage, and changelog documentation.

Changes

Anonymizer residential feed

Layer / File(s) Summary
Feed contract
src/main/java/com/maxmind/geoip2/record/AnonymizerFeed.java
Adds the AnonymizerFeed record with confidence, last-seen date, and provider fields mapped to JSON.
Anonymizer integration and validation
src/main/java/com/maxmind/geoip2/record/Anonymizer.java, src/test/java/com/maxmind/geoip2/model/*, src/test/resources/test-data/*, CHANGELOG.md
Adds the residential feed to Anonymizer, defaults missing values, updates constructor delegation and documentation, and extends parsing and serialization fixtures and assertions.

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
Loading

Poem

A rabbit hops through JSON bright,
Finds residential data in sight.
Confidence, dates, provider too,
All tucked in a feed so new.
“Anonymized!” the bunny sings,
While tests check every field it brings.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding residential proxy data to the Anonymizer record.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch greg/stf-997-add-residential-to-anonymizer

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 33b6ceb and 71f810b.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • src/main/java/com/maxmind/geoip2/record/Anonymizer.java
  • src/main/java/com/maxmind/geoip2/record/AnonymizerFeed.java
  • src/test/java/com/maxmind/geoip2/model/InsightsResponseTest.java
  • src/test/java/com/maxmind/geoip2/model/JsonTest.java
  • src/test/resources/test-data/insights0.json
  • src/test/resources/test-data/insights1.json

Comment thread src/main/java/com/maxmind/geoip2/record/Anonymizer.java

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/main/java/com/maxmind/geoip2/record/Anonymizer.java (1)

66-84: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add 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 construct Anonymizer directly.

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, not 5.1.1 as 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

📥 Commits

Reviewing files that changed from the base of the PR and between 71f810b and 3fa9d90.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • src/main/java/com/maxmind/geoip2/record/Anonymizer.java
  • src/main/java/com/maxmind/geoip2/record/AnonymizerFeed.java
  • src/test/java/com/maxmind/geoip2/model/InsightsResponseTest.java
  • src/test/java/com/maxmind/geoip2/model/JsonTest.java
  • src/test/resources/test-data/insights0.json
  • src/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>
@oschwald oschwald force-pushed the greg/stf-997-add-residential-to-anonymizer branch from 3fa9d90 to c8d5f9c Compare July 11, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant