Request less information from App Store Connect to detect latest build number #382
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.
As it is now, running
app-store-connect
actionsget-latest-testflight-build-number
,get-latest-app-store-build-number
andget-latest-build-number
will fetch a lot of data for pre-release and App Store versions from from App Store Connect (full object representations and all their references to related objects). With more than just handful of App Store / pre-release versions listing API calls can become very slow, and as we're paginating over those resources, the problem only gets worse. In some extreme cases we've seenapp-store-connect get-latest-build-number
to run for more than 20 minutes, which is far from ideal.To speed things up, ask only the bare minimum of information from App Store Connect API when paginating over the resources:
id
andversion
attribute for pre-release versions,id
andversionString
attribute for pre-release versions,id
andversion
attribute for build.By asking only specific attributes, the API does not return any other attributes nor any relationships the object has. By doing so the requests are processed faster and we get the response back with smaller waiting duration. This was achieved by specifying
fields[<resourceName>]
query parameter for the relevantGET
requests.For that new App Store Connect API Client methods were added:
codemagic.apple.app_store_connect.apps.Apps.list_app_store_versions_data
to fetch application's App Store versions aslist[dict]
.codemagic.apple.app_store_connect.versioning.AppStoreVersions.read_build_data
to fetch build of App Store version as plaindict
.codemagic.apple.app_store_connect.versioning.PreReleaseVersions.list_data
to fetch pre-release versions aslist[dict]
.codemagic.apple.app_store_connect.versioning.PreReleaseVersions.list_builds_data
to fetch builds of pre-release version aslist[dict]
.Action definitions, along with helper methods, were moved away from
AppStoreConnect
tool main class definition and were (re)implemented in dedicated abstract action classes which are plugged-in to main class as mix-ins.Updated actions:
app-store-connect get-latest-testflight-build-number
app-store-connect get-latest-app-store-build-number
app-store-connect get-latest-build-number