ci(ios-testflight): don't re-archive iOS inputs that already failed

Merged
TE
2mo ago
+193-1

While main is broken for iOS, the 20-minute internal poll keeps running. The last successful upload SHA never matches main, so each poll archives the same broken inputs on a macOS runner again.

Data (ios-testflight.yml, 09-20 to 09-22): 119 failed runs, about 1,430 runner-minutes. 45 of them re-ran a SHA that had already failed. The rest mostly differed only by non-iOS commits. Sampled failures (e.g. 35695510672, 35669227067) were a real compile break on main, cannot find type 'PhotosPickerItem' in scope in TaskComposerAttachmentStager.swift. The break cleared when the fix landed (first green run 06:44).

Change (decide job only): internal polls reuse the run list the ordering check already fetched. A poll skips when both of these hold:

  • the newest run since the last successful upload has a failed Upload to TestFlight job;
  • compare(failed_sha, head) touches no iosRelevantPaths.

This adds no API calls in the normal case, and one jobs call plus at most one compare when a failure exists. A fix that touches iOS paths builds on the next poll. Manual dispatch and the DEMO schedule are unchanged, and any lookup error builds.

Tests: 3 new scenarios in tests/test_ios_testflight_main_push_filter.py, which fail on the old workflow. The full file, test_ios_testflight_pro_distribution.py, and test_ci_self_hosted_guard.sh pass.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Stops internal TestFlight polls from re-archiving the same broken iOS inputs on macOS runners while main doesn't build for iOS.

  • Skips a poll when the newest upload attempt since the last successful upload failed and no iOS-relevant path changed since.
  • Adds no API calls in the normal case; one jobs call plus at most one compare when a failure exists.
  • Manual dispatch and the DEMO schedule are unchanged, and any lookup error builds.
  • Adds 3 test scenarios covering the skip, retry after an iOS change, and non-skipping cases.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented internal TestFlight polling from repeatedly rebuilding the same inputs after an upload failure when no relevant iOS changes have been made.
    • Builds are retried when iOS-related files change.
    • Failures from unrelated workflow runs, manual runs, demo schedules, or older attempts no longer incorrectly prevent new builds.
  • Tests
    • Added coverage for failed uploads, retry conditions, and unrelated workflow outcomes.