Skip to content

feat: add Google Places API (New) getPlaceDetails with legacy fallback#1440

Merged
prakharritik merged 1 commit into
mainfrom
place-details-api-changes
Jul 23, 2026
Merged

feat: add Google Places API (New) getPlaceDetails with legacy fallback#1440
prakharritik merged 1 commit into
mainfrom
place-details-api-changes

Conversation

@prakharritik

@prakharritik prakharritik commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates

Description

Additional Changes

  • This PR modifies the database schema (database migration added)
  • This PR modifies dhall configs/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code and addressed linter errors ./dev/format-all-files.sh
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Summary by CodeRabbit

  • New Features
    • Added support for Google Places Details (New), including formatted addresses, coordinates, and address components.
    • Added configuration-based selection of the new Places API.
  • Bug Fixes
    • Automatically falls back to the legacy Places Details service if the new API call fails.
    • Reports an error when the new API response does not include location data.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 33 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: CHILL

Plan: Pro Plus

Run ID: 009e8c22-d7c1-4dda-bc5f-ce5a4a72ffb9

📥 Commits

Reviewing files that changed from the base of the PR and between 2feb382 and 1f67eda.

📒 Files selected for processing (4)
  • lib/mobility-core/src/Kernel/External/Maps/Google/Config.hs
  • lib/mobility-core/src/Kernel/External/Maps/Google/MapsClient.hs
  • lib/mobility-core/src/Kernel/External/Maps/Google/MapsClient/Types.hs
  • lib/mobility-core/src/Kernel/External/Maps/Interface/Google.hs

Walkthrough

Adds Google Places Details (New) response types and client support. Place-detail lookups can use the new API when configured, convert its response to the existing domain shape, and fall back to the legacy API on failure.

Changes

Google Places Details integration

Layer / File(s) Summary
Place Details v2 contract and client wiring
lib/mobility-core/src/Kernel/External/Maps/Google/MapsClient/Types.hs, lib/mobility-core/src/Kernel/External/Maps/Google/MapsClient.hs
Adds v2 response models, defines the Servant endpoint, and wires its client implementation.
External API invocation
lib/mobility-core/src/Kernel/External/Maps/Google/MapsClient.hs
Adds getPlaceDetailsV2, including request logging and client-error conversion.
Routing and response conversion
lib/mobility-core/src/Kernel/External/Maps/Interface/Google.hs
Uses the new API when enabled, falls back to the legacy lookup on failure, and converts the v2 response into the existing domain response.
Estimated code review effort: 3 (Moderate) ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant GoogleInterface
  participant GoogleMapsClient
  participant GooglePlacesAPI
  Caller->>GoogleInterface: getPlaceDetails
  GoogleInterface->>GoogleMapsClient: getPlaceDetailsV2
  GoogleMapsClient->>GooglePlacesAPI: Place Details (New) request
  GooglePlacesAPI-->>GoogleMapsClient: v2 place details response
  GoogleMapsClient-->>GoogleInterface: mapped response or error
  GoogleInterface-->>Caller: converted domain response or legacy fallback
Loading

Suggested reviewers: rohit4997

Poem

A rabbit hops through maps anew,
With fields and places fresh in view.
If newer paths should stumble there,
The trusty old route waits with care.
Coordinates land, all neat and bright.

🚥 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 matches the main change: adding Google Places API (New) getPlaceDetails with a legacy fallback.
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 place-details-api-changes

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.

@coderabbitai
coderabbitai Bot requested a review from Rohit4997 July 23, 2026 08:08
@prakharritik
prakharritik force-pushed the place-details-api-changes branch from cdedc95 to 2feb382 Compare July 23, 2026 08:26
@prakharritik
prakharritik force-pushed the place-details-api-changes branch from 6779509 to 1f67eda Compare July 23, 2026 08:34
@prakharritik
prakharritik merged commit 2a806ec into main Jul 23, 2026
2 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants