Auto-submit external TestFlight beta reviews

Merged
AZ
3mo ago
+705-33

Summary

  • extend external TestFlight distribution to submit builds for Beta App Review when Apple reports READY_FOR_BETA_SUBMISSION
  • keep the external distribution helper idempotent for already-submitted and already-approved builds
  • document the new main-tracking behavior and cover the submission logic in workflow helper tests

Testing

  • python3 tests/test_ios_testflight_external_distribution.py
  • bash -n ios/scripts/upload-testflight.sh
  • python3.9 -m py_compile ios/scripts/asc_assign_external_testflight_group.py

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Auto-submits external TestFlight builds for Beta App Review when Apple marks a new MARKETING_VERSION as READY_FOR_BETA_SUBMISSION, removing a manual step and speeding up external releases. The flow is idempotent, resilient to ASC delays, handles sibling-review races, and continues to auto-assign builds to the external group.

  • New Features
    • asc_assign_external_testflight_group.py now polls ASC and creates/reuses the submission for READY_FOR_BETA_SUBMISSION; it treats APPROVED/IN_REVIEW/WAITING_FOR_REVIEW as success, no-ops when the build is already approved/testable, waits if a same-version sibling build is in review, retries transient lookup/submit errors, and fails on unexpected states; writes an assign state to ${CMUX_TESTFLIGHT_ASSIGN_STATE_OUT_FILE}.
    • The workflow uploads ios-testflight-assignment-state-{complete|pending} artifacts and the schedule uses them to retry assignment-only when sibling reviews block; if artifacts have expired (30d), missing state is treated as complete to avoid permanent red.
    • Adds a one-time marketing_version_override path to upload latest main under an approved MARKETING_VERSION (skips notes; disallows build_number); publishes ios-testflight-build-metadata-override and excludes override runs from canonical “last uploaded” detection.
    • Raises external distribution timeout to 40m; updates ios/README.md, workflow summaries, and upload-testflight.sh to reflect automatic submission; expands tests to cover polling/retry, sibling-review handling, submission races, and delayed metadata.

Summary by CodeRabbit

  • New Features
    • Added an optional manual marketing-version override for re-uploading the current iOS build without triggering a new Beta App Review cycle.
  • Documentation
    • Updated TestFlight automation docs and command help to clearly describe automatic Beta App Review submission when builds are ready, plus required API key inputs.
  • Bug Fixes
    • Improved external distribution reliability by better detecting when Beta App Review submissions already exist, reusing/creating them as appropriate, and refining upload/assignment behavior.
  • Tests
    • Expanded and stabilized coverage for external review submission paths, retries, idempotency, and race/error handling.