fix(ci): keep Desktop Swift main health current - #12285
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Verified against the linked issue and the current head. This implements exactly the periodic-health option scoped in #12275 — a daily 05:17 UTC scheduled run of the existing Desktop Swift workflow plus a path-independent manual-dispatch recovery hatch — while ordinary push/PR routing stays untouched. Checks on this head all passed, including the real Desktop Swift Static & Test Contracts job that executes the new contract tests.
Per-file notes:
scripts/pre_push_ci_prediction.py— the newFULL_DESKTOP_HEALTH_EVENTSset and theresolve_impactbranch force-selectingdesktop-ci-only/desktop-swift-tests/desktop-swift-release-compileforscheduleandworkflow_dispatchis clean and well-commented. I traced every consumer: theshould_run*outputs are read only bydesktop-swift-ci.yml; the other detect-changes workflows that declareworkflow_dispatch(backend-hermetic-e2e.yml,backend-unit-tests.yml) ignore those outputs, and the localscripts/pre-pushhook passes no--event(defaults tolocal) — so the runner-saving skip for ordinary pushes and PRs is preserved everywhere else..github/workflows/desktop-swift-ci.yml— theschedule: cron "17 5 * * *"trigger reuses the same pinned Xcode 16.4 runner, stable check names, and bounded timeouts (90/60 min); the concurrency group (desktop-swift-${{ github.event.pull_request.number || github.sha }}, cancel-in-progress only for PRs) means a scheduled run cannot cancel exact-SHA push evidence. No new permissions, third-party actions, or secret surfaces..github/scripts/test_pre_push_ci_prediction.py— replacingtest_event_does_not_change_the_resolved_plan(whose blanket invariant is now intentionally false) withtest_path_filtered_events_keep_unrelated_changes_off_macosandtest_authoritative_main_health_events_ignore_changed_pathsguards both halves of the boundary: authoritative events cannot be path-filtered, and ordinary events keep the hosted-macOS saving..github/scripts/test_desktop_swift_ci_contract.py—test_current_main_health_is_independent_of_the_last_commit_pathspins the cron literal andworkflow_dispatchtrigger in the workflow text and asserts the forced phases viaresolve_impact, so silently dropping the schedule fails contracts..github/failure-classes/FC-path-filter-masks-default-branch-health.json— follows the existing failure-class record schema exactly and points at the two guard artifacts.
One operational consequence worth a maintainer's eyes (intended, but new): after this lands, a desktop regression that slips through a path-filter skip (the #12275 SILGen scenario) will turn main's Desktop Swift checks red on the next daily run and stay red daily until fixed, where before they silently read green. That is the point of the fix — but it changes what "main is green" means day to day and adds one daily bounded macOS runner spend, so it deserves a maintainer sign-off on the tradeoff rather than an automated one.
Nice work — the regression tests read as written-first and the boundary is guarded on both sides. Leaving for human maintainer review as a CI-gating change (workflow-review applied); @Git-on-my-level is already the requested reviewer.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Yes @undivisible — still in progress, and ready for maintainer approval. The head is unchanged at
The guard tests pin both sides of that boundary, and all substantive checks on this head are green, including Desktop Swift Static & Test Contracts, Release Compile, and Build & Tests. @Git-on-my-level need human response: please convert the completed code-owner review into an approval if the stated tradeoff is acceptable. That is the only remaining merge gate. |
Summary
workflow_dispatcha real path-independent recovery hatch for Desktop SwiftFixes #12275.
Problem
Desktop Swift CI was only authoritative for commits whose own diff selected the desktop lanes. A later backend/docs-only push could leave every Desktop Swift compile job skipped while the workflow still appeared green, so the last visible result on
maindid not prove that the current tree compiled.This happened after the Xcode 16.4 SILGen regression: run 33031674675 completed successfully while
Desktop Swift Static & Test Contracts,Desktop Swift Release Compile, and the stableDesktop Swift Build & Testsaggregate were all skipped.The documented manual recovery path had the same blind spot. It accepted
workflow_dispatch, but resolved exactly the same final-commit diff as a push, so dispatching a backend-only HEAD could not re-mint Desktop Swift evidence for that SHA.What changed
pre_push_ci_prediction.pynow distinguishes two authoritative health events from normal diff-scoped events:scheduleandworkflow_dispatchalways select the Desktop Swift debug test and release-compile phases.push,pull_request, and the local hook remain path-filtered, so an ordinary backend-only change still selects no macOS jobs.The existing workflow now runs at
05:17 UTCdaily. It reuses the same pinned Xcode runner, caches, timeouts, stable check names, and aggregate verdict already used for selected desktop changes; no parallel workflow or duplicate implementation was added.Regression proof
The tests were added first. On the old selector, the new authoritative-event regression failed for both
workflow_dispatchandschedulebecausedesktop-ci-onlywas absent.After the fix:
OMI_PR_BODY_FILE=/tmp/omi-12275-pr-body.md make preflight— all 21 selected repository checks passedpython3 .github/scripts/test_pre_push_ci_prediction.py— 26 passedpython3 .github/scripts/test_desktop_swift_ci_contract.py— 27 passedpython3 .github/scripts/test_desktop_manifest_routes.py— 4 passedbash scripts/run-workflow-apt-network-bounds.sh— 6 passedpython3 .github/scripts/check_runner_cost_policy.py— passedpython3 .github/scripts/check_deployment_secret_boundary.py --base origin/main— passedactionlint -shellcheck "" .github/workflows/desktop-swift-ci.yml— passed, matching the repository workflow lint configurationDirect production-selector probes with an empty changed-file list produced:
workflow_dispatchschedulepushRunner impact
Normal PR and push cost is unchanged. The only new recurring allocation is one daily run of the two existing bounded
macos-15jobs (90-minute verify ceiling, 60-minute release ceiling); the release lane restores the default-branch build cache. Manual dispatch only allocates those jobs when an operator invokes it.Failure class
Failure-Class: new
This adds
FC-path-filter-masks-default-branch-health. Its reusable guard artifacts assert both halves of the boundary: authoritative health events cannot be path-filtered, and unrelated ordinary pushes remain cheap.Product invariants affected
none