Skip to content

fix(ci): the toolchain action's cache steps run on node 24, and only one job per push saves the setup-uv cache #1495

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.

Both warnings below come from the cache steps of .github/actions/setup-toolchain/action.yml. Three jobs run that action: Static Analysis (ci.yml:38), Tests & Coverage (ci.yml:58) and the scheduled Dependency Freshness job (ci.yml:272).

actions/cache v4.3.0 is a Node 20 action, and the runner forces it onto Node 24

  • action.yml:37 pins actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0, the v4.3.0 tag. That commit's action.yml:41 declares using: 'node20'.
  • All 12 recent CI Quality Gate runs warn in both quality-gate jobs: "Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/cache@0057852b…". That is 24 annotations; the latest is in the "Complete job" step of https://github.com/dan-petty/devops-cli/actions/runs/37939949186 (Node 20 deprecation).
  • In the same run, "Restore tooling caches" logs [DEP0040] The punycode module is deprecated and [DEP0169] url.parse() behavior is not standardized, and its post step logs DEP0040 again. Both come from v4.3.0's bundled dist/restore/index.js, which imports punycode and calls Url.parse. No other Node process in the run logs a deprecation.
  • It is the only node20 action pinned under .github/. Every other remote uses: resolves to a node24 or Docker action, or to a composite action whose nested actions are node24.
  • The newest release is v6.1.0 (55cc8345863c7cc4c66a329aec7e433d2d1c52a9, 2026-06-26).
    • It declares using: 'node24', and its bundle has neither punycode nor url.parse.
    • Between v4.3.0 and v6.1.0, action.yml changes only the runtime line, so path, key and restore-keys are unchanged.
    • v5 and later need runner 2.327.1 or newer; hosted runners report 2.337.0.
  • Nothing proposed the bump. Renovate has opened no pull request since the switch; fix(github): supply-chain claims made true — live Dependabot, zizmor and workflow invocation contracts #861 owns that.

Two or three jobs race to save the same setup-uv cache key

  • action.yml:23-34 runs astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d (v10.0.1) with enable-cache: true, cache-python: "true", prune-cache: "true" and cache-dependency-glob: "uv.lock". It sets neither save-cache (default "true") nor cache-suffix.
  • The composite has its own cache-suffix input to stop jobs "racing to save the same cache key" (lines 7-12), but that input only reaches the actions/cache step.
  • Static Analysis and Tests & Coverage start together with no needs: (asserted by tests/test_ci.py::test_ci_workflow_parallelizes_quality_gates). They compute the same two keys: setup-uv-2-x86_64-unknown-linux-gnu-ubuntu-24.04-3.14-pruned-py-<uv.lock hash> and the same key with -python appended.
  • On a push to main, Build & Publish Release (release.yml:51-59, setup-uv c18668ad, v10.2.0, same options) computes the same keys.
  • On a key miss, each of these jobs saves at the end. The first to finish wins, and the others warn Failed to save: Unable to reserve cache with key …, another job may be creating this cache.
  • The main push of 27cf6bd had three writers. Tests & Coverage warned in CI run https://github.com/dan-petty/devops-cli/actions/runs/37940637556, and Build & Publish Release warned in Release Orchestration run https://github.com/dan-petty/devops-cli/actions/runs/37940637538.
  • 7 of the last 12 CI Quality Gate runs carry both warnings on Tests & Coverage: 37939293848, 37937402909, 37936735848, 37935739877, 37934275283, 37927623742 and 37902704323.
  • No cache data is lost, because every writer runs the same uv sync --all-groups --all-extras. The cost is two warnings on most runs, where they bury annotations that matter.

Proposed remedy

  • Pin actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 at action.yml:37. Do not use NODE_OPTIONS=--no-deprecation or an opt-out variable: the warnings point at the stale pin.
  • Use setup-uv's documented save-cache input. The pinned v10.0.1 already has it (docs/caching.md, "Save cache").
    • Add a save-uv-cache input to the composite (default "true") and pass it to setup-uv's save-cache.
    • Set it to "false" in Tests & Coverage (ci.yml:57-63). Static Analysis, which reaches its save about 30 s after it starts, becomes the only writer. Dependency Freshness runs alone on the schedule and keeps saving.
    • Add save-cache: false to release.yml:51-59. CI's Static Analysis saves the same key on the same push to main, and a tag push's cache is scoped to the tag, which no other run reads.
  • Rejected: passing cache-suffix to setup-uv. The keys would differ, but each lockfile hash would then store three identical copies.

Acceptance criteria

  • .github/actions/setup-toolchain/action.yml pins actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0.
  • The composite passes a save-uv-cache input (default "true") to setup-uv's save-cache. Tests & Coverage sets it to "false", and release.yml's setup-uv step sets save-cache: false.
  • A test in tests/test_ci.py reads the composite, ci.yml and release.yml. It fails if more than one job that runs on the same pull_request or push event saves the setup-uv cache. It runs offline in under 1 s.
  • The pull request's CI Quality Gate run has no "Node.js 20 is deprecated" annotation and no DEP0040 or DEP0169 line. "Restore tooling caches" still restores (Cache restored from key: tooling-…).
  • A CI run of the branch whose setup-uv key misses (for example after a uv.lock change) has no Unable to reserve cache with key setup-uv- annotation, and its Static Analysis post step logs uv cache saved with key. The pull request links the run.
  • A changelog.d fragment records the change, and uv run devops ci passes.

Activity

  1. added
    type/bug
    scope/ci
    on Oct 9, 2026
  2. 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: P3-Low. The CI still passes; the Node 20 warnings are deprecation notices and the cache race only produces a redundant save warning, so nothing is broken today.
    • Value: Low. Users see no functional impact; the warnings are cosmetic until GitHub removes Node 20 support and the cache is still saved by at least one job.
    • Effort: Low. Bumping actions/cache to v6.1.0 is a one-line pin change and adding a cache-suffix or save-cache flag to one or two jobs is a few lines of YAML.
  3. added this to the v0.2.38 milestone on Oct 20, 2026
  4. dan-petty commented on Oct 21, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1768, merged into release/v0.2.38 as a36c606.

    Summary

    • Upgrade .github/actions/setup-toolchain/action.yml from actions/cache@v4.3.0 (Node 20) to actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 (v6.1.0, Node 24) to eliminate Node 20 deprecation annotations and DEP0040/DEP0169 runtime warnings.
    • Add save-uv-cache input (default "true") to .github/actions/setup-toolchain/action.yml and pass it to astral-sh/setup-uv's save-cache.
    • Set save-uv-cache: "false" on test, changed-tests, and rule-pack in .github/workflows/ci.yml and save-cache: false on setup-uv steps in .github/workflows/release.yml so only Static Analysis writes the setup-uv cache on pull_request and push events.
    • Add test_toolchain_cache_runs_on_node24_and_one_job_per_event_saves_uv_cache in tests/test_ci.py.

    6 file(s) changed.

    How it was verified

    Check runs at 0b26188:

    • Audit Defect PR Hardening: skipping
    • Prune PR DevContainer Images: pass
    • zizmor: pass
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Rule Pack Tests: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • Changed-Test Independence: pass
    • Fail-to-Pass Check: pass
    • Fail-to-Pass Self-Check: pass
    • Dependency Freshness: skipping
    • Service Image: skipping
    • DevContainer Image: skipping

    Acceptance Criteria of docs/agent/tasks/task-1495-toolchain-cache-node24-single-writer.md:

    No Acceptance Criteria section.

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