Skip to content

Implement App size metrics actions#364

Merged
AliSoftware merged 14 commits intotrunkfrom
app-size-metrics
May 31, 2022
Merged

Implement App size metrics actions#364
AliSoftware merged 14 commits intotrunkfrom
app-size-metrics

Conversation

@AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented May 10, 2022

This work is part of the App Metrics project [ref: paaHJt-37V-p2] and implements the fastlane actions necessary to send iOS and Android app size metrics [ref: paaHJt-3od-p2#comment-6098] to the App Metrics server.

What

Implements the actions to send iOS and Android App Size metrics to our future metrics API/system

How

  • Implements an AppSizeMetricsHelper class — and its unit tests — to help us build a the payload for the metrics we want to send
  • Implements the new ios_send_app_size_metrics action which can take an .ipa, and optionally an app-thinning.plist (auto-detected if present next to the .ipa), and generates/sends the app size metrics for it for all device variants
  • Implements the new android_send_app_size_metrics action which can take an .aab and generates/sends the app size metrics for it and all the .apk splits built from it using bundletool

Each of those two new actions can take an api_url which points to:

  • Either an http:// or https:// endpoint (typically once the Metrics server is up and running, it will be the URL to its /api/grouped-metrics endpoint described here
  • Or a file:// URL (in which case the api_token is not required) in order to write the payload to disk — which can be useful to either debug the payload, or store it as a CI artefact, etc.

To Test

  • Ensure that CI runs the unit tests and that they all pass
  • iOS
    • Add a test lane on one of the client app's Fastfile which would build the .ipa using thinning: '<thin-for-all-variants>' and method: 'enterprise' as part of gym's export_options
    • …Then calls this action, passing it a file:// URL to write the payload to disk (since we don't yet have a Metrics system hosted on a stable URL)
    • 👉 This has been done and tested via this PR in WPiOS for example
  • Android
    • Add a test lane on one of the client app's Fastfile which would build the .aab bundle…
    • …Then calls this action, passing it a file:// URL to write the payload to disk (since we don't yet have a Metrics system hosted on a stable URL)
    • 👉 This has been done and tested via this PR in WPAndroid for example

What's Next

Since it was created, that PR was since followed by #365 which built on top of it to add support for Universal APKs.

If you already started to review this PR — especially the parts about the Android action — I suggest to review and land this PR first and review the changes to the Android action afterwards. If you haven't started the review of this PR yet, especially haven't started to look at the Android action and its specs, feel free to merge 365 in this PR first (to merge the code changes applied to the Android action) to review the Android action and specs code all in one go.

Loading
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.

3 participants