ci: run the full suite on main every 3 hours and track a red main

Merged
TE
2mo ago
+539-0

Problem

With CI_PULL_REQUEST_SUITE=compile-only, pull_request CI runs only compile admission unless a PR has the full-ci label. That policy relied on the merge queue running the full suite (app-host shards, package tests and so on) before landing. The queue is off during the CI cleanup, and ci.yml has no push or schedule trigger for main, so the full suite on main never runs. Example: #13196 merged Cloud product changes that broke about 30 app-host tests, and those shards were skipped.

The variable is currently empty, so PRs run the full suite today. This schedule matters most while compile-only is set. It still catches anything that change-area routing skips on a PR.

What this adds

.github/workflows/ci-main-full-suite.yml, which does not change ci.yml:

  • Schedule: runs at 23 */3 * * * and can also be started by workflow_dispatch (a force input overrides the skip). It runs gh workflow run ci.yml --ref main. Every workflow_dispatch CI run routes every area and runs the full suite (choose_ci_suite.py / detect_ci_change_areas.py / web_subareas.py), on the same runner vars as existing dispatch and merge-group runs. The workflow dispatches CI instead of calling it as a reusable workflow for two reasons. First, the app-host product transport only trusts runs whose path is ci.yml and whose event is pull_request, merge_group or workflow_dispatch. Second, CI's routing stays untouched this way.
  • Skip: a Linux job of about 10 seconds (scripts/ci/main_full_suite.py gate) skips the dispatch if main's HEAD already has a CI dispatch run on main that is queued, running, green or red. A cancelled run doesn't count, and an API error dispatches anyway.
  • Cost: at most 8 full-suite runs a day, and none while main is unchanged.
  • Concurrency: dispatched runs use CI's existing CI-refs/heads/main group, which never cancels an in-progress non-PR run. This workflow's own jobs also use cancel-in-progress: false.
  • Failures: this follows the pattern of nightly.yml's report-nightly-failure / close-nightly-failure-issue jobs, with one issue per label. A red run opens or comments once on a "Main full-suite CI is red" issue (label main-full-suite-failure) with the run link and the failing jobs. The next green run closes it. Reporting is triggered by workflow_run on CI completion, and each scheduled run also re-syncs from the newest result. Reports are idempotent because a run URL that is already on the issue is skipped.

Tests

  • New tests/test_ci_main_full_suite.py covers the skip logic, suite choice for workflow_dispatch and schedule, issue open/comment/close, and the workflow wiring and SHA pins. It is registered as a ci guard step in ci-guards.yml, and the script and workflow are added to PATH_OWNERS.
  • These pass locally: test_ci_linux_guard_routing.py, test_ci_guard_workflow_structure.py, test_ci_change_areas.py, test_ci_reusable_workflow_permissions.py, test_cleanup_stale_runs.py, all other tests/test_ci_*.py, and test_ci_self_hosted_guard.sh. The exception is test_ci_workload_profiles.py, which also fails on unmodified main on macOS.
  • actionlint passes with .github/actionlint.yaml.

🤖 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

Adds a scheduled workflow that runs the full CI suite on main every 3 hours, since PRs can run compile admission only and the merge queue is off, leaving app-host shards and package tests unrunnable on main.

  • Dispatches ci.yml on main unless that commit already has a queued, running, green, or red dispatch run, and forces a dispatch when main's HEAD can't be read.
  • Keeps a single "Main full-suite CI is red" issue that opens on failure and closes on the next green run.
  • Adds scripts/ci/main_full_suite.py with skip and issue-sync logic, plus tests wired into ci-guards.yml.

Summary by CodeRabbit

  • Chores

    • Added scheduled full-suite checks for the main branch, with manual triggering available when needed.
    • Added automated status reporting for full-suite results, including failure tracking and recovery updates.
    • Added safeguards to prevent duplicate checks for the same commit.
  • Tests

    • Expanded validation for workflow scheduling, run selection, dispatch behavior, reporting, and failure handling.