Skip to content

Align TestFlight guard with scheduled uploads - #9170

Merged
lawrencecchen merged 23 commits into
mainfrom
task-fix-testflight-schedule-guard
Jul 30, 2026
Merged

lawrencecchen merged 23 commits into
mainfrom
task-fix-testflight-schedule-guard

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Current main fails the TestFlight workflow guard after #9165 replaced push uploads with scheduled batching.

This updates the existing test-only guard to enforce the two cron schedules, the embedded iOS path filter, run-id concurrency, and resolved INTERNAL/DEMO variant routing. Runtime workflow logic is unchanged.

Reproduced: https://github.com/manaflow-ai/cmux/actions/runs/30493631978

Verified:

  • python3 tests/test_ios_testflight_main_push_filter.py
  • python3 -m pytest -q tests/test_ios_testflight_main_push_filter.py
  • python3 -m py_compile tests/test_ios_testflight_main_push_filter.py
  • git diff --check

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

Aligns iOS TestFlight guard tests with scheduled uploads and executes decision + ordering end-to-end via a bun harness. Adds coverage for scoped changes, unchanged-head skips, paginated upload history, and override-artifact isolation; no workflow runtime changes.

  • Bug Fixes
    • Validates cron schedules; enforces iosRelevantPaths; executes decision + ordering; asserts should_build/variant/last_uploaded_sha.
    • Skips when the scheduled head matches the last uploaded SHA without calling compare; fails open on truncated or failed compares with a warning.
    • Retries transient ordering API failures (runs/jobs) with backoff; waits for earlier runs and before the upload job exists; paginates workflow-run queries and asserts page sequencing.
    • Orders by workflow run id and ignores later in‑progress runs when evaluating earlier uploads across manual/scheduled mixes.
    • Routes demo correctly: resolved needs.decide.outputs.variant drives lane/audience; demo cron reads demo-only artifact history (ignores newer internal artifacts and paginates to the matching artifact); manual demo dispatch builds even if the head was already uploaded; manual override uploads use ios-testflight-build-metadata-override and are excluded from canonical history (scheduled runs ignore them).
    • Parses concurrency config; asserts group: ios-testflight-${{ github.run_id }} and cancel-in-progress: false; ensures scheduled and manual runs use distinct groups.

Written for commit 131a129. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Tests
    • Expanded iOS TestFlight workflow coverage to emphasize scheduled uploads, including cron structure and computed iOS-relevant path filtering.
    • Added scenario-based checks for decision outputs, demo cron routing, and correct behavior for manual dispatch when the head SHA is already present.
    • Introduced a decision-scenario harness to execute and verify workflow logic with stubbed GitHub APIs.
    • Updated concurrency-group isolation and tightened upload-lane gating using the resolved routing guard.
    • Refined workflow parsing utilities with improved YAML/JS extraction helpers and added whitespace-focused coverage.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The iOS TestFlight workflow tests now cover scheduled and manual uploads, parse generated workflow data, use resolved variant guards, and verify decision routing, concurrency, and upload-lane conditions.

Changes

iOS TestFlight scheduling

Layer / File(s) Summary
Variant resolution and workflow templating
tests/test_ios_testflight_main_push_filter.py
Adds schedule and resolved-variant constants, preserves marketing override precedence, and updates upload-lane gating expressions.
Scheduled trigger and decision validation
tests/test_ios_testflight_main_push_filter.py
Adds YAML and JavaScript parsing helpers plus a Bun decision harness covering scheduled, manual, and path-filtered decisions, uploaded SHAs, comparisons, and retry behavior.
Run ordering and test execution
tests/test_ios_testflight_main_push_filter.py
Validates independent scheduled/manual concurrency groups and updates the direct test runner for the schedule-focused tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: azooz2003-bit

🚥 Pre-merge checks | ✅ 23 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The summary and verification notes are good, but the required Demo Video, Review Trigger, and Checklist sections are missing. Add the missing template sections: Demo Video, Review Trigger block, and Checklist; also present verification under a Testing heading.
✅ Passed checks (23 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed Diff only changes a Python test file; no production Swift code or actor-isolation-related Swift types were modified.
Cmux Swift Blocking Runtime ✅ Passed Only a Python test file changed; no Swift production code or blocking runtime primitives were introduced.
Cmux Browser Automation Off-Main ✅ Passed Commit only changes tests/test_ios_testflight_main_push_filter.py; no browser socket automation files or browser.* routing changes were touched.
Cmux Expensive Synchronous Load ✅ Passed Only a Python test file changed; no production Swift code or main-actor synchronous loads were added or moved.
Cmux Cache Substitution Correctness ✅ Passed Diff only changes tests; no production cache/history/snapshot read was replaced, so the rule doesn’t apply.
Cmux No Hacky Sleeps ✅ Passed Only a Python test file changed; the new wait logic is a deterministic test harness stub, not a real runtime sleep or polling loop.
Cmux Algorithmic Complexity ✅ Passed Only tests/test_ios_testflight_main_push_filter.py changed; the rule explicitly passes test-only scaffolding and no production code was modified.
Cmux Swift Concurrency ✅ Passed Diff only changes tests/test_ios_testflight_main_push_filter.py; no Swift sources or concurrency patterns were introduced.
Cmux Swift @Concurrent ✅ Passed The commit only changes a Python test file; no Swift files or Swift concurrency annotations are present, so the rule is not applicable.
Cmux Swift Package Boundaries ✅ Passed Diff only changes tests/test_ios_testflight_main_push_filter.py, which is test code and exempt from Swift package-boundary enforcement.
Cmux Swiftpm Lockfiles ✅ Passed Only a test file changed; no .gitignore, Package.swift, Package.resolved, or Xcode project files were modified.
Cmux Swift Logging ✅ Passed PR only changes a Python test file; no Swift/runtime code was modified, so the Swift logging rule doesn’t apply.
Cmux User-Facing Error Privacy ✅ Passed Diff is test-only; no production user-facing text changed or leaked vendor/internal details, and the rule explicitly allows tests.
Cmux Full Internationalization ✅ Passed PASS: PR only changes a test file; no user-facing Swift/web/metadata strings or locale catalogs were touched, and tests are exempt under the rule.
Cmux Swiftui State Layout ✅ Passed Only changed file is a Python test; no SwiftUI files or state/layout patterns are introduced, so the rule is not triggered.
Cmux Architecture Rethink ✅ Passed Diff touches only a Python test file; no Swift files or architecture changes are introduced, so the Swift rethink rule is not implicated.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed Diff only changes tests/test_ios_testflight_main_push_filter.py; no Swift files or window-close-shortcut code changed.
Cmux Source Artifacts ✅ Passed Only tests/test_ios_testflight_main_push_filter.py changed, and it’s a hand-written test source file allowed by the rule; no artifact paths or generated logs were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed Diff only changes tests/test_ios_testflight_main_push_filter.py; no Swift files under Sources/ were modified.
Cmux No Ambient Global State ✅ Passed Only tests/test_ios_testflight_main_push_filter.py changed; no Swift files or new ambient-global-state surfaces were added, so the Swift rule doesn't apply.
Title check ✅ Passed The title clearly matches the main change: aligning TestFlight guard tests with scheduled uploads.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-fix-testflight-schedule-guard

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 431f1e2957

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1473d64a0

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 `@tests/test_ios_testflight_main_push_filter.py`:
- Around line 86-90: Update the literal-block line handling around the existing
`line` check so whitespace-only lines are treated like empty lines: append an
empty string and continue before validating `content_prefix`. Preserve prefix
validation and removal for non-blank lines.
- Around line 250-257: Update the harness execution helper around subprocess.run
to check that bun is available before invoking it, and produce a clear test skip
or assertion failure when it is missing. Preserve the existing returncode
assertion and JSON parsing for available bun installations, and ensure the
module-level __main__ runner does not expose a raw FileNotFoundError traceback.
🪄 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 Plus

Run ID: 8230a4dc-b4fa-4edd-8123-321d216dcd13

📥 Commits

Reviewing files that changed from the base of the PR and between 431f1e2 and d1473d6.

📒 Files selected for processing (1)
  • tests/test_ios_testflight_main_push_filter.py

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
Comment thread tests/test_ios_testflight_main_push_filter.py
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 607eefaf88

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 566e20d88b

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py
Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7797243f38

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a54e0c8c91

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py
Comment thread tests/test_ios_testflight_main_push_filter.py
Comment thread tests/test_ios_testflight_main_push_filter.py
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5737dac22f

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
Comment thread tests/test_ios_testflight_main_push_filter.py
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3de1b03fe8

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py
Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67aee41a97

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
Comment thread tests/test_ios_testflight_main_push_filter.py
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8df9fe38ca

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0d03919a4

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b6cf0838c

ℹ️ 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".

Comment thread tests/test_ios_testflight_main_push_filter.py Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@austinywang austinywang mentioned this pull request Jul 29, 2026
6 tasks done
@lawrencecchen
lawrencecchen merged commit bf6f113 into main Jul 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant