Add a beta-promotion picker to release builds to the Play Store beta track#23079
Open
oguzkocer wants to merge 14 commits into
Open
Add a beta-promotion picker to release builds to the Play Store beta track#23079oguzkocer wants to merge 14 commits into
oguzkocer wants to merge 14 commits into
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
First step of the beta-promotion picker: read the beta track's current version codes for WordPress and Jetpack via google_play_track_version_codes and log them plus the combined floor. Read-only for now.
Extend gather_beta_candidates to read every uploaded AAB version code per app via the Play app bundle explorer (Supply::Client#aab_version_codes over a throwaway edit), then compute the codes present for both apps and above the beta floor. Read-only; logs the floor, the pool, and the candidates.
gather_beta_candidates now opens a Buildkite block step (candidate list posted to Slack) and promote_to_beta promotes the chosen version code to the beta track for WordPress and Jetpack as a draft, referencing the existing bundle (no rebuild). Adds the Buildkite command scripts and the promote-beta.yml pipeline.
The beta-track and bundle-explorer lookups rescued every error into [], which is indistinguishable from a legitimately empty result: a transient failure would collapse the candidate intersection (reading as 'nothing to promote') or null out the floor (reading as 'promote everything'). Raise a clear error instead, mirroring the iOS promote lanes. Also wrap the throwaway edit's read in ensure so it's aborted even when the read raises.
upload_promotion_steps hardcoded build/promote-steps.yml while PROMOTION_STEPS_FILE built the same path from PROJECT_ROOT_FOLDER; the two could silently diverge. Both now derive from PROMOTION_STEPS_RELATIVE_PATH.
buildkite_api_get had no open/read timeout, so a hung response could stall the gather lane across all 5 block-step poll attempts. Bound both to 10s.
The promote path hand-rolled its own upload_to_play_store call, duplicating the retry, skip flags, and retained pinned codes that upload_build_to_play_store already owns. Generalize that lane to also promote an existing build by version_code (reference the code, skip the AAB), and have the beta promotion call it. The pinned RETAINED_VERSION_CODES constant now lives in one place.
Use Array#max(n) instead of sort.reverse.first(n) for the newest N candidates, and reject a non-integer version_code up front with a clear message rather than letting Integer() fail per app.
Route the candidate list, per-app results, and the pipeline failure-notify to #test-wpmobile-slack-integration while validating the flow. Revert to #build-and-ship before merge.
Cut over-explaining and session-flavored comments down to the factual point, and drop a stale comment that claimed available_aab_version_codes returns [] on failure (it raises).
- Candidates are the version code itself; drop the version_name/build_number decode, which was wrong for hotfix (patch) versions and unused beyond the block-step/Slack label. - Move the generic send_slack_message/notify_slack/get_required_env helpers out of promote.rb into the Fastfile. - Keep [1440] inline in upload_build_to_play_store and drop the extracted RETAINED_VERSION_CODES constant (out of scope now that promote reuses the lane). - Raise the Buildkite API poll timeout from 10s to 30s.
Replace the ad-hoc buildkite_api_token helper and the lone SLACK_WEBHOOK read with the shared get_required_env helper (matching wpios), so required secrets are read one consistent way. Optional env vars keep ENV.fetch with a default.
upload_to_play_store(version_code:, skip_upload_aab: true) commits an empty edit — supply only builds a track release from binaries uploaded in the same run, so the bare version_code was ignored and no beta release was created. Create the draft beta release directly with Supply::Client (build a TrackRelease for the chosen version code, set it on the beta track, commit), mirroring supply's own update_track. Revert upload_build_to_play_store to its original AAB-only form.
…script shebangs - Replace inline [1440] in upload_build_to_play_store and promote_version_code_to_beta with PLAY_STORE_VERSION_CODES_TO_RETAIN - Change gather-beta-candidates.sh and promote-to-beta.sh shebangs to '#!/usr/bin/env bash' with 'set -eu' - Update promote-beta.yml notify and send_slack_message channel comments
ce4b529 to
83e0757
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Description
Adds a way to promote an already-uploaded build to the Play Store
betatrack without rebuilding. A developer picks a build from a Buildkite block step, and WordPress and Jetpack are promoted together (they share a version code, so one pick covers both).On the term "promote": this isn't entirely Play Console's "Promote release" (which advances a track's current release). Here we pick any uploaded build and create a
betarelease for it, but it's still promotion up the track ladder. It's the terminology this PR proposes, but happy to take it to another direction if reviewers have a strong preference to use another term.What's included:
fastlane/lanes/promote.rb— two lanes:gather_beta_candidateslists the promotable builds (version codes present in both apps' Play libraries and above the currentbetarelease, newest first), writes and uploads a Buildkite block step to choose one, and posts the candidate list to Slack.promote_to_beta version_code:<code>creates a draftbetarelease for that version code in each app directly via the Play API (Supply::Client): open an edit, set the release on thebetatrack, commit..buildkite/—promote-beta.ymlpluscommands/gather-beta-candidates.shandcommands/promote-to-beta.sh, wiring the gather → block → promote flow. Candidate discovery reads the beta track (google_play_track_version_codes) and the uploaded-bundle list (Supply::Client#aab_version_codesover a throwaway, aborted edit).fastlane/Fastfile— adds thesend_slack_message,notify_slack, andget_required_envhelpers and thePLAY_STORE_VERSION_CODES_TO_RETAINconstant, and imports the new lane file.fastlane/lanes/build.rb—version_codes_to_retainnow references the sharedPLAY_STORE_VERSION_CODES_TO_RETAINconstant.Notes:
release_status: 'draft', so nothing reaches beta testers yet. Flip to'completed'inpromote.rbwhen ready to distribute.trunk(ensure_promotion_on_trunk!); a local or off-branch run fails by design.Testing instructions
Promotion is a Play Store track operation, so there is no app build to install. The flow runs entirely on Buildkite and ends in a draft release in the Play Console (which does not reach testers and can be discarded).
Because the promote lanes refuse to run off
trunk, e2e-test from a throwaway branch with the guard removed:Set up a test branch:
task/promote-to-beta(e.g.task/promote-to-beta-e2e).ensure_promotion_on_trunk!calls infastlane/lanes/promote.rband commit.trunk.Run the picker:
PIPELINE=promote-beta.yml.promote_to_beta.Confirm in the Play Console: