Skip to content

Ensure CI Always Tests the Latest Operating Systems - #3452

Open
TheCodeTraveler wants to merge 22 commits into
mainfrom
Add-Nightly-OS-Version-Bump-Bot
Open

TheCodeTraveler wants to merge 22 commits into
mainfrom
Add-Nightly-OS-Version-Bump-Bot

Conversation

@TheCodeTraveler

@TheCodeTraveler TheCodeTraveler commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description of Change

Adds the nightly Ensure CI Always Tests Latest Operating Systems workflow (.github/workflows/ensure-ci-always-tests-latest-operating-systems.yml). It keeps the device tests on the latest Android API levels and Xcode, so nobody bumps them by hand again (design: #3438).

  • Android: reads Google's system-image index; bumps each major's 4 KB leg and the 16 KB (google_apis_ps16k) leg, and adds legs for a new major.
  • Xcode: reads the Xcode that the newest iOS and Mac Catalyst workload sets require (E0191), and bumps shared.env once the xcode-NN image has that Xcode as a GA release, fully rolled out.
  • Runner images: reports newer ubuntu-* and windows-* labels, missing or deprecated labels, and runtime changes for the older iOS legs.
  • One bump PR on automation/ensure-ci-always-tests-latest-operating-systems, opened with a maintainer's token. GitHub Actions turns on squash auto-merge and approves it after checking that it holds exactly the planned pin changes. CI is the gate.
  • One issue for anything a person must do, with a ready patch (for example, moving to a new xcode-NN label renames required checks). Closing it dismisses its items, except problems that stop the bot: an unreadable source, a failed job or an unusable token. Those come back and turn the run red until fixed, so a closed issue never silently turns the bot off. A pending move to a new xcode-NN label also comes back, with the run green, because Xcode stops moving until someone does it.
  • Script tests run on every pull request, with no path filter, so a change the bot could no longer edit fails its PR. After merging, add Run the unit tests of the scripts as a required check.
  • Replaces the interim "Newest OS versions" checklist (trimming-aot.instructions.md, AGENTS.md, copilot-instructions.md) with a list in eng/devices/README.md: what the bot changes, what it puts in its issue, and what a person must still check. Makes version-specific comments and docs version-neutral, so merged bumps don't leave them stale.

Linked Issues

PR Checklist

Additional information

Setup (done): the environment ensure-ci-always-tests-latest-operating-systems (deployment branches: main only) holds ENSURE_CI_ALWAYS_TESTS_LATEST_OPERATING_SYSTEMS_TOKEN, a classic token (public_repo, workflow). Only the bot's job on main can read it. One branch protection change, after merge: add Run the unit tests of the scripts as a required check. The required Device Tests / Device Tests check already fails when any leg fails.

Tested on:

  • Unit tests: 818 tests green on Python 3.9.6 (macOS) in the default, C and tr_TR.UTF-8 locales; actionlint clean on the bot's workflow (the other two workflows' findings are unchanged from main).
  • Fork end-to-end on TheCodeTraveler/CTM: all 16 scenarios pass on 30bcb6d. The fixes after it (any action SHA, the label move after a close, no path filter) have unit tests only. The order check proves GitHub Actions merges only after the required check is green, auto-merge is on and the bot has approved. GitHub Actions is not a bypass actor.
  • Earlier e2e runs found these, all fixed here:
    • A token secret with a line break crashed the bot.
    • Closing the issue also dismissed an unusable token.
    • The "main moved" note didn't show on the run page.
    • GitHub keeps an approval through a push that leaves the diff unchanged. That is safe (the same approved change merges), and the docs now say so.
  • Also new: a macOS runner command that times out gets one retry, because a cold simctl timed out once.
The 16 end-to-end scenarios
# What it proves
E1 Dry run: reads, lists and plans; publishes nothing
E2 Opens the issue; a person's close dismisses its items
E3 Opens a bump PR, turns on auto-merge and approves; GitHub merges it after the required check
E4 Nothing to do after the merge: no PR, no issue item
E5 Failed checks keep the PR open and add an issue item
E6 Closes its own PR when the base already has the change
E7 A person's commit on the bot branch stops the bot from updating or approving it
E8 A bump that renames a required check goes to the issue with a patch, not a PR
E9 A move to a new Xcode runner label goes to the issue with a patch
E10 An unreadable pin file: no PR, an issue item, the run turns red
E11 A failed job: an issue item, the run turns red
E12 main moves mid-run: nothing is published, and the run page says why
E13 A person's push that changes the diff blocks the merge
E14 An open review conversation blocks the approval; once resolved, the next run approves and GitHub merges
E15 Order: check green, then auto-merge on, then approval, then merge by GitHub Actions
E8b A PR a person closed stays closed unless the workflow runs with reopen-rejected
For maintainers: approval, merging and the first runs
  • Approval conditions (all must hold): the PR's author is the token's owner; its head is the bot's branch in this repo, one bot commit (with the Generated-by trailer) on the main commit the run planned from; the diff is exactly the planned changes, passes a line-by-line allow-list, only raises Android levels, and touches only shared.env, device-tests.yml and dotnet-build.yml; no open review thread; auto-merge not turned off by a person.
  • GitHub Actions turns on auto-merge, then approves. It is not a ruleset bypass actor, so GitHub enforces every rule. The token only checks itself, pushes the branch and opens the PR; it never merges.
  • A later push is checked: a push that changes the diff needs a new approval (a person's, or the bot's after it re-checks its own rebuild). A push that leaves the diff unchanged keeps the approval, and what merges is still exactly the approved change once CI passes on the new head. expectedHeadOid only guards turning auto-merge on.
  • Like Dependabot's merges, a bump merged by GitHub Actions starts no Build run on main; the next push builds it.
  • First live runs after merge: a dry-run dispatch, then one watched run. The first real run opens the issue with ubuntu-26.04 as a thing to check (the Android jobs pin ubuntu-24.04 on purpose); closing the issue dismisses it.
  • eng/devices/README.md L320 (Android decoder wording) changes after CameraView: Report Exceptions From MediaCaptureFailed Handlers Through ErrorOccurred, and Fix an Android NativeAOT Crash #3450 merges, which edits the same line.
  • No Copilot review requested (credits return 2026-11-30).
Breaking changes and behavior changes (for the GitHub Release notes)

None: CI, scripts and docs only; no package changes.

🤖 Generated with Claude Code

TheCodeTraveler and others added 16 commits November 21, 2026 13:17
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own)

The Sonnet fixer was stopped mid-round; these edits are unreviewed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…a timed-out runner command

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… refusal text, auto_merge on a refusal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub keeps the bot's approval through a push that leaves the diff unchanged,
so resolving the conversations merges the PR without another bot run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TheCodeTraveler
TheCodeTraveler marked this pull request as ready for review November 23, 2026 05:32
TheCodeTraveler and others added 6 commits November 23, 2026 02:14
…e shared.env comments

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er a close, run the script tests on every PR

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

[Proposal] Keep the device tests on the newest OS releases automatically

1 participant