Skip to content

chore(ci): cache Release's build + console dist, stop PR-side cache churn, move CodeQL/coverage off the hot path - #3666

Merged
os-zhuang merged 1 commit into
mainfrom
claude/ci-performance-optimization-ms8ll6
Jul 27, 2026
Merged

chore(ci): cache Release's build + console dist, stop PR-side cache churn, move CodeQL/coverage off the hot path#3666
os-zhuang merged 1 commit into
mainfrom
claude/ci-performance-optimization-ms8ll6

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Why

Post-#3622 timing data shows the cost has moved to the push side: every main push pays a ~9.5-minute Release job, 80% of which is two cacheable steps — pnpm build at 4m21s (release.yml has no turbo cache, the same omission lint.yml had) and the vendored Console SPA build at 3m11s (a pure function of the rarely-changing .objectui-sha pin). Separately, PR-side cache saves (~5 turbo entries per push) churn the repo's 10 GB Actions cache pool and evict the main seeds — observed today as a sudden cold-cache spike (Build Core 51s → 4m30s).

Plus two explicit decisions from the maintainer: CodeQL off the PR path, coverage off the push path.

What

  1. release.yml — turbo cache added. Build ~4½ min → expected <1 min on typical pushes. Release runs only on main, so it doubles as a cache seeder.
  2. release.yml — Console dist cached, keyed on hashFiles('.objectui-sha', 'scripts/build-console.sh'). build-console.sh is skipped on cache hit; a new pnpm check:console-sha step verifies the dist stamp against the pin either way (the script's exit-1-on-drift contract covers a stale restore). Expected ~3 min → ~10s whenever the pin is unchanged. Note: actual npm-publish runs still rebuild the console inside pnpm run release — this cache accelerates the (vastly more common) non-publish pushes.
  3. ci.yml + lint.yml — turbo caches restore-only on PRs.actions/cache/restore replaces actions/cache; explicit actions/cache/save steps run on main pushes only (always(), matching the old post-step save-even-on-failure semantics). PRs keep reading main's entries through the existing prefix restore-keys; what they lose is only same-PR incremental caching between pushes, which the churn made unreliable anyway.
  4. codeql.yml — pull_request trigger removed (maintainer decision): ~4½ runner-minutes per PR sync; at the current merge cadence every change is analyzed on main within minutes of merging, plus the weekly deep pass. ⚠️ If branch protection requires the "Analyze (javascript)" / CodeQL check on PRs, that requirement must be dropped alongside this.
  5. Coverage → nightly (maintainer decision): new coverage-nightly.yml (05:00 UTC + workflow_dispatch) owns the instrumented spec suite and the coverage-report artifact; ci.yml's push run now includes spec's plain test task instead — net faster, since the plain suite is cheaper than the instrumented one it replaces.

Expected effect

  • Release per main push: ~9.5 min → ~2.5–3 min (non-publish pushes with warm caches).
  • Main-seed turbo caches stop being evicted by PR churn → fewer cold-cache spikes across all workflows.
  • Per PR sync: ~4½ runner-minutes of CodeQL freed; Test Core on main pushes drops the instrumentation overhead.

Verification

  • All five workflow files parse (PyYAML).
  • Spec coverage runs without any workspace build (spec has no workspace: deps; suite reads src/ directly; @vitest/coverage-v8 present) — verified with a live single-file coverage run in a fresh worktree.
  • hashFiles inputs (.objectui-sha, scripts/build-console.sh) exist at repo root.
  • check:console-sha semantics confirmed from the script header: exit 1 on stamp/pin drift, warn-only when unstamped, pass when in sync.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ECTCrcCdZpCHw5zFSgcmGt


Generated by Claude Code

…hurn, move CodeQL/coverage off the hot path
Data from today's runs (post-#3622 steady state): every main push paid a
~9.5-minute Release job of which Build (4m21s, no turbo cache — the same
omission lint.yml had) and the vendored Console SPA build (3m11s, a pure
function of the .objectui-sha pin that rarely changes) were 80%. Meanwhile
PR-side cache saves (~5 turbo entries per push) churned the 10 GB Actions
cache pool and evicted the main seeds — observed as sudden cold spikes
(Build Core 51s → 4m30s).
- release.yml: add the standard turbo cache (Build ~4½min → expected <1min),
and cache packages/console/dist keyed on hashFiles(.objectui-sha,
build-console.sh) — skip build-console.sh on hit, and verify the dist
stamp against the pin either way via check:console-sha (its exit-1-on-
drift contract covers a stale restore).
- ci.yml + lint.yml: turbo caches become restore-only on PRs
(actions/cache/restore); explicit main-push-only actions/cache/save steps
(always(), matching the old post-step semantics) keep seeding. PRs read
main's entries via the existing prefix restore-keys.
- codeql.yml: drop the pull_request trigger (user decision) — ~4½ runner-
minutes per PR sync; every merge is analyzed on main within minutes at
the current merge cadence, plus the weekly deep pass. Note left about the
Analyze check no longer reporting on PRs.
- coverage → nightly (user decision): new coverage-nightly.yml (05:00 UTC +
workflow_dispatch) owns the instrumented spec suite; ci.yml's push run now
includes spec's plain test task instead (uninstrumented — net faster).
Verified locally that spec's suite runs coverage without any build (spec
has no workspace deps) and the v8 provider is present.
All five workflow files parse; changeset is empty (releases nothing).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECTCrcCdZpCHw5zFSgcmGt
@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation ci/cd tooling size/m labels Jul 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 27, 2026 13:45
@os-zhuang
os-zhuang merged commit b04b458 into mainJul 27, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the claude/ci-performance-optimization-ms8ll6 branch July 27, 2026 13:45
os-zhuang pushed a commit that referenced this pull request Jul 27, 2026
Picks up #3666's CI caching fix ('stop PR-side cache churn'), which the
workflow used by this PR's run predates — the run stalled for 50+ minutes on
'Run affected tests' across two attempts on separate runners.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cddocumentationImprovements or additions to documentationsize/mtooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-zhuang@claude