Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Devops - Handle TestFlight Beta App Review gracefully in iOS build workflows #13207

@narin

Description

@narin

Type of change

Update Existing Automation

What is changing

  • Github Actions
  • Fastlane

Work Being Done

When a new iOS version number is uploaded to TestFlight for the first time, Apple requires Beta App Review before the build can be distributed to external testers. This causes the upload_to_testflight step (with distribute_external: true) to fail or timeout, resulting in false build failures even though the build was successfully uploaded.

This was observed in this workflow run where the build retried 3 times over ~60 minutes before failing, each time hitting the altool 409 "Upload limit reached" error compounded by the beta review gate.

Changes:

  1. VAMobile/ios/fastlane/Fastfile - Modify upload_tf to separate upload from external distribution:

    • Upload with distribute_external: false (always succeeds)
    • Check via Spaceship API if the version has already passed Beta App Review
    • If approved: distribute immediately (no behavior change for same-version builds)
    • If pending: submit for beta review, trigger a new distribute workflow, and succeed the build
    • Add new distribute lane that polls App Store Connect for review approval and distributes once approved
    • Add helper methods for checking review status, distributing to groups, and submitting for review
  2. .github/workflows/build_ios.yml - Add actions: write permission and GH_TOKEN env var so fastlane can trigger the distribute workflow via gh CLI

  3. .github/workflows/distribute_testflight.yml (new) - Lightweight workflow triggered automatically when beta review is pending, or manually via workflow_dispatch. Polls for approval (every 5 min, up to 60 min), distributes, and notifies Slack.

Acceptance Criteria

  • Builds with a version that has already passed Beta App Review distribute immediately (no behavior change)
  • Builds with a new version number upload successfully and do not fail due to pending Beta App Review
  • New version builds automatically submit for Beta App Review and trigger the distribute workflow
  • The distribute workflow polls App Store Connect and distributes once approved
  • Slack notifications are sent for both successful distribution and timeout scenarios
  • The distribute workflow can be triggered manually from the Actions tab as a fallback
  • The distribute workflow runs on macos-latest (not macos-26-xlarge) to minimize cost

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions