Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooling] Draft: Upload app metrics #18541

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: [email protected]:wordpress-mobile/release-toolkit
revision: 329effd14e4176817d28ff5b97f35ea84a19c69e
branch: trunk
revision: f804caf7ba067a57c3e1304a65d424b8403abbd7
branch: app-size-metrics
specs:
fastlane-plugin-wpmreleasetoolkit (4.1.0)
activesupport (~> 5)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: '[email protected]:wordpress-mobile/release-toolkit', branch: 'trunk'
gem 'fastlane-plugin-wpmreleasetoolkit', git: '[email protected]:wordpress-mobile/release-toolkit', branch: 'app-size-metrics'
# gem 'fastlane-plugin-wpmreleasetoolkit', '~> 4.1'

gem 'fastlane-plugin-sentry'
Expand Down
37 changes: 34 additions & 3 deletions fastlane/lanes/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
SENTRY_PROJECT_SLUG_JETPACK = 'jetpack-ios'
APPCENTER_OWNER_NAME = 'automattic'
APPCENTER_OWNER_TYPE = 'organization'
APP_THINNING_EXPORT_OPTIONS = { thinning: '<thin-for-all-variants>' }

# Lanes related to Building and Testing the code
#
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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

Expand Down Expand Up @@ -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(
Expand All @@ -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

Expand Down