Skip to content

Add residential proxy data to anonymizer object#207

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

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

Conversation

@oschwald

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

Testing

bundle exec rake test (61 runs, 244 assertions) and bundle exec rubocop pass.

🤖 Generated with Claude Code

This adds a new residential sub-object to the anonymizer object in the
GeoIP2 Insights web service response. It is sourced from the full-feed
GeoIP Residential Proxy database and includes confidence scoring,
provider name detection, and network last seen date for residential
proxies.

Because the residential proxy feed is a superset of what is covered by
Anonymous Plus, the anonymizer object may now contain only the
residential key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 59 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: ff57cfc7-554e-4456-86bd-6c85637c0d33

📥 Commits

Reviewing files that changed from the base of the PR and between 537148d and 66aab25.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • lib/maxmind/geoip2/record/anonymizer.rb
  • lib/maxmind/geoip2/record/anonymizer_feed.rb
  • test/test_client.rb
✨ Finishing Touches
🧪 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 object (represented by the AnonymizerFeed class) to the anonymizer record in the GeoIP2 Insights model, allowing users to access residential proxy data such as confidence, provider name, and last seen date. The feedback suggests two improvements: using the safe navigation operator (&.) in Anonymizer#initialize for cleaner, more idiomatic Ruby code, and ensuring that nil values are correctly cached in AnonymizerFeed#network_last_seen to prevent redundant lookups when the date is missing.

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.

Comment on lines +23 to +27
def initialize(record)
super

@residential = AnonymizerFeed.new(record.nil? ? nil : record['residential'])
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since this project requires Ruby 3.2+, we can use the safe navigation operator (&.) to safely access 'residential' on record if it is not nil. This is much more idiomatic and concise than the ternary operator check.

        def initialize(record)
          super

          @residential = AnonymizerFeed.new(record&.[]('residential'))
        end

Comment on lines +30 to +40
def network_last_seen
return @network_last_seen if defined?(@network_last_seen)

date_string = get('network_last_seen')

if !date_string
return nil
end

@network_last_seen = Date.parse(date_string)
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In Ruby, defined?(@ivar) returns true if the instance variable has been initialized, even if its value is nil. However, because @network_last_seen is not assigned when date_string is nil/falsy, subsequent calls to network_last_seen will repeatedly call get('network_last_seen') instead of returning the cached nil value.

We can optimize this and make it more idiomatic by assigning the result of the ternary operator directly to @network_last_seen.

        def network_last_seen
          return @network_last_seen if defined?(@network_last_seen)

          date_string = get('network_last_seen')
          @network_last_seen = date_string ? Date.parse(date_string) : nil
        end

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