From 73c1f555f0b15107b025c3a4a70766e4362a227c Mon Sep 17 00:00:00 2001 From: Olivier Halligon Date: Mon, 9 May 2022 18:51:59 +0200 Subject: [PATCH 1/3] Point release-toolkit to app-size-metrics branch --- Gemfile.lock | 7 ++++--- fastlane/Pluginfile | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ce42cb7132d3..5119b96ec86f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: git@github.com:wordpress-mobile/release-toolkit - revision: 329effd14e4176817d28ff5b97f35ea84a19c69e - branch: trunk + revision: f804caf7ba067a57c3e1304a65d424b8403abbd7 + branch: app-size-metrics specs: fastlane-plugin-wpmreleasetoolkit (4.1.0) activesupport (~> 5) @@ -14,6 +14,7 @@ GIT nokogiri (~> 1.11) octokit (~> 4.18) parallel (~> 1.14) + plist (~> 3.1) progress_bar (~> 1.3) rake (>= 12.3, < 14.0) rake-compiler (~> 1.0) @@ -23,7 +24,7 @@ GEM specs: CFPropertyList (3.0.5) rexml - activesupport (5.2.7) + activesupport (5.2.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 7db4ba104cbf..d2c32f5dbc65 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -7,7 +7,7 @@ group :screenshots, optional: true do end # This comment avoids typing to switch to a development version for testing. -gem 'fastlane-plugin-wpmreleasetoolkit', git: 'git@github.com:wordpress-mobile/release-toolkit', branch: 'trunk' +gem 'fastlane-plugin-wpmreleasetoolkit', git: 'git@github.com:wordpress-mobile/release-toolkit', branch: 'app-size-metrics' # gem 'fastlane-plugin-wpmreleasetoolkit', '~> 4.1' gem 'fastlane-plugin-sentry' From ad5cd5b84cb41e5e052f29736d7d5d5cf37f27a1 Mon Sep 17 00:00:00 2001 From: Olivier Halligon Date: Mon, 9 May 2022 18:52:26 +0200 Subject: [PATCH 2/3] Call ios_send_app_metrics action --- fastlane/lanes/build.rb | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/fastlane/lanes/build.rb b/fastlane/lanes/build.rb index ea5131e7f4d8..0d086481b2e6 100644 --- a/fastlane/lanes/build.rb +++ b/fastlane/lanes/build.rb @@ -5,6 +5,7 @@ SENTRY_PROJECT_SLUG_JETPACK = 'jetpack-ios' APPCENTER_OWNER_NAME = 'automattic' APPCENTER_OWNER_TYPE = 'organization' +APP_THINNING_EXPORT_OPTIONS = { thinning: '' } # Lanes related to Building and Testing the code # @@ -198,7 +199,7 @@ derived_data_path: DERIVED_DATA_PATH, export_team_id: get_required_env('INT_EXPORT_TEAM_ID'), export_method: 'enterprise', - export_options: { method: 'enterprise' } + export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS } ) appcenter_upload( @@ -217,6 +218,16 @@ project_slug: SENTRY_PROJECT_SLUG_WORDPRESS, dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH] ) + + ios_send_app_size_metrics( + api_url: File.join('file://localhost/', BUILD_PRODUCTS_PATH, 'wordpress-app-size-metrics.json'), + api_token: ENV['APPMETRICS_API_TOKEN'], + use_gzip_content_encoding: false, + app_name: 'WordPress', + app_version: ios_get_build_version, + build_type: 'Release', + source: 'Beta' + ) end # Builds the WordPress app for an Installable Build ("WordPress Alpha" scheme), and uploads it to App Center @@ -247,7 +258,7 @@ derived_data_path: DERIVED_DATA_PATH, export_team_id: ENV['INT_EXPORT_TEAM_ID'], export_method: 'enterprise', - export_options: { method: 'enterprise' } + export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS } ) appcenter_upload( @@ -268,6 +279,16 @@ dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH] ) + ios_send_app_size_metrics( + api_url: File.join('file://localhost/', BUILD_PRODUCTS_PATH, 'wordpress-app-size-metrics.json'), + api_token: ENV['APPMETRICS_API_TOKEN'], + use_gzip_content_encoding: false, + app_name: 'WordPress', + app_version: build_number, + build_type: 'Release-Alpha', + source: 'PR Installable Build' + ) + post_installable_build_pr_comment(app_name: 'WordPress', build_number: build_number, url_slug: 'WPiOS-One-Offs') end @@ -300,7 +321,7 @@ derived_data_path: DERIVED_DATA_PATH, export_team_id: ENV['INT_EXPORT_TEAM_ID'], export_method: 'enterprise', - export_options: { method: 'enterprise' } + export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS } ) appcenter_upload( @@ -321,6 +342,16 @@ dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH] ) + ios_send_app_size_metrics( + api_url: File.join('file://localhost/', BUILD_PRODUCTS_PATH, 'jetpack-app-size-metrics.json'), + api_token: ENV['APPMETRICS_API_TOKEN'], + use_gzip_content_encoding: false, + app_name: 'Jetpack', + app_version: build_number, + build_type: 'Release-Alpha', + source: 'PR Installable Build' + ) + post_installable_build_pr_comment(app_name: 'Jetpack', build_number: build_number, url_slug: 'jetpack-installable-builds') end From 1db7334814e9e407df73bb6e71a3e1ead8f3d637 Mon Sep 17 00:00:00 2001 From: Olivier Halligon Date: Tue, 10 May 2022 22:58:58 +0200 Subject: [PATCH 3/3] Store app size metrics as artifacts --- .buildkite/pipeline.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e606c9d84628..354ff1fa47a5 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -24,6 +24,11 @@ steps: notify: - github_commit_status: context: "WordPress Installable Build" + # TODO: Remove this once we're done debugging app-size-metrics + artifact_paths: + - "Artifacts/app-thinning.plist" + - "Artifacts/wordpress-app-size-metrics.json" + - "Artifacts/jetpack-app-size-metrics.json" - label: "🛠 Jetpack Installable Build" command: ".buildkite/commands/installable-build-jetpack.sh"