Skip to content

fix(ci): ci jobs run on a named ubuntu-24.04 runner and always use uv's managed python, never the runner's own python #1494

Closed

Description

@dan-petty

Filed at the owner's request from the 2026-10-09 review of GitHub Actions warnings and notices.

Problem

Checked at release/v0.2.32 (27cf6bd). main and the tip of release/v0.2.31 (a6ac3f0) have the same tree.

  • Every job of ours shows the notice "The ubuntu-latest label will migrate to Ubuntu 26 beginning October 19, 2026" ([Ubuntu] ubuntu-latest label will use Ubuntu 26.04 in November 2026 actions/runner-images#14748). Examples:

    GitHub moves the label between October 19 and November 19. During that month, any job may land on either image.

  • Nine runner selections use ubuntu-latest: ci.yml:28,48,72,170,262, release.yml:25,167, cleanup-devcontainer.yml:34 and codeql.yml:30. The last one is the non-swift arm of a template expression, and the matrix has only actions and python. Today they all resolve to ubuntu-24.04, image 20261004.327.1 (run 37939949186, "Set up job").

  • Confirmed break: on 26.04, CI stops using the pinned Python.

    • Both setup-uv steps pass python-version: "3.14": .github/actions/setup-toolchain/action.yml:24-34 (astral-sh/setup-uv 20cfd1bf, v10.0.1) and release.yml:52-59 (c18668ad, v10.2.0). setup-uv exports the value as UV_PYTHON=3.14 (src/setup-uv.ts:228-230), and that overrides .python-version (3.14.7).
    • On 24.04 the system Python is 3.12.3, so uv installs its own CPython. Run 37939949186 runs cpython-3.14.7 from _temp/uv-python-dir, the same version that .python-version and the devcontainer use.
    • The 26.04 image ships Python 3.14.4 as /usr/bin/python3 (Ubuntu2604-Readme, image 20260927.149.1).
    • setup-uv's cache key includes the OS version (setup-uv-2-…-ubuntu-24.04-3.14-…; src/cache/restore-cache.ts:102-105). So the first 26.04 run of each job starts with no managed Python, and uv's default preference takes a matching system interpreter before it downloads one.
    • Reproduced with uv 0.12.16, offline, with an empty UV_PYTHON_INSTALL_DIR and a system python3.14 on PATH. UV_PYTHON=3.14 uv sync prints "Using CPython 3.14.8 interpreter at: /usr/bin/python3.14", even though .python-version says 3.14.7. With UV_MANAGED_PYTHON=1, uv accepts only a managed install.
    • setup-uv's post step then skips the Python cache ("no managed Python installation was found … set UV_PYTHON_PREFERENCE=only-managed", src/save-cache.ts:96-101). No managed Python is ever cached, so every later run also stays on Ubuntu's 3.14.4 build, while the pin and the devcontainer use 3.14.7.
  • Checked and not affected:

  • Not yet run on 26.04: Docker Engine goes from 28.0.4 to 29.4.2 (Buildx is 0.37.x on both). These steps use the daemon:

    • DevContainer Image: devcontainers/ci 513af61f (v0.3.1900000450), on the runner's default docker driver;
    • the Service Image build, smoke test and Trivy scan in ci.yml and release.yml: setup-buildx f87e5991 (v4.4.1), build-push-action c3c9e263 (v7.4.0), trivy-action ed142fd0 (v0.36.0, Trivy v0.70.0).

Proposed remedy

  1. Set UV_MANAGED_PYTHON: "1" in the workflow-level env: of ci.yml and release.yml, the two workflows that run setup-uv. It reaches the composite's uv sync and every later uv run step. uv then uses only its own CPython, on any image. .python-version, the devcontainer and local runs do not change. setup-uv's warning names the older spelling, UV_PYTHON_PREFERENCE=only-managed; uv 0.12.16 documents UV_MANAGED_PYTHON.

  2. Replace all nine ubuntu-latest selections with ubuntu-26.04, and make codeql.yml:30 a plain label. Merge this before October 19, so no job runs during the mixed rollout and every later image change goes through review.

  3. Validate on 26.04 before the next release pull request merges:

    • Static Analysis, Tests & Coverage and CodeQL run on the pull request itself.
    • A workflow_dispatch of CI Quality Gate on the branch runs Service Image (build, smoke test, Trivy).
    • release.yml's Build & Publish Service Image builds when the cut sets the release branch's version. DevContainer Image runs on the release pull request into main, because ci.yml is one of its image-content paths.

    If a job fails on 26.04 and needs more than a setting to fix, move it to ubuntu-24.04 with a comment naming its follow-up issue, so it does not hold the other jobs back.

Acceptance criteria

  • No workflow job runs on ubuntu-latest. Each names ubuntu-26.04, or ubuntu-24.04 with a comment linking its follow-up issue.
  • ci.yml and release.yml set UV_MANAGED_PYTHON: "1". A test next to test_github_workflows_caching_configuration in tests/test_ci.py fails when a workflow that uses setup-uv lacks it, or when a job's runs-on is a -latest label.
  • On ubuntu-26.04, Static Analysis and Tests & Coverage run CPython 3.14.7 from setup-uv's managed directory. On a key miss, setup-uv saves the -python cache, and no "Skipping Python cache save" warning appears.
  • Tests & Coverage passes on ubuntu-26.04 with the same skip count as on 24.04 (24 at 27cf6bd), or the pull request explains each difference.
  • Service Image (build, smoke test, Trivy) passes on ubuntu-26.04 from a CI Quality Gate workflow_dispatch on the branch. DevContainer Image and release.yml's Build & Publish Service Image pass on it before the next release pull request merges.
  • This repository's own workflow runs no longer show the "ubuntu-latest label will migrate" notice.
  • uv run devops ci passes.

Update 2026-10-09: re-scope before building (owner decision)

The assessment and its challenge found that this item can't pass its own last criterion as written: actionlint 1.7.12 (devops ci, the pre-push hook) rejects ubuntu-26.04 as an unknown runner label (9 errors), and upstream actionlint has released nothing since 2026-03-30 with its 26.04 PRs unmerged. The owner chose:

Activity

  1. added
    type/bug
    scope/ci
    on Oct 9, 2026
  2. added this to the v0.2.32 milestone on Oct 9, 2026
  3. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.32 by the owner, 2026-10-09: it must land before GitHub starts moving ubuntu-latest to Ubuntu 26.04 on 2026-10-19.

  4. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. The break is confirmed but time-bounded (Oct 19–Nov 19, 2026); CI is not failing today, so it is urgent but not a current outage.
    • Value: High. Once the label migrates, every CI job silently uses a different Python build than the pin and devcontainer, risking subtle test and build divergence.
    • Effort: Low. The remedy is setting one environment variable in two workflow files and replacing nine 'ubuntu-latest' strings with a pinned image tag.
  5. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Admitted to v0.2.32: after v0.2.32 started, only a critical fix can join it. A person can place it in a planned release, and that placement stands. (devops roadmap reprioritize)

  6. changed the title [-]fix(ci): ci jobs run on a named ubuntu-26.04 runner and always use uv's managed python, never the runner's own python 3.14[/-] [+]fix(ci): ci jobs run on a named ubuntu-24.04 runner and always use uv's managed python, never the runner's own python[/+] on Oct 9, 2026
  7. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1507, merged into release/v0.2.32 as 293fcac.

    Summary

    • All nine runs-on selections name ubuntu-24.04 instead of ubuntu-latest, each with a comment linking fix(ci): ci jobs move from ubuntu-24.04 to ubuntu-26.04 once the workflow linter accepts the label #1501, the move to ubuntu-26.04:
      • ci.yml ×5, release.yml ×2, cleanup-devcontainer.yml ×1, codeql.yml ×1;
      • codeql.yml's selection becomes a plain label (its matrix has only actions and python).
      • A named label is not migrated when GitHub moves ubuntu-latest to Ubuntu 26.04 from 2026-10-19, so no job switches image without review.
    • ci.yml and release.yml set UV_MANAGED_PYTHON: "1" in their workflow-level env.
      • Why: setup-uv exports UV_PYTHON=3.14, and on an image whose own Python is a 3.14, uv would take that interpreter over the managed 3.14.7 that .python-version pins.
      • Effect: uv now uses only its own CPython builds. Explicit interpreter paths still work.
      • UV_PYTHON_PREFERENCE is not also set, because uv 0.12.16 refuses to run with both.
    • Why ubuntu-24.04 and not ubuntu-26.04: actionlint 1.7.12, run by devops ci and the pre-push hook, rejects the ubuntu-26.04 label. The move to 26.04 and its checks on 26.04 (managed Python and its cache save, skip count, Docker 29 image builds, Trivy) are in fix(ci): ci jobs move from ubuntu-24.04 to ubuntu-26.04 once the workflow linter accepts the label #1501. Replacing actionlint is chore(deps): the workflow linter comes from a maintained source that knows current runner labels, replacing the stalled actionlint #1119.
    • New test test_github_workflows_name_their_runner_and_use_managed_python in tests/test_ci.py. It fails when:
      • a job's runs-on is a -latest label;
      • a workflow that reaches setup-uv, directly or through a local composite action, lacks UV_MANAGED_PYTHON: "1".
    • Also adds…

    7 file(s) changed.

    How it was verified

    Check runs at c709181:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Tests & Coverage: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1494-ci-named-runner-managed-python.md:

    • No workflow job runs on ubuntu-latest. All nine selections name ubuntu-24.04 with a comment linking fix(ci): ci jobs move from ubuntu-24.04 to ubuntu-26.04 once the workflow linter accepts the label #1501, and codeql.yml's is a plain label.
    • ci.yml and release.yml set UV_MANAGED_PYTHON: "1" in their workflow-level env, which reaches the composite action's uv sync and every later uv run. test_github_workflows_name_their_runner_and_use_managed_python in tests/test_ci.py, next to test_github_workflows_caching_configuration, fails when a job's runs-on is a -latest label, or when a workflow that reaches setup-uv, directly or through a local composite action, lacks the setting. It failed on the tree before the change with the nine jobs, and fails when ci.yml's setting is removed.
    • This repository's workflow runs no longer show the "ubuntu-latest label will migrate" notice, which GitHub shows for jobs that request ubuntu-latest. Runs on main (Renovate pull requests into main, the schedules, dispatches) use main's workflows and show it until v0.2.32's release pull request merges.
    • actionlint 1.7.12 reports 0 errors on the workflows, and uv run devops ci passes.
    • The move to ubuntu-26.04 and its checks on 26.04 (managed CPython 3.14.7 and the -python cache save, the Tests & Coverage skip count, Docker 29 builds of the Service and DevContainer images, Trivy): moved to fix(ci): ci jobs move from ubuntu-24.04 to ubuntu-26.04 once the workflow linter accepts the label #1501, which waits for the workflow linter to accept the label.
  8. added a commit that references this issue on Oct 9, 2026
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

    scope/citype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions