feat(mapbox): upgrade Mapbox provider to Geocoding API v6 (2.0.0) - #1274
Open
davidbarratt wants to merge 15 commits into
Open
feat(mapbox): upgrade Mapbox provider to Geocoding API v6 (2.0.0) #1274davidbarratt wants to merge 15 commits into
davidbarratt wants to merge 15 commits into
Conversation
Author
|
@jbelien I've run the |
Member
|
I'll try to have a look next week. |
jbelien
requested changes
Sep 13, 2026
jbelien
left a comment
Member
There was a problem hiding this comment.
Thanks for your contribution.
I've made a first review and here are a few change requests:
- Please do NOT remove or update any existing tests. Those tests must stay and still pass.
- Simplify changes made in CHANGELOG.md. Look at the previous tags, no need to go such in small details.
- Do not rename existing
GEOCODE_ENDPOINT_URL_SSLandREVERSE_ENDPOINT_URL_SSLconstants, there is no reason to, just change the URL to match the new v6 URLs (long story short: no need to rewrite the whole provider, focus on the changes related to v6 migration).
Thanks.
- Restore the pre-existing tests; only change them where v6 requires it
(each change is annotated with the reason):
* v6 has no poi/poi.landmark types: dropped from testGeocodePlaceWithLocale
* v6 dataset differences: Princes Risborough for 'princ', 12 (not 8)
Avenue Gambetta for the reverse test, v6 mapbox_id values
* v6 treats '&' as the intersection search connector, so the
'116th St & Broadway' query no longer matches any address; the test
now uses '1600 Pennsylvania Avenue NW, Washington, DC 20500'
* v6 removed the fuzzyMatch parameter: the two fuzzy tests are now
autocomplete tests
- Keep the GEOCODE_ENDPOINT_URL_SSL and REVERSE_ENDPOINT_URL_SSL constant
names; only the URL values move to the v6 endpoints. The provider keeps
its previous structure, including the constructor signature (the
mapbox.places-permanent mode maps to the v6 permanent parameter)
- Simplify the CHANGELOG entry to match the style of the previous tags
- Keep the v6 fixtures for both MapboxTest and the shared IntegrationTest
Author
|
The changes should be minimal now. There are some backwards-incompatible changes with v6, so changing some of the existing tests was required, but it has been notated where that is the case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Geocoder\Provider\Mapbox\Mapboxin place to the Mapbox Geocoding API v6 (/search/geocode/v6/forwardand/search/geocode/v6/reverse), as a major version (2.0.0) ofgeocoder-php/mapbox-providerautocomplete/proximity/worldviewquery data, a new 4th constructor argumentbool $permanent,TYPE_STREET/TYPE_BLOCK/TYPE_SECONDARY_ADDRESSconstants, andMapboxAddress::getMatchCode()/getMatchConfidence()/getAccuracy()GEOCODING_MODE_*,TYPE_POI*andfuzzy_match; every breaking change is listed in the provider CHANGELOG 2.0.0 (v5 users: pin togeocoder-php/mapbox-provider:^1.5)Closes #1237
Test Plan
composer test— full suite green (1049 tests); Mapbox: 45 tests incl. 7 v6 integration fixtures + 4 provider-integration fixtures replayed from.cached_responseswith the placeholder key (CI-safe)composer analyse— PHPStan level 6 cleancomposer cs— clean on all touched filestest(mapbox): add failing tests for the v6 API) is followed by the implementation commits that turn the suite green