Skip to content

Add residential sub-object to anonymizer for Insights#413

Open
oschwald wants to merge 2 commits into
mainfrom
greg/stf-1005-add-residential-to-anonymizer
Open

Add residential sub-object to anonymizer for Insights#413
oschwald wants to merge 2 commits into
mainfrom
greg/stf-1005-add-residential-to-anonymizer

Conversation

@oschwald

@oschwald oschwald commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Surfaces the new residential sub-object of the anonymizer object in the minFraud Insights and Factors ip_address response. The models reuse the GeoIP2 library's Anonymizer record, so this is a fixtures/tests/changelog change; the field flows through via the dependency.

Depends on maxmind/GeoIP2-python#440. At release time the geoip2 requirement must be bumped to >=5.3.0 once that version is on PyPI.

Testing

With geoip2 built from that PR: pytest 246 passed; ruff check, ruff format --check, and mypy clean. Against released geoip2 5.2.0 the new assertions fail as expected.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for residential proxy information in IP address anonymizer data, including confidence, network last-seen date, and provider details.
    • Residential proxy information may be available even when other anonymizer details are not.
  • Documentation

    • Updated release notes to describe the new residential data and its availability requirements.
  • Tests

    • Added coverage to verify parsing and web service responses containing residential proxy information.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@oschwald, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 66180063-b82e-453e-8d85-64e23f45f025

📥 Commits

Reviewing files that changed from the base of the PR and between 869a47b and cd3549b.

📒 Files selected for processing (8)
  • CLAUDE.md
  • HISTORY.rst
  • pyproject.toml
  • src/minfraud/models.py
  • tests/data/factors-response.json
  • tests/data/insights-response.json
  • tests/test_models.py
  • tests/test_webservice.py
📝 Walkthrough

Walkthrough

The change adds residential anonymizer data to factors and insights fixtures, verifies its parsed model and webservice fields, and documents the optional field and geoip2 version requirement in the 3.3.0 release notes.

Changes

Residential anonymizer coverage

Layer / File(s) Summary
Residential anonymizer fixtures and validation
tests/data/*-response.json, tests/test_models.py, tests/test_webservice.py, HISTORY.rst
Fixtures include residential confidence, network-last-seen, and provider fields; tests verify parsed values; release notes document the optional field and version requirement.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

I’m a rabbit with data tucked tight,
Residential fields now hop into sight.
Confidence gleams, providers run,
Dates are checked beneath the sun.
The changelog thumps: “All set!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: adding a residential anonymizer sub-object, though it mentions only Insights and omits Factors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch greg/stf-1005-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 adds support for the residential attribute inside the ip_address.anonymizer object, which contains residential proxy data such as confidence, network_last_seen, and provider_name. The changes include updates to the history log, test response JSON fixtures, and unit tests verifying the parsing and correctness of these new fields. There are no review comments, so I have no feedback to provide.

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 `@tests/test_models.py`:
- Around line 200-204: Update tests/test_models.py lines 200-204 to cover both
populated and absent residential fields, including to_dict() serialization;
update tests/test_models.py lines 246-252 to assert serialized residential
values; update tests/test_webservice.py lines 239-246 with an absent-field
response case and serialization coverage, preserving correct None handling.
🪄 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: 0dd91c2a-58f1-4299-9987-8cdbf74e7709

📥 Commits

Reviewing files that changed from the base of the PR and between 4402a9f and 869a47b.

📒 Files selected for processing (5)
  • HISTORY.rst
  • tests/data/factors-response.json
  • tests/data/insights-response.json
  • tests/test_models.py
  • tests/test_webservice.py

Comment thread tests/test_models.py
oschwald and others added 2 commits July 14, 2026 16:04
The web service now nests a `residential` object inside
`ip_address.anonymizer` containing residential proxy data for the
network. It may be populated even when no other anonymizer attributes
are set. The attribute is exposed automatically via the geoip2
dependency's new `Anonymizer.residential` attribute (a
`geoip2.records.AnonymizerFeed`), so no model changes are needed here.
Update the test fixtures and assertions to cover the new field, and
note the change and the geoip2 5.3.0 minimum in HISTORY.rst.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Use object rather than Any for the discarded **_ keyword-argument
parameters. object is the correct type for values that are accepted but
never used, and it satisfies Ruff's ANN401 rule, so the per-file ANN401
ignores can be removed. The two constructors that forward **kwargs on to
the geoip2 parent constructors keep Any (with an inline noqa), since
object is not assignable to the parent's typed parameters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oschwald oschwald force-pushed the greg/stf-1005-add-residential-to-anonymizer branch from 869a47b to cd3549b Compare July 14, 2026 16:08
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