[Proposal] Keep the device tests on the newest OS releases automatically
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reading the proposed .github/workflows/bump-os-versions.yml design alongside .github/workflows/device-tests.yml, .github/workflows/dotnet-build.yml, shared.env, and dependabot-automation.yml. The proposal also depends on #3433 and #3435, so check their resulting workflow layouts before implementation. Done means a nightly and manually runnable workflow updates safe version pins in one PR, flags changes needing a person, and only auto-approves and merges when the stated checks and safeguards pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature name
Automatic bumps of the device tests' newest OS versions
Link to discussion
None: proposed by a maintainer (TheCodeTraveler) as a follow-up to #3433 and #3435.
Progress tracker
- Android Implementation
- iOS Implementation
- MacCatalyst Implementation
- Windows Implementation
- Unit Tests
- Samples
- Documentation
Summary
Today a person bumps the device tests' Android API levels and Xcode version by hand. This proposal adds a nightly workflow, Ensure CI Always Tests Latest Operating Systems, that finds newer releases, edits the pinned versions and opens one bump PR. GitHub Actions turns on auto-merge and approves it, so it merges itself once CI passes, like Dependabot's PRs. Anything that needs a person, such as moving to a new xcode-NN runner label, goes to one issue with a ready patch and steps.
Motivation
- The newest-OS legs go stale without any failure. When Google ships a new API level or a workload needs a new Xcode, the tests keep passing on the old versions, so users on the newest OS hit the bugs before CI does.
- Xcode is the biggest pain point. Keeping Xcode current has been the most painful manual chore of this repo, so the bot makes every change it safely can instead of only reporting it.
- Xcode can break CI overnight. CI installs the newest .NET workload set on every run (device-tests.yml L589, L614, dotnet-build.yml L84-85). When a new set needs a newer Xcode, every Apple build fails with E0191 until someone edits
shared.env. - Today, people have to notice. #3435 added a checklist of these pins for reviewers and agents. It only helps when someone is already changing the workflows.
Detailed Design
What the bot keeps current
| Pin | Where (main) | Bot |
|---|---|---|
| Android API levels, 4 KB pages | device_tests_android_runtime (device-tests.yml L385-417): the newest release of every major from API 27; '37.0' is the newest Android 17 with 4 KB pages |
Bumps each major's leg; adds a leg for a new major |
| Android API level, 16 KB pages | The google_apis_ps16k leg, '37.2' (L415-417). From 37.1 on, Android minor releases ship only with 16 KB pages |
Bumps it; adds a 16 KB leg for a major whose newest release ships only that way |
| Trimmed Android legs | Take the highest google_apis level (L186-188, newest-android-api-level.py) |
Follow on their own |
| Coverage legs | API 36 and 25 in device_tests_android (L84, since #3437) |
Not touched |
| Xcode | shared.env (L18, L21); must equal the workload's Xcode major.minor (E0191) |
Bumps it once the current xcode-NN image has that Xcode as a GA release, fully rolled out |
| Apple runner label | xcode-27 in device-tests.yml (L551, L673, L905) and dotnet-build.yml (L57, L101) |
Puts a ready patch in the issue: two required checks are named after the label |
| Older iOS legs | device_tests_ios_runtime (L776-797) |
Lists what to check in the issue; the label patch adds the previous major's leg |
| iOS simulator runtime | Nothing to pin: ios.ps1 picks the image's newest runtime (L21) |
Follows the image |
| Windows, Ubuntu labels | windows-2025 (L1054), ubuntu-24.04 for the Android jobs (L73) |
Lists newer labels in the issue: a new OS image is a bigger change than one word |
Out of scope: the .NET SDK (global.json, TOOLKIT_NET_VERSION), which the repo pins on purpose.
The bot: the Ensure CI Always Tests Latest Operating Systems workflow (ensure-ci-always-tests-latest-operating-systems.yml)
- Triggers: nightly at 02:17 UTC, after new workload sets usually publish and before Dependabot's daily PRs move
main; plusworkflow_dispatchwithdry-runandreopen-rejectedinputs. Scheduled runs only on CommunityToolkit/Maui. - Jobs: unit tests → read the sources (Linux) → list the Xcode versions on each macOS label → plan → open or update the PR → update the issue. Stdlib Python under
.github/scripts/, unit-tested in the default, C and Turkish locales. - The PR (fixed branch
automation/ensure-ci-always-tests-latest-operating-systems, create-pull-request v8.1.3) holds only changes that CI can judge. Whenmainno longer needs them, the bot closes it. - The issue ("Ensure CI always tests the latest operating systems: a person needs to act", opened by GitHub Actions) lists changes a person must make (each with a patch and steps), things to check, problems reading sources and jobs that failed. Its items never hold up the PR. Closing it dismisses the items it lists.
- Removes the interim checklist that #3435 added (
.github/instructions/trimming-aot.instructions.md, and its pointers inAGENTS.mdand.github/copilot-instructions.md), and makes version-specific comments and docs version-neutral, so merged bumps don't leave them stale.
Approval and auto-merge
- Right after opening or updating the PR, GitHub Actions checks it. All of these must hold:
- the PR's author is the token's owner, and its head is the bot's branch in this repo;
- the head is one bot commit with the bot's trailer (the one this run pushed, or kept when nothing changed), on the
maincommit 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.ymlanddotnet-build.yml; - no review thread is open, and nobody turned auto-merge off.
- Then it turns on squash auto-merge, pinned to that commit, and approves the PR. GitHub merges it once the required checks pass.
Device Tests / Device Testsfails when any leg fails (L1191-1210), so every leg gates the merge. No branch protection change is needed. - GitHub Actions is not a ruleset bypass actor, so GitHub enforces every rule. The maintainer's token never merges.
- A later push needs a person. The ruleset requires approval of the most recent push, so after any push the bot's approval no longer counts.
- A person's action wins. A commit the bot didn't make stops it from updating that PR. Closing a bump PR rejects its changes until someone runs the workflow with
reopen-rejected. Turning auto-merge off holds the PR. - Problems stay contained. A source that can't be read stops only its family (Android or Xcode) for that night, and the open PR keeps that family's changes. If
mainmoves during a run, the bot publishes nothing and tries again the next night.
1. Android
- Read
sys-img/google_apis/sys-img2-4.xml, the index that the emulator action's cmdline-tools 20.0 read. It lists bothgoogle_apisandgoogle_apis_ps16kimages. - A level counts when its path is exactly
system-images;android-<level>;<tag>;x86_64, it has no codename (previews such asandroid-CANARYandandroid-37.2-beta1are also on the stable channel), and itsplatforms;android-<level>package exists. - For every major in the matrix: move its 4 KB leg to the newest 4 KB level of that major, and its 16 KB leg to the newest 16 KB level. Add a 16 KB leg when a major's newest release ships only with 16 KB pages, a 4 KB leg when a major that had only a 16 KB leg gets a 4 KB image, and legs for a new major.
- It never plans two legs with the same level and never removes a leg; a clash goes to the issue.
2. Xcode
- For the SDKs that the workflows use (
TOOLKIT_NET_VERSION, and the newest SDK ofLATEST_NET_VERSION), read the newest GA workload set from nuget.org, thenxcode.recommendedVersionfrom its iOS and Mac Catalyst manifests (WorkloadDependencies.json, in a 33 KB package). No Mac and no workload install is needed for that. - A job on each macOS label lists the Xcode folders. Only a real folder named like
Xcode_27.2.appwith a non-beta license is GA: betas and RCs (Xcode_27.3_beta.app) also answer asXcode_27.3.appthrough symlinks. - The bot changes Xcode only when the label's fully rolled-out build has it. GitHub's image rollouts take 1-6 days with mixed builds.
- Same label: edit
shared.envin the PR. - New major: the issue gets a patch that moves to
xcode-NNand adds a leg for the previous iOS major, with the steps: a repo admin renames the required checksBuild Library (xcode-27)andBuild Sample App using Latest .NET SDK (xcode-27)right before the merge, and another maintainer approves. - Not GA on any image yet: listed in the issue.
3. Runner labels
- Read the label column of the runner-images README table. Its
-latestlabels and badges lag reality, so the bot ignores them:ubuntu-latestalready runs Ubuntu 26.04, and thexcode-27row still says preview although the image is GA. - List in the issue a newer
ubuntu-NN.04orwindows-NNNNlabel, and a pinned label that disappears or is marked deprecated.
Token
GITHUB_TOKENcan't open the PR. It can't push files under.github/workflows/(where every pin lives), and PRs it opens start no CI.- Decided: a maintainer's classic personal access token (scopes
public_repoandworkflow) in the secretENSURE_CI_ALWAYS_TESTS_LATEST_OPERATING_SYSTEMS_TOKEN, stored in the environmentensure-ci-always-tests-latest-operating-systems, which onlymaincan use. A fine-grained token scoped to this repo would be narrower, but CommunityToolkit requires an org owner's approval for it. - It's used only to check itself (owner, scopes, push access, expiry) and to push the branch and open the PR. GitHub Actions (
GITHUB_TOKEN) approves and merges. - Without a usable token, or when the push fails, the patch goes into the issue. The bot warns 14 days before the token expires.
Usage Syntax
The bump PR:
Title: Update the device tests to the latest operating systems: Android 37.3 (16 KB), Xcode 27.3
The nightly ensure-ci-always-tests-latest-operating-systems.yml found newer OS versions (run link). CI on this PR shows whether they work. GitHub Actions approves it after checking that it holds exactly these changes, and it merges itself when the required checks pass.
| Pin | File | Was | Now | Source |
|---|---|---|---|---|
| Android 17, 16 KB leg | device-tests.yml | '37.2' | '37.3' | sys-img2-4.xml |
| Sample Xcode | shared.env | 27.2 | 27.3 | workload set 11.0.100.2; Xcode 27.3 GA on xcode-27 |
The issue, when something needs a person:
Title: Ensure CI always tests the latest operating systems: a person needs to act
Changes a person must make:
- Move the Apple jobs from xcode-27 to xcode-28. Workload set 11.0.200.1 needs Xcode 28.0, which only xcode-28 has as a GA release.
1. Apply the patch below on a new branch and open a PR.
2. Right before merging, a repo admin renames the required checks named after xcode-27.
3. Another maintainer approves the PR.
Things to check:
- ubuntu-26.04 (GA) is the newest Ubuntu runner label; the Android jobs pin ubuntu-24.04.
Run it by hand from Actions > Ensure CI Always Tests Latest Operating Systems > Run workflow, or:
gh workflow run ensure-ci-always-tests-latest-operating-systems.yml -R CommunityToolkit/Maui -f dry-run=true
Drawbacks
- One more workflow, and a token tied to a person. It expires, and its owner can bypass the rules, so the token never merges and only
maincan use it. - Auto-merge trusts CI. A bump that passes CI but changes untested behavior would merge unseen; the allow-list keeps it to version pins.
- Like Dependabot's merges, a bump merged by GitHub Actions starts no Build run on
main; the next push builds it. - Google's XML, NuGet's JSON and runner-images' Markdown can change. A parse failure stops that family and is listed in the issue.
- A bump PR can fail CI for reasons outside the toolkit, such as an emulator quirk. Someone has to investigate; that's the point of the bot, but it's still work.
Alternatives
- The reviewer checklist from #3435 (interim, removed by this proposal): nothing is checked between workflow changes.
- A GitHub App token (short-lived, not tied to a person): needs an org owner to create and own the App. Not chosen.
- Dependabot's
dotnet-sdkecosystem: it bumps only the SDK inglobal.json(changelog), not Xcode, API levels or labels. - Renovate regex managers (docs): a second dependency bot beside Dependabot, and it can't tell which Xcode the workload needs.
- Do nothing: the newest-OS legs drift until someone notices.
Unresolved Questions
- Pin the workload set version and let the bot bump it too, so a new set can't break CI in the hours before the bump PR merges?
- Android matrix size: the matrix grows by about one leg a year. Should the oldest leg go when the app's minimum rises, and should the coverage job (API 36) follow the newest level?
- Lingua principale
- C#
- Stelle
- 2.7k
- Fork
- 502
- Merge medio
- 11h 10m
- PR unite (30g)
- 50
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CommunityToolkit/Maui
-
new proposal
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
CommunityToolkit/Maui#3449 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug unverified
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
CommunityToolkit/Maui#3443 ·
I maintainer di solito rispondono entro 1 giorno
-
new proposal
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
CommunityToolkit/Maui#3436 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] The popup positioning changing if SetShouldUseStatusBarBehaviorOnAndroidModalPage is trueApertabug unverified
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
CommunityToolkit/Maui#3425 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug unverified
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
CommunityToolkit/Maui#3411 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CommunityToolkit/Maui
Issue simili
-
area: core bug help wanted ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ZaidX88/sluice#265 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: remote bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Install a C# EnvironmentAperta📅 Sprint 4 Module-Tools Setup Submit:None 🦔 Size Tiny
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
CodeYourFuture/Module-Tools#712 ·
-
:watch: Not Triaged dotnet-fundamentals/svc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
A: Mapping P3: Standard T: New Feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
space-wizards/space-station-14#46878 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno