Skip to content

CI runs: device settings in the lease request, and release every lease of a run #1294

Closed

Description

@V3RON

The problem

A CI run that leases many devices has to prepare each one by hand and clean up after itself by hand. budgie's e2e suite (budgie-at/budgie#1867) shows both.

Device setup. On every lease it runs simctl through POST /v1/leases/<id>/exec:

  • defaults write .GlobalPreferences AppleKeyboards … and AppleLanguages -array en-US
  • defaults write com.apple.Accessibility ReduceMotionEnabled -bool true
  • privacy grant contacts|microphone <bundle id>
  • keychain reset before each test, so a PIN one test set can't lock out the next

The lease request has no field for any of this (src/contract/operations.ts:152-180). The Maestro setup it replaces had simulator-reduce-motion and simulator-device inputs. Since #1319 (#1203), an agent-device allocate can name a baseline (deviceBaseline / --device-baseline), so a baseline (ADR 0061) prepared with these settings covers most of this today. That still means one baseline per settings combination, set up by an operator. The per-test keychain reset is not covered.

Cleanup. A cancelled CI job never releases its leases, and the devices stay held until the TTL runs out. budgie keeps the TTL at 3 minutes, renews every minute, writes every lease id it gets to .e2e/simlock-leases.json, and releases them in an if: always() step. Leases carry no run or group id. lease.release-all is admin-only, takes no filter and has no HTTP route. An agent token can't release "everything from this run".

Who runs into this

A CI job that leases 5–10 simulators per run on a shared farm. Other jobs wait for the devices a killed run still holds.

What you would like to happen

  • Device settings: decide whether a named baseline is the answer (then document how to make one for a CI suite), or whether the lease request should also take common settings (language/locale, reduce motion, permission grants for a bundle id) without a baseline per combination. Whether a keychain reset belongs here or needs its own call is open.
  • A lease can carry a run id. A holder can release every lease of a run in one call, with the token that took them. A CI cleanup step then needs only the run id, not a file of lease ids.

Anything else

Related: #1240 (display-only label), #944 (a run command and leases tied to a process), #1202 (an operator program before first boot), #1203 (closed by #1319).

Written by an agent.

Activity

  1. added
    request:new
    on Nov 5, 2026
  2. V3RON commented on Nov 17, 2026

    @V3RON
    ContributorAuthor

    Being specified in #1633. This issue stays open until that feature ships.

    Written by an agent.

  3. V3RON commented on Nov 17, 2026

    @V3RON
    ContributorAuthor

    Split in the spec session of 2026-11-17: this request is now specified as two features.

    This issue stays open until both ship.

    Written by an agent.

  4. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    Shipped as #1633.

  5. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    Shipped as #1633.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    request:new

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions