-
Notifications
You must be signed in to change notification settings - Fork 303
AINFRA-2488 Add TV parity to Android CI and releases #5682
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ steps: | |
| artifact_paths: | ||
| - "**/build/instrumented-tests/**/*" | ||
|
|
||
| - group: "Assemble release APKs" | ||
| - group: "Assemble Mobile, Automotive, TV, and Wear release APKs" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: enumerating form factors in the group label means editing it for every new one (and it now says "Mobile" while the step below says "app"). Something like |
||
| steps: | ||
| - label: "Assemble app release APK" | ||
| command: ".buildkite/commands/assemble-release-apk.sh app" | ||
|
|
@@ -81,6 +81,12 @@ steps: | |
| artifact_paths: | ||
| - "**/build/outputs/apk/**/*" | ||
|
|
||
| - label: "Assemble TV release APK" | ||
| command: ".buildkite/commands/assemble-release-apk.sh tv" | ||
| plugins: [ $CI_TOOLKIT ] | ||
| artifact_paths: | ||
| - "**/build/outputs/apk/**/*" | ||
|
|
||
| - label: "Assemble wear release APK" | ||
| command: ".buildkite/commands/assemble-release-apk.sh wear" | ||
| plugins: [ $CI_TOOLKIT ] | ||
|
|
@@ -90,7 +96,7 @@ steps: | |
| ########## | ||
| # Optional Prototype Builds | ||
| # | ||
| # Builds all modules, uploads app to FAD and Wear and Automotive to S3 | ||
| # Builds all modules, uploads app to FAD and Wear, Automotive, and TV to S3 | ||
| ########## | ||
| - group: Prototype Builds | ||
| if: "build.pull_request.id != null || build.branch == 'main'" | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,8 @@ RELEASE_NOTES_SOURCE_PATH = File.join(PROJECT_ROOT_FOLDER, 'CHANGELOG.md') | |||||
| EXTRACTED_RELEASE_NOTES_PATH = File.join(ORIGINALS_METADATA_DIR_PATH, 'release_notes.txt') | ||||||
| PLAY_STORE_TRACK_AUTOMOTIVE_BETA = 'automotive:beta' | ||||||
| PLAY_STORE_TRACK_AUTOMOTIVE_PRODUCTION = 'automotive:production' | ||||||
| PLAY_STORE_TRACK_TV_BETA = 'tv:beta' | ||||||
| PLAY_STORE_TRACK_TV_PRODUCTION = 'tv:production' | ||||||
|
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please confirm these track identifiers against the actual Play Console before the next release build.
Two things worth checking:
A quick way to confirm both: bundle exec fastlane run google_play_track_version_codes \
package_name:au.com.shiftyjelly.pocketcasts track:tv:beta \
json_key:google-upload-credentials.json |
||||||
| PLAY_STORE_TRACK_WEAR_BETA = 'wear:beta' | ||||||
| PLAY_STORE_TRACK_WEAR_PRODUCTION = 'wear:production' | ||||||
| PLAY_STORE_TRACK_BETA = 'beta' | ||||||
|
|
@@ -66,8 +68,9 @@ ENV['SUPPLY_UPLOAD_MAX_RETRIES'] = '5' | |||||
| GITHUB_REPO = 'automattic/pocket-casts-android' | ||||||
| APPS_APP = 'app' | ||||||
| APPS_AUTOMOTIVE = 'automotive' | ||||||
| APPS_TV = 'tv' | ||||||
| APPS_WEAR = 'wear' | ||||||
| APPS = [APPS_APP, APPS_AUTOMOTIVE, APPS_WEAR].freeze | ||||||
| APPS = [APPS_APP, APPS_AUTOMOTIVE, APPS_TV, APPS_WEAR].freeze | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider putting TV last in
With TV inserted at index 2, any of those aborts the lane before wear is built or uploaded, and
Suggested change
(Order is irrelevant for |
||||||
|
|
||||||
| UPLOAD_TO_PLAY_STORE_JSON_KEY = File.join(PROJECT_ROOT_FOLDER, 'google-upload-credentials.json') | ||||||
| UPLOAD_TO_PLAY_STORE_COMMON_OPTIONS = { | ||||||
|
|
@@ -330,7 +333,8 @@ platform :android do | |||||
| end | ||||||
| end | ||||||
|
|
||||||
| # Update the rollout of all 3 variants/form-factors (app, automotive, wear) of the latest builds of the given Google Play track to the given % value | ||||||
| # Update the rollout of all app variants/form factors for the latest builds of the | ||||||
| # given Google Play track to the given % value | ||||||
| # | ||||||
| # @param percent [Float] The rollout percentage, between 0 and 1 | ||||||
| # @param track [String] The Google Play track for which to update the rollout of. Must be either `beta` or `production`. | ||||||
|
|
@@ -369,7 +373,12 @@ platform :android do | |||||
| not_found_variants.each do |message| | ||||||
| UI.important(message) | ||||||
| end | ||||||
| UI.user_error!('None of the 3 app variants were found in Google Play Console. We expected at least one') if not_found_variants.count == APPS.count | ||||||
| if not_found_variants.count == APPS.count | ||||||
| UI.user_error!( | ||||||
| "None of the #{APPS.count} app variants were found in Google Play Console. " \ | ||||||
| 'We expected at least one' | ||||||
| ) | ||||||
| end | ||||||
| end | ||||||
|
|
||||||
| # Downloads the latest translations from GlotPress and creates a PR to integrate them into the current `release/*` branch | ||||||
|
|
@@ -584,7 +593,7 @@ platform :android do | |||||
| # | ||||||
| # @param version [String] The version to create | ||||||
| # @param build_code [String] The build code to create | ||||||
| # @param app [String] The Android app to build (i.e 'app', 'automotive', or 'wear') | ||||||
| # @param app [String] The Android app to build (i.e. 'app', 'automotive', 'tv', or 'wear') | ||||||
| lane :build_bundle do |app:, version: version_name_current, build_code: build_code_current| | ||||||
| aab_artifact_path = aab_artifact_path(app, version) | ||||||
| build_dir = 'artifacts/' | ||||||
|
|
@@ -598,6 +607,7 @@ platform :android do | |||||
| build_type: 'Release', | ||||||
| properties: { | ||||||
| 'IS_AUTOMOTIVE_BUILD' => app == APPS_AUTOMOTIVE, | ||||||
| 'IS_TV_BUILD' => app == APPS_TV, | ||||||
| 'IS_WEAR_BUILD' => app == APPS_WEAR | ||||||
| } | ||||||
| ) | ||||||
|
|
@@ -635,7 +645,7 @@ platform :android do | |||||
| ) | ||||||
| end | ||||||
|
|
||||||
| # Compiles prototype builds and uploads to FAD (app) and S3 (wear/automotive) | ||||||
| # Compiles prototype builds and uploads to FAD (app) and S3 (wear/automotive/TV) | ||||||
| # | ||||||
| lane :build_and_upload_prototype_build do | ||||||
| firebase_account_key = ENV.fetch('FIREBASE_APP_DISTRIBUTION_ACCOUNT_KEY', nil) | ||||||
|
|
@@ -684,12 +694,12 @@ platform :android do | |||||
| ) | ||||||
| end | ||||||
|
|
||||||
| # Build wear/automotive and upload to S3 (PRs only) | ||||||
| # Build wear/automotive/TV and upload to S3 (PRs only) | ||||||
| next unless pr_number | ||||||
|
|
||||||
| UI.user_error!("'BUILDKITE_ARTIFACTS_S3_BUCKET' must be defined as an environment variable.") unless ENV['BUILDKITE_ARTIFACTS_S3_BUCKET'] | ||||||
|
|
||||||
| other_platforms = %w[wear automotive] | ||||||
| other_platforms = %w[wear automotive tv] | ||||||
|
|
||||||
| other_apks = [] | ||||||
| other_platforms.each do |platform| | ||||||
|
|
@@ -748,7 +758,7 @@ platform :android do | |||||
|
|
||||||
| def get_app_display_name(apk_path:) | ||||||
| key = get_app_key(apk_path: apk_path).to_sym | ||||||
| { app: 'π± Mobile', wear: 'β Wear', automotive: 'π Automotive' }.fetch(key, 'β Unknown') | ||||||
| { app: 'π± Mobile', wear: 'β Wear', automotive: 'π Automotive', tv: 'πΊ TV' }.fetch(key, 'β Unknown') | ||||||
| end | ||||||
|
|
||||||
| # Mimics the subset of ActiveSupport's `String#parameterize` we rely on. | ||||||
|
|
@@ -936,7 +946,7 @@ platform :android do | |||||
| BUILD_CODE_FORMATTER.build_code(build_code: build_code_next) | ||||||
| end | ||||||
|
|
||||||
| # Returns the versionCode for a given app, adjusting for offset depending if it's the mobile, automotive or wear app | ||||||
| # Returns the versionCode for a given app, adjusting for offset depending on its form factor | ||||||
| # | ||||||
| # See also `dependencies.gradle.kts` and its `versionCodeDifferenceBetweenAppAnd*` constants where those offsets are defined | ||||||
| # | ||||||
|
|
@@ -946,14 +956,16 @@ platform :android do | |||||
| (version_code.to_i + 50_000).to_s | ||||||
| when APPS_WEAR | ||||||
| (version_code.to_i + 100_000).to_s | ||||||
| when APPS_TV | ||||||
| (version_code.to_i + 150_000).to_s | ||||||
| else | ||||||
| version_code | ||||||
| end | ||||||
| end | ||||||
|
|
||||||
| # Returns the Play Store track for a given app, for Open Testing or Production | ||||||
| # | ||||||
| # @param app [String] The type of app. One of `APPS_APP`, `APPS_AUTOMOTIVE`, `APPS_WEAR` | ||||||
| # @param app [String] The type of app. One of `APPS_APP`, `APPS_AUTOMOTIVE`, `APPS_TV`, `APPS_WEAR` | ||||||
| # @param is_beta [Boolean] If we want the track for Open Testing. Otherwise, returns the track for Production | ||||||
| # @return [String] The Play Store track to use in the `upload_to_play_store(track: β¦)` action call | ||||||
| # | ||||||
|
|
@@ -963,6 +975,8 @@ platform :android do | |||||
| is_beta ? PLAY_STORE_TRACK_AUTOMOTIVE_BETA : PLAY_STORE_TRACK_AUTOMOTIVE_PRODUCTION | ||||||
| when APPS_WEAR | ||||||
| is_beta ? PLAY_STORE_TRACK_WEAR_BETA : PLAY_STORE_TRACK_WEAR_PRODUCTION | ||||||
| when APPS_TV | ||||||
| is_beta ? PLAY_STORE_TRACK_TV_BETA : PLAY_STORE_TRACK_TV_PRODUCTION | ||||||
| else | ||||||
| is_beta ? PLAY_STORE_TRACK_BETA : PLAY_STORE_TRACK_PRODUCTION | ||||||
| end | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest
--continuehere now that three modules share one invocation.abortOnError = trueis set globally (build.gradle.kts:251), so the first module whose lint fails stops the invocation and the remaininglintReleasetasks never run. Their SARIF files are then never generated, and the correspondingupload_sarif_to_githubcalls at lines 31β32 silently upload nothing β so a TV lint error hides the wear report, and an automotive error hides both.That's exactly the failure mode the comment on line 16 works around for
:app:. It existed with two modules, but TV is a new module with a near-empty baseline (tv/lint-baseline.xmlis 191 bytes) and it now sits before wear in the task list, so it's more likely to bite.--continuestill yields a non-zero exit code, solint_exit_codehandling below is unaffected β you just get all four reports uploaded on a failing run.Fix this β