Repository navigation
feat: Android brake stage action to replace a halted rollout - #23030
Conversation
BRAKE_ACTION=stage writes one inProgress production release for a fixed build that sits alone on internal or alpha, replacing a halted release. It refuses unless production holds the superseded code as halted beside completed releases only, the new version is newer, and the fraction does not exceed the halted one. Notes copy the halted release's What's New and append BRAKE_NOTES_LINE to en-US and to locales holding the identical English text (translations stay as-is). The name carries the train's gate receipt so the ladder can advance it. Completed releases stay untouched. The Codemagic workflow gains three env vars; the two contract fixture digests are refreshed under lead ruling 0f4368. No other .github edits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codemagic validation refuses an empty env var value, so build 6ad8843e0d853867bad5a999 failed before any script ran. The stage action already refuses a missing notes line; operators pass it per build. Contract fixture digests refreshed again under lead ruling 0f4368. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first live stage (Codemagic 6ad887a212a04f1982afdc61) refused before writing because the halted notes plus the fix line exceed 500 characters. The refusal now names both lengths so the operator can size the line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s limit The halted 1471 notes plus the fix line exceed 500 characters. Per lead answer 2161ae, the fix line now replaces the last bullet when appending does not fit; it still refuses when neither fits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… line Play's Android notes come from mobile-changelog android_notes as one line of entries joined by "; " (1471: 486 characters), so the newline-only replacement could not fit the fix line. The stage now splits on newlines when present, otherwise on "; ", and appends or replaces the last entry in that same shape. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…token Three stage attempts (Codemagic 6ad88c1735ae51bce5312b52, 6ad89a32e0fb3f54e60c379f, 6ad89cf2dae7e5cbee42b247) refused before any Play edit because the anonymous GitHub API read from Codemagic's shared runners failed. The brake workflow now loads the existing read-only mobile_release_admission group and sends its GITHUB_TOKEN when present. Contract fixture digests refreshed under lead ruling 0f4368. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2dd1679401
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| name = release.get("name") | ||
| version = promote.production_release_version(name) if isinstance(name, str) else None | ||
| if codes != [version_code] or version is None: | ||
| raise BrakeError(f"{track_name} release for the stage code must carry only that code and a version") |
There was a problem hiding this comment.
Reject inactive source releases before staging
When the matching internal or alpha release has status draft, halted, or an invalid/missing status, this validation still accepts it because it checks only the code and version name, then publishes that artifact to production. The normal train deliberately limits candidates to completed or inProgress; apply the same status check here so a build that was never active on a test track cannot be exposed to production users.
Useful? React with 👍 / 👎.
| raise BrakeError("stage version must be newer than the halted release") | ||
| release = { | ||
| "name": train._staged_name_with_receipt(version), | ||
| "versionCodes": [version_code], |
There was a problem hiding this comment.
Refuse multi-code halted releases before replacing them
When the halted release contains multiple version codes, this singleton assignment silently removes every variant other than the newly supplied code from production. The normal promotion path explicitly retains extra codes for multi-APK rollouts, so this emergency path should either require the halted release to contain only BRAKE_SUPERSEDES_VERSION_CODE or handle all variants explicitly rather than dropping them.
Useful? React with 👍 / 👎.
| if halted_version is None or promote.version_parts(version) <= promote.version_parts(halted_version): | ||
| raise BrakeError("stage version must be newer than the halted release") |
There was a problem hiding this comment.
Check the fix against every production version
When production also contains a completed release whose marketing version is newer than the halted release, this comparison permits a fix that is newer than the halted version but older than the version already serving users. Because Play update eligibility is governed by version code rather than this release-name version, a higher-code build can commit successfully while regressing the displayed app version; compare the candidate against every parseable production release, as the normal promotion path does.
Useful? React with 👍 / 👎.
| release = { | ||
| "name": train._staged_name_with_receipt(version), | ||
| "versionCodes": [version_code], | ||
| "status": "inProgress", | ||
| "userFraction": fraction, |
There was a problem hiding this comment.
Preserve the halted release's update priority
When the halted release has a non-default inAppUpdatePriority, constructing this replacement from a fresh mapping silently drops that setting, so the fixed build reverts to the default update priority. The standard promotion path deliberately preserves this metadata from its base release; seed the replacement from the halted release and overwrite the controlled fields, while retaining the existing country-targeting refusal.
Useful? React with 👍 / 👎.
|
Review round 1 (Grok, head 2dd1679): SHIP, two P2s. Responses: P2 P2 Follow-up issue: #23032 |
Follow-up to #22999 (Android rollout brake). Adds
BRAKE_ACTION=stageto the manual Codemagicandroid-rollout-brakeworkflow, so a fixed build can replace a halted production rollout at an explicit small fraction. Merge after #22999.Why: David approved halting Android 1.0.568 (1471) and fast-tracking the fixed 1.0.569 (1477), which carries the pendant reconnect audio-loss fix from #22995.
mobile-store-promotecannot be used for this: its Android path defaults tostatus=completed, which is 100% at once.What
stagedoes:BRAKE_VERSION_CODE(new code),BRAKE_SUPERSEDES_VERSION_CODE(halted code),BRAKE_USER_FRACTION, a one-lineBRAKE_NOTES_LINE, andCONFIRM=brake. Inputs are validated before any authentication or edit.haltedbeside completed releases only (no drafts or other staged releases), the new code is not already on production, the new code sits alone on internal or alpha under exactly one marketing version newer than the halted one, the fraction does not exceed the halted fraction, and the halted release has no country targeting.inProgressrelease at the requesteduserFractionin place of the halted one. Completed releases stay byte-identical. The release name carries the daily train's gate receipt (1.0.569 (gate YYYY-MM-DD-HHMM)), so the ladder can advance it later.BRAKE_NOTES_LINEto en-US and to every locale holding the identical English text. Real translations stay unchanged, and Play's 500-character limit is enforced before writing.ERROR_IF_IN_REVIEWcommit, then a full-track readback in a fresh edit. PrintsBRAKE_RESULT action=stage ....The only
.github/change refreshes the two whole-document Codemagic digests in.github/scripts/fixtures/codemagic_workflow_contract/v1.json, under lead ruling0f4368. A scratch check confirmed every other workflow is semantically identical and only three env vars were added toandroid-rollout-brake.Validation:
backend/tests/unit/test_mobile_rollout_brake.pynow has 24 fake Play tests (11 new), all passing, plus.github/scripts/test_check_release_process_guards.py(121 total passed). Stage tests cover the exact written track, notes, gate-receipt name, call sequence, refusal for every non-halted status, unexpected production or source state, fraction above the halted one, bad inputs before authentication, update/readback mismatches, and a status read of the staged release.Fixes found during live use (each refused before opening any Play edit):
BRAKE_NOTES_LINEhas no yaml default and is passed per build.mobile-changelogandroid_notes; 1471 held 486 characters). The stage keeps whichever shape Play holds and replaces the last entry when appending would pass 500 characters. The refusal names both lengths.mobile_release_admissiongroup, and the check sends itsGITHUB_TOKENwhen present.Live use (store-fasttrack lane, David-approved fast-track; lead answer
0142bbfor the notes):6ad88707d7f84e6126bb0274:BRAKE_RESULT action=status versionCode=1471 status_before=halted status_after=halted userFraction=0.16ad8a05789e6dfa249fca407:BRAKE_RESULT action=stage versionCode=1477 status_before=absent status_after=inProgress userFraction=0.01 supersedes=1471 superseded_status=halted superseded_userFraction=0.1 name='1.0.569 (gate 2026-10-21-1123)'6ad8a0d948119fac6ce8b698:BRAKE_RESULT action=status versionCode=1477 status_before=inProgress status_after=inProgress userFraction=0.01Both GitHub Play writer workflows remain disabled; re-enabling is the release lead's call.
Product invariants affected: INV-AUTH-1, INV-DATA-1, INV-BETA-1 (the shared Codemagic file matches these guards; the change only adds env vars to the Android production brake workflow and preserves all existing desktop auth, routing, signing, and Beta workflows).
🤖 Generated with Claude Code