Repository navigation
ci(desktop): stop the release job compiling the world twice for one test suite - #13553
aryanorastar wants to merge 2 commits into
Conversation
…est suite
Desktop Swift Release Compile runs two sequential release compiles inside a
60-minute job. Run 34610634122: the app build finished at 31.5 min
("Build complete! (1887.11s)"), then the regression step was cancelled at
27.8 min still mid-compile, on a warm dependency cache.
The step's own comment claimed it reused the first build. It did not. A plain
`swift build -c release` has testability off; `swift test -c release` needs it
on for `@testable import Omi_Computer`, and that flag difference invalidates
the module graph, so the step recompiled Omi_Computer, FirebaseCore, PostHog,
PLCrashReporter and every other dependency a second time. The module list in
that run's log is the evidence.
Build the test targets with testability in the first step and let the second
reuse them. Measured locally: `swift build -c release --build-tests
-Xswiftc -enable-testing` then `swift test -c release --skip-build --filter
UserNotificationCallbackBridgeTests/` runs the suite in 6.9s, 11 tests, 0
failures. Without the flags the same --skip-build fails with "Omi
ComputerPackageTests.xctest doesn't exist in file system", which is what
proved the products were never shared.
Gated on should_notification_release_regression, the same output that decides
whether the regression runs at all, so main pushes and Package.swift PRs do
not pay to compile test targets nothing executes. The contract test pins that
both steps read that one output: if they ever disagree nothing errors — the
build quietly omits the test targets and the step rebuilds the world again.
The trade worth naming: the release-compile check now verifies a
testability-enabled release build on notification-path PRs rather than a
plain one. Type checking and the release-only Sendable diagnostics the check
exists for are unaffected; cross-module optimization differs, so it is not
byte-identical to a signed candidate's compile.
Refs BasedHardware#12735
Failure-Class: none
Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Verified end to end against the head. This is a well-diagnosed fix for a real failure mode: the release lane's second Per file:
One residual note, not a blocker: "Desktop Swift Release Compile" is skipped on this PR itself (the PR lane reserves it for manifest changes), so the new single-compile path gets its first end-to-end exercise on the next notification-boundary PR or scheduled run after merge. If the wiring were ever wrong the failure is fail-closed — Excellent diagnosis; the run-log forensics in the description made this easy to verify. Because this changes release-lane CI machinery, it should get a human maintainer sign-off before merge rather than an automated one. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
The regression step's condition was asserted with a job-wide assertIn, and should_notification_release_regression appears three more times in that job — the job-level `if:`, RELEASE_REQUIRED, and the build step's env. So the assertion passed on the job body no matter what the step itself said, and deleting the step's own `if:` left it green. That is the one mistake this guard exists to catch. If the regression step ever runs without the build step having been gated, `--skip-build` finds no test bundle and the step recompiles the entire module graph — the ~28 min rebuild this PR removes, reintroduced silently. Extract the named step's own YAML and assert against that. Mutation-checked both ways: deleting the regression step's `if:` now fails, and so does dropping the env from the build step; the previous shape caught neither. Failure-Class: none Co-Authored-By: Claude Opus 5 <[email protected]>
|
Follow-up verified on 3693863: the contract assertions are now scoped the way they should have been. Also re-checked the value flow on this head: Unchanged from the earlier review: this alters release-lane CI machinery, and on notification-path PRs the release-compile check now verifies a testability-enabled release build rather than a plain one, so it should still get a human maintainer sign-off before merge rather than an automated one — leaving that with the by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Closing as superseded by #13555, which landed the same fix on main and goes further. It arrived at the same diagnosis independently — the duplicate compile behind #13481 — and the same mechanism: build the app and tests once with The shapes are not mergeable onto each other: main selects Thanks for the two verification passes; the step-scoping review is the part I would have wanted kept, and #13555's own tests already pin its wiring. |
|
Hey @aryanorastar 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
Desktop Swift Release Compileruns two sequential release compiles inside a 60-minute job, and the second one is a full rebuild that nobody intended. From run 34610634122, on a warm dependency cache:run-swift-ci.sh --release-compileBuild complete! (1887.11s)— 31.5 minrun-swift-ci.sh --release-notification-regression[124/128] Compiling Omi_Computer APIClient+AuthPolicy.swift— 27.8 min, unfinishedThat is 60m24s against a 60-minute cap, and the aggregate
Desktop Swift Build & Teststhen hard-fails onRELEASE_RESULT: cancelled— so it reads as a test failure when nothing failed a test.The second compile was never reusing the first
--release-compile's own comment says "The release-notification-regression mode below also reuses this build." It does not, and the run log says so — counting what that step compiled:Omi_Computerand the whole dependency graph, a second time. Same.build/arm64-apple-macosx/releasedirectory, so it is not a path mismatch — it is the flags. A plainswift build -c releasehas testability off;swift test -c releaseneeds it on for@testable import Omi_Computer, and that difference invalidates every module.The change
Build the test targets with testability in the first step, and let the second reuse them.
Measured locally end to end:
The second step goes from ~28 minutes (unfinished) to under 7 seconds. And the negative control is what proves the products were never shared before: the same
--skip-buildwithout the step-1 flags fails withLocal timings are on Xcode 26.6 rather than CI's pinned 16.4, so treat the minutes as indicative; the part that transfers is
--skip-buildfinding a bundle instead of not finding one.Gated, so the other triggers don't pay
The regression step only runs on notification-touching diffs, but this job also runs on main pushes, scheduled health, and
Package.swiftPRs. Those would otherwise start compiling test targets nothing executes, so both steps readshould_notification_release_regression— the same output that decides whether the regression runs at all.The contract test pins that pairing, because a mismatch is silent rather than loud: the build would quietly omit the test targets and the regression would quietly rebuild the world again. Mutation-checked — dropping the env from the build step alone fails with
1 != 2 : the release build and the regression step must both read should_notification_release_regression.The trade, stated plainly
On notification-path PRs the release-compile check now verifies a testability-enabled release build rather than a plain one. Type checking and the release-only
Sendablediagnostics the check exists for are unaffected; what differs is cross-module optimization, so it is no longer byte-identical to what a signed candidate compiles. If that matters more than the lane being runnable, the alternative is raising the job timeout — but that leaves two full release compiles in the job and it will drift back.Scope
This is the release lane only. The suite step's reds on other PRs are a different failure — every suite passes and one batch wedges for the full watchdog cap — fixed separately in #13551. Neither PR affects the other's lane.
Context and the other two options considered: #12735.
Failure-Class: none
🤖 Generated with Claude Code