[spaceship] Move endpoint version from hostname to path #21900
Merged
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.
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
There is a need for preparing fastlane for implementation of requests that have
v2
orv3
version inpath
component as noted in #21890.There are requests defined in open api spec (https://developer.apple.com/documentation/appstoreconnectapi) that don't have
v1
inpath
, e.g. https://developer.apple.com/documentation/appstoreconnectapi/read_app_availablity_territoriesGET https://api.appstoreconnect.apple.com/v2/appAvailabilities/{id}/territoryAvailabilities
From spec:
Description
Endpoint's
hostname
s forConnectAPI
had hardcoded endpoint versionv1
, also forhttps://api.appstoreconnect.apple.com/v1/
when API token is used.In this PR
v1
version is moved fromhostname
to paths for 4ConnectAPI
clients:tunes_request_client
provisioning_request_client
test_flight_request_client
users_request_client
Also, this change required change in
stats_middleware
andstats_middleware_spec
to properly log use of endpoints.Testing Steps
Runned unit tests. Not all client methods are tested though, so I checked that all
get
,post
,patch
anddelete
requests in code havev1
in path with simple regular expressions: