Repository navigation
ci: run iOS TestFlight beta lane every ~2h (prompt internal builds) - #6489
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe iOS TestFlight workflow's schedule trigger changes from a single nightly cron to every ~2 hours. The associated comments are updated to document how the more frequent schedule enables the existing SHA-based decision logic to retry commits that were previously missed or failed to upload. ChangesiOS TestFlight schedule cadence and retry documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (4 errors)
✅ Passed checks (19 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b3540cc. Configure here.
| const runs = await github.rest.actions.listWorkflowRuns({ | ||
| owner, | ||
| repo, | ||
| workflow_id: 'ios-testflight.yml', | ||
| status: 'success', | ||
| per_page: 1, | ||
| }); | ||
| lastUploadedSha = runs.data.workflow_runs[0]?.head_sha ?? null; |
There was a problem hiding this comment.
listWorkflowRuns missing branch: 'main' filter
The call queries all successful runs of this workflow regardless of branch. If workflow_dispatch is triggered on a non-main branch (the upload job is guarded by github.ref == 'refs/heads/main', so it skips, but the run still completes as "success"), that run's head_sha becomes the next auto-run's lastUploadedSha. In practice, feature-branch commit SHAs won't collide with main SHAs, so no incorrect skip would occur — but adding branch: 'main' tightens the intent and ensures "last uploaded sha" actually refers to a main commit, not an incidental dispatch SHA from another branch.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| lastUploadedSha = runs.data.workflow_runs[0]?.head_sha ?? null; | ||
| needsBuild = lastUploadedSha !== context.sha; | ||
| const alreadyUploaded = lastUploadedSha === context.sha; | ||
|
|
||
| needsBuild = isTip && !alreadyUploaded; |
There was a problem hiding this comment.
alreadyUploaded conflates "run succeeded" with "upload actually happened"
A run where decide completes with should_build = false (upload skipped) still resolves as status: success, so lastUploadedSha can point to a commit that was never uploaded. The variable and surrounding comment call it "last uploaded sha," but it is really "most recent successful run's sha." In normal forward-only main history this causes no problem — a skipped-upload run only occurs when isTip = false (a newer commit was already tip), and that older commit can't re-appear as context.sha without a force-push. The mismatch only becomes a real skip if main is ever force-pushed backwards. Renaming to lastSuccessfulRunSha and adding a code comment would clarify the intentional limitation without changing behavior.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ios-testflight.yml:
- Around line 283-314: The pinned SHA for the actions/github-script action does
not match the declared v9.0.0 version tag. Update the SHA hash in the Re-verify
HEAD is still the main tip before uploading step (the one using
actions/github-script@) from the current incorrect SHA to the correct SHA that
resolves to v9.0.0, which is d746ffe35508b1917358783b479e04febd2b8f71, to ensure
the action version and its pin are consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8d121d70-2c27-4c0c-9f81-a640bd1bedce
📒 Files selected for processing (1)
.github/workflows/ios-testflight.yml
An iOS change waited up to ~24h for the nightly TestFlight upload (and stranded another day if that nightly failed). Run the existing, proven, serialized lane every ~2h instead, so an iOS-affecting merge reaches internal TestFlight within ~2h. This reuses the per-ref-serialized decide+upload path unchanged (no push trigger): a per-push lane would either cancel superseded pending runs into red checks or, with per-SHA concurrency, let parallel archives race on the timestamp build number. ~2h spacing exceeds one archive's duration (~30-60m) so runs do not overlap and uploads never collide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
44bf7f6 to
aa0de96
Compare

Why
An iOS change waited up to ~24h to reach internal TestFlight (the lane ran on a nightly cron) — and if that one nightly failed, another day. You wanted iOS changes to reach internal builds promptly.
What
One-line cadence change: run the existing
ios-testflight.ymllane every ~2h (17 */2 * * *) instead of nightly. Thedecidejob already SHA-compares HEAD to the last uploaded commit, so each run uploads the latest main only when it has advanced (green skip otherwise).Why not a push trigger / per-commit (autoreview drove this)
A per-push, build-per-commit lane looked simpler but isn't, and three autoreview rounds proved it:
CFBundleVersion(same-second collisions; or an older commit uploading after a newer one with a lower build number).Running the single, already-serialized per-ref lane more often sidesteps all of that. ~2h spacing exceeds one archive's duration (~30-60m), so runs never overlap and uploads never collide. If faster turnaround is needed later, tighten the interval (kept > one archive's duration) rather than adding a push trigger.
For an immediate beta,
workflow_dispatchstill works.🤖 Generated with Claude Code
Note
Low Risk
CI schedule and documentation only; no changes to signing, upload scripts, or dedupe logic.
Overview
Shortens internal TestFlight latency by changing the
ios-testflight.ymlschedule from once daily (10 9 * * *) to every ~2 hours at minute 17 (17 */2 * * *).The upload path is unchanged: the
decidejob still SHA-comparesmainHEAD to the last successful run and skips when nothing new needs shipping. Expanded workflow comments document why ~2h beats a push trigger (concurrency/cancelled checks,CFBundleVersionraces) and why the interval stays longer than a typical archive+upload (~30–60m) so the single serialized per-ref lane does not overlap.workflow_dispatchremains for on-demand uploads.Reviewed by Cursor Bugbot for commit aa0de96. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit