Skip to content

ci: finish the emSign fixes: Node.js downloads, setup-uv checksums, hash-checked build backends (#255) - #256

Merged
JuroOravec merged 16 commits into
mainfrom
chore/emsign-followups
Oct 22, 2026
Merged

JuroOravec merged 16 commits into
mainfrom
chore/emsign-followups

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Implements #255, the follow-ups to #253. This PR is stacked on #253: its base is chore/emsign-ca-distrust, so the diff shows only the follow-up work. After #253 merges, change the base to main in the web UI.

What changes

1. Node.js-based downloads

  • Node.js has a fix now. Node.js 22.23.4, 24.22.1 and 26.12.1 (released 2026-10-21) drop "emSign ECC Root CA - G3", the only affected emSign root.
  • VS Code publish workflow:
    • pins Node.js 22.23.4 and checks that its bundled list has no G3 (fingerprint check);
    • publishes to Open VSX with an ovsx 1.1.1 pinned in pnpm-lock.yaml, instead of pnpm dlx. ovsx reuses the locked vsce 3.9.2, and the VSIX contents are unchanged.
  • Playwright bundles an older Node.js. A new local action, .github/actions/drop-emsign-g3, refreshes ca-certificates when the runner's system list still has G3, and fails the job if it remains.
    • Every playwright install runs after it with NODE_OPTIONS=--use-openssl-ca and SSL_CERT_FILE, so Playwright's Node.js uses only the refreshed system list. NODE_USE_SYSTEM_CA would only add the system list to the bundled one.
    • The two jobs that deliberately skip the checkout run the same check inline.
  • Agent-usage image: uses node:22.23.4-bookworm-slim and runs Playwright's download on that Node.js.

2. setup-uv 10.3.2

  • All 48 setup-uv steps, including the starters' and demos' check.yml, use commit 07a047e6 with prune-cache: true.
  • setup-uv 7.6.0 checked downloads only against a table that ends at uv 0.10.10, so uv 0.13.5 was installed unchecked.
  • Every workflow now pins uv 0.13.5. The latest jobs move to the pin too, because of the experimental uv feature in item 3.

3. Hash-checked build backends

  • The root pyproject.toml sets require-build-hashes, plus hashed build-constraint-dependencies for setuptools, maturin and tomli. These are generated by scripts/build_constraints.py and recorded in uv.lock.
  • uv stops on a hash mismatch in uv build, uv sync and uv run. The --no-config builders, the Pyodide build and the examples' --editable-root install pass the exported pins themselves.
  • This needs uv 0.13.5 or later. An older uv cannot read the root pyproject.toml. scripts/check.py now stops early with a clear message, and the contributor docs state the minimum.

4. Validators and tests

  • toolchain: every setup-uv step must use the reviewed commit, the exact uv pin and prune-cache: true, including steps in composite actions. Every playwright install must come after the G3 action, or an exact inline copy of it, and must set both variables.
  • build_backend_pins: every [build-system] requires must be covered by a hashed pin.
  • script_invocation: a guarded from scripts import X must fall back to the same module.

5. Docs

  • The blog post now lists what changed and what remains open.
  • docs/codebase.md, CONTRIBUTING.md, the development docs and the agent-usage README are updated.

Still open

  • JavaScript actions run on the runner's own Node.js until GitHub releases a runner with Node.js 24.22.1.
  • PyO3/maturin-action downloads maturin, and pip-installs cffi, patchelf and sccache, without hashes.
  • uvx tool environments (pyodide-cli, pyodide-build, twine) are not hash-checked: uvx ignores hashes.
  • Dependabot cannot maintain the hashed build-backend pins. A Dependabot PR that raises a build-backend floor stays red until someone runs python scripts/build_constraints.py update && uv lock. The validator message names that command.

Checks

  • scripts/check.py --profile full passed (all 21 phases, with coverage) with uv 0.13.5.
  • Docs build-check: 0 errors, 0 warnings.
  • mypy --platform linux on the gate's targets: clean.
  • Proofs with uv 0.13.5:
    • a wrong hash fails uv build --package citry, uv build --package citry-core --sdist, uv sync --locked, the --no-config rebuild, and an editable install from outside the workspace;
    • the real hashes build and install.
  • G3 checks:
    • the fingerprint check fails on Node.js 26.5 and passes on 22.23.4;
    • the action's marker line matches certifi 2026.7.22 and not 2026.10.19.
  • Two independent review rounds (technical and prose); every finding was applied.

Unrelated, noticed along the way: "Docs lighthouse" fails on best-practices (0.96 against a required 1.0) on branches since at least #246. It predates this work.

🤖 Generated with Claude Code

JuroOravec and others added 15 commits October 22, 2026 14:41
The emSign certificate authorities' private keys can be recovered, so the
tools that ship their own certificate list need updates (pip 26.2.2,
uv 0.13.4, certifi 2026.10.19).

- Publish with pypa/gh-action-pypi-publish 1.14.3 (GHSA-5xjx-3w67-w9x9),
  whose certifi no longer includes the emSign root.
- Pin uv 0.13.5 in the release, docs, and examples workflows and in the
  starter and demo check.yml files. The toolchain validator now reads the
  pin from pyodide-build.json and also covers the example workflows.
- Install pip 26.2.2 from a hash-checked URL before the citry-ui wheel
  tests and the VS Code language-server installs download from PyPI.
- Raise certifi to 2026.10.19 in the root, benchmark, and agent-usage locks,
  and upgrade pip first in the agent-usage image.
- Add a blog post for users about the incident.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address review findings on the emSign change:

- pip 26.2.2 also trusts the operating system's list, which on Debian 12
  and older runner images still holds emSign ECC Root CA - G3. After the
  hash-checked upgrade, CI and the agent-usage image set
  PIP_USE_DEPRECATED=legacy-certs so pip uses only its bundled certifi.
- The toolchain validator parses every workflow and the example
  check.yml files, resolves ${{ env.* }} references, requires the reviewed
  uv in publish, docs, and examples workflows, and checks every
  gh-action-pypi-publish use. A new test covers the drift cases.
- docs/codebase.md states the minimum uv.
- The blog post names the one affected root, the operating-system list,
  build-backend downloads, Node.js-based downloads, and corrects the uv
  advice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Move the pnpm pin check back inside its per-workflow loop; the previous
  commit left it checking only the last file.
- The docs deploy workflow now pins the reviewed uv, and the pin checker
  matches action names without regard to case, reads step env, and reads
  .yaml files and every example workflow.
- The agent-usage image sets PIP_USE_DEPRECATED=legacy-certs only for its
  install, so a new virtual environment in the image keeps working.
- Blog post: names the affected root, the pip setting's side effects, the
  Ubuntu 24.04 fix, and the Node.js-based uploads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
setup-uv 7.6.0 checks a download only against a built-in table that ends
at uv 0.10.10, so uv 0.13.5 and every "latest" uv were installed
unchecked. All 48 setup-uv steps, including the starters' and demos'
check.yml, now use the 10.3.2 commit, whose table covers uv 0.13.5 and
which checks newer releases against uv's published checksums.

- prune-cache: true keeps the cache behavior from before setup-uv 9.
- The toolchain validator requires the reviewed setup-uv commit in every
  workflow, not only the release ones; the floating @v7 tag now fails.
- The blog post shows the new starter settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…255)

Node.js 22.23.4, 24.22.1, and 26.12.1 drop the root, but Playwright still
bundles an older Node.js, and the runner images predate Ubuntu's
ca-certificates update.

- A new local action refreshes ca-certificates when the system list still
  holds G3 and fails the job if it remains. Every Playwright browser install
  runs after it with NODE_OPTIONS=--use-openssl-ca, so Playwright's Node.js
  uses only the system list. The two jobs that test installed artifacts
  without a checkout run the same check inline.
- The VS Code publish workflow pins Node.js 22.23.4, checks that its bundled
  list no longer has G3, and publishes to Open VSX with the ovsx client
  pinned in pnpm-lock.yaml instead of pnpm dlx.
- The agent-usage image uses node:22.23.4 and runs Playwright's download on
  that Node.js.

The JavaScript actions run on the runner's own Node.js and change only
when GitHub releases a runner with Node.js 24.22.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uv.lock does not cover the setuptools and maturin that uv downloads to
build or sync a workspace package. The root pyproject.toml now pins every
build backend (setuptools, maturin 1.15.0, and tomli for maturin on
Python 3.10) with all published sha256 hashes in [tool.uv]
build-constraint-dependencies, and sets require-build-hashes, so a
download with an unknown hash stops the build.

- scripts/build_constraints.py regenerates the pinned block (`update`)
  and writes it as a hashed requirements file (`export`).
- Builds that pass --no-config (the release verifiers' sdist rebuilds and
  the Citry UI rebuild in py--tests.yml) pass the exported file with
  --build-constraints and --require-hashes.
- The Pyodide build sets UV_CONSTRAINT so pyodide-build's
  `uv pip install` checks maturin, and refuses to run without uv on PATH.
- examples/_internal/qualify.py passes the pins for --editable-root
  installs, which run outside the workspace.
- New build_backend_pins validator; script_invocation now accepts a
  scripts.* import guarded by an ImportError fallback that binds the
  same names.
- uv.lock moves to revision 5 and gains the build-constraints block;
  uv 0.13.5 or later is required.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…its changes (#255)

Review fixes for the emSign follow-ups:

- Every setup-uv step now pins uv 0.13.5. The root pyproject.toml uses
  uv's experimental hashed build constraints, so a new uv must not reach CI
  before the pin moves, and setup-uv 10.3.2 then checks every uv download
  against its built-in checksum table.
- The workflows that use .github/actions/drop-emsign-g3 also run when only
  the action changes; the examples workflow also runs when
  scripts/build_constraints.py changes.
- CONTRIBUTING.md and the development docs state the uv 0.13.5 minimum;
  docs/codebase.md explains why, and what happens to third-party sdist
  builds.
- The blog post lists every exposed step and what remains open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- toolchain validator: every setup-uv step, including those in composite
  actions under .github/actions/, must pin exactly the uv release in
  pyodide-build.json and set prune-cache: true. Every `playwright install`
  must get NODE_OPTIONS=--use-openssl-ca and the system SSL_CERT_FILE
  (from env or as a prefix of the install command) and run after the
  drop-emsign-g3 action or an inline copy whose commands match it.
- script_invocation validator: an ImportError fallback counts only when it
  imports the same module without the scripts. prefix, under the same
  names, and that module exists under scripts/.
- check.py stops before any phase when uv is older than the pinned release.
- Tests for the citry-ui sdist rebuild and the examples --editable-root
  install receiving the hashed build constraints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#244 raised citry's pin to citry-core==1.9.0 but left the distribution
verifier expecting 1.8.0, so every citry wheel check failed with
"unexpected runtime dependencies". The verifier now reads citry-core's
own [project] version, and a test checks that citry pins that release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hore/emsign-followups

# Conflicts:
#	packages/py/citry/tests/test_distribution_artifacts.py
…asses

The Windows test job failed 15 tests:

- The toolchain and published-README validators printed paths with
  backslashes on Windows. They now name files with forward slashes on
  every OS, as the repository does, so messages read the same everywhere.
- test_json_ranges_of_every_rule_family_count_from_zero stripped the
  temporary directory with a hard-coded "/"; it now uses os.sep.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hore/emsign-followups

# Conflicts:
#	scripts/validators/toolchain.py
@JuroOravec
JuroOravec added this pull request to stack #257 October 22, 2026 17:06
Base automatically changed from chore/emsign-ca-distrust to main October 22, 2026 17:07
#253 landed as a squash commit whose tree equals f336ada, which this
branch already contains, so this branch's tree is kept unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant