Skip to content

fix(ci): cache native dependency outputs for hosted jobs - #155387

Merged
RomneyDa merged 1 commit into
extended-stable/2026.8.33from
release/2026.8.33-matrix-cache
Sep 22, 2026
Merged

RomneyDa merged 1 commit into
extended-stable/2026.8.33from
release/2026.8.33-matrix-cache

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Related: #150725

What Problem This Solves

Fixes an issue where extended-stable validation could fail before tests when Matrix crypto's native-library download encountered a transient GitHub release-CDN reset. The frozen candidate reproduced this in checks-node-compat-node22, where dependency installation downloaded the native library, received ECONNRESET, and then hit the dependency's undefined err catch path.

Why This Change Was Made

Backports the complete cache-owner repair from #150725 while preserving the stable branch's older workflow topology. Cache-enabled Linux readers now use the publisher's workspace-local pnpm store path, hybrid mode seeds GitHub-hosted Linux separately from Blacksmith, and the completed store is published immediately after setup instead of after unrelated build and test warming. This avoids a downloader retry, dependency patch, binary vendoring, or runtime change.

Stable does not contain main's later native SDK boundary cache steps or docs/ci/runners.md, so the backport keeps those absent and updates the equivalent stable contract in docs/ci.md.

User Impact

Release and CI jobs can reuse Matrix's pnpm-cached native postinstall output instead of re-downloading it on every compatible hosted cache hit. Cold caches and changed dependency inputs still use the upstream download. There is no product runtime or configuration change.

Evidence

  • Pre-fix reproduction: Full Validation CI / checks-node-compat-node22 downloaded @matrix-org/[email protected], failed with read ECONNRESET, then failed in download-lib.js because err is undefined. Tests never started; the aggregate ci-gate failure was derivative.
  • Upstream dependency contract inspected directly: 0.6.6 runs node download-lib.js in postinstall; an existing matching binary and .version marker skip the download; its downloader has no retry and its catch block references undefined err.
  • node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts test/scripts/setup-pnpm-store-cache-ensure-node.test.ts — 211 passed, 2 skipped.
  • node scripts/check-changed.mjs -- <six changed paths> — passed all selected test-root, docs, and tooling gates.
  • pnpm docs:list, targeted oxfmt --check, and git diff --check — passed.
  • node --import tsx scripts/check-workflows.mts reached its Python environment setup but could not install the repo-pinned pre-commit==4.6.2 from this host's configured package index. Exact-head Workflow Sanity CI remains the required proof for that gate.
  • Fresh autoreview raised one find -maxdepth macOS portability concern. Direct Darwin 25.5.0 proof showed /usr/bin/find ... -maxdepth 0 exits 0, and the installed macOS manpage documents the predicate; the finding was rejected and no code changed.

Scope: CI tooling +18/-22, tests +42/-15, docs +2/-2; no application production changes. Hybrid adds one GitHub-hosted warmer row and no Blacksmith registrations.

CI setup could fail before lint or tests when Matrix crypto native-library downloads hit a transient release-CDN error. Hosted store-only readers used a different cache path from the publisher, and hybrid mode seeded only the Blacksmith Linux backend.

Align the existing setup action and warmer on the workspace-local pnpm store, publish completed native installation outputs before unrelated build work, and add one install-only hosted warmer row in hybrid mode. Bound installed-Node discovery to four levels to avoid traversing bundled npm dependencies. The existing warmer remains the sole publisher and PR consumers remain restore-only.

Current-head hosted warm setup completed in 22 seconds with 1,436 packages reused, zero downloads, and Matrix postinstall skipped, compared with the recorded ten-job 45-second baseline median. This is an observed sample, not a measured fleet-wide median change. Cold caches and changed native inputs still require upstream assets. No application runtime, configuration, dependency, or permission changes.

Validation: exact-head PR CI run 35197161825 returned GREEN; the accepted Codex review and exact-head ClawSweeper review found no actionable issues. The PR also records passing targeted Node/cache guards, workflow checks, and cold/warm native reuse proof.

Related: #150637, #150526.
@RomneyDa
RomneyDa marked this pull request as ready for review September 22, 2026 03:17
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S maintainer Maintainer-authored PR labels Sep 22, 2026
@RomneyDa
RomneyDa merged commit de63dbf into extended-stable/2026.8.33 Sep 22, 2026
350 of 358 checks passed
@RomneyDa
RomneyDa deleted the release/2026.8.33-matrix-cache branch September 22, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants