Skip to content

ci: cache discipline, slim CI debug info, and a --locked sweep - #703

Merged
norrietaylor merged 9 commits into
mainfrom
ci/cache-discipline
Jul 10, 2026
Merged

ci: cache discipline, slim CI debug info, and a --locked sweep#703
norrietaylor merged 9 commits into
mainfrom
ci/cache-discipline

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Jul 10, 2026

Copy link
Copy Markdown
Member

Stacked on #702 (base = its branch; GitHub retargets to main when it merges — the diff here is N4 only).

What

Three cross-lane changes sized to fork every cache exactly once:

  1. rust-cache disciplinesetup-rust gains shared-key + save-if inputs (defaults: workspace, main-only writes), forwarded from core-tests (tests). Per-class keys: clippy, native-e2e (-p builds unify features differently than the workspace suite), mac-unit (inline). PR branches restore but never write — PR churn stops LRU-evicting the main-branch caches from the shared 10 GB pool (the 13m42s cold compile on ci: adopt nextest profiles; reshape the KVM lane to its end state #702's first run was this problem live).
  2. Restore/save splits for the two multi-GB raw caches (KVM build-linux, macOS artifacts stage2): actions/cache/restore + main-only actions/cache/save at job end, guarded on cache-hit.
  3. CARGO_PROFILE_DEV_DEBUG=line-tables-only in CI (setup-rust env step; explicit env: on the mac/KVM jobs that bypass the composite) — usable backtraces, smaller target trees and caches, faster links. Deliberately not a named [profile.ci]: that would move output out of target/debug and break codesign/testbed/justfile paths. Plus --locked on every workflow cargo invocation — a stale Cargo.lock now fails loudly; previously only cargo fetch enforced it.

Part of the CI end-state migration (#687).

One-time landing cost + prime plan

All keys fork cold at merge (new shared-key + debug-info change together, by design). After merge: workflow_dispatch each lane once on main to write the new keys, then a trivial PR must show restore-from-main hits and no Saved cache lines. The mini's persistent target dir rebuilds once (new fingerprints from the debug env).

Release.yml caches are deliberately untouched — they inherit these conventions in the release overhaul PR.

Verification

  • This PR's own runs prove the plumbing (inputs resolve, caches restore, --locked passes everywhere).
  • Post-merge cache behavior: gh api repos/gominimal/minimal/actions/caches should trend down over the week; PR runs show no cache writes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • CI Improvements
    • Enforced --locked for Rust builds, tests, doctests, and nextest runs to ensure consistent dependency resolution.
    • Added a shared-key option for the core test action and introduced lane-specific cache keys for different CI jobs.
    • Updated caching to restore-only during most runs, saving cache entries only on the main branch when appropriate.
    • Reduced CI debug output (line-tables-only) to slim build artifacts.
    • Ensured archiving uses the locked dependency set as well.

norrietaylor and others added 6 commits July 9, 2026 21:43
Add a nextest config with two profiles: profile.default for local runs
(surface slow tests, never kill), and profile.ci for the core-tests
composite (fail-fast off for full failure reports, hard-kill at 5
minutes via slow-timeout terminate-after, leak detection at 1s).

No retries anywhere: the workspace suite has no recorded flakes, and a
same-invocation retry of a VM boot test would run against the leaked
__krun-vmm/gvproxy processes of the failed attempt (#588) - the lane
reap steps plus terminate-after remain the mitigation.

core-tests also gains --no-tests=fail: an empty selection is a broken
filter or a dropped target, not a pass.

Refs: #687

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A PR touching only .config/nextest.toml (e.g. a future profile edit)
must re-run the tests that consume it; this PR's own run only triggered
because it also edited the core-tests composite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Four changes, one review story (nextest archive, unified session e2e,
scripts over YAML, composite verify):

- nextest archive replaces the hand-rolled testbins.json + run-testbin.sh:
  build-linux ships testbed/nextest-archive.tar.zst and the test job
  selects harnesses with filtersets under the new profile.vm (one VM at
  a time, hung boots hard-killed at 6 min, no retries - a same-invocation
  retry runs against the leaked vmm/gvproxy of the failed attempt, #588).
- the unified session e2e (scripts/session-e2e.sh) joins the lane,
  covering Deployment Model 3 (native Linux + VM): the minimal CLI is
  built in build-linux (separate invocation - a combined build unifies
  libkrun into the CLI, the #694 regression class), ships in the
  testbed, and drives activate/exec/destroy from PATH, with the #588
  reap (sudo: relay leftovers are root-owned) before it and
  cli-e2e-boot.log uploaded.
- the daemon-lifecycle shell blob becomes scripts/lifecycle-e2e.sh:
  PATH-resolved minvmd (no cargo, macOS-reusable), temp workdir, and an
  EXIT-trap teardown so a failed assert cannot strand a daemon.
- the krun_add_disk3 export assert moves into setup-libkrun-linux,
  mirroring the macOS composite and covering release.yml (which uses the
  composite but had no check); an early actionable failure - minvmd's
  compile-time link is the real backstop.

Also per owner direction: workflow comments drop PR/issue and R-numbers
(history belongs in commits, not YAML), and the DM labels are corrected
against docs/specs/03-spec-networking (DM1 is the macOS model; this
lane is DM3, session-e2e.sh header fixed accordingly).

Refs: #687

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The lifecycle step spawns a fresh daemon just like the CLI session e2e,
so it was equally exposed to leaked __krun-vmm/gvproxy children from a
failed harness run. Move the reap to run immediately after the harness
e2es, ahead of both fresh-daemon steps.

Addresses CodeRabbit review on #702.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three cross-lane changes that must fork every cache exactly once:

- rust-cache gains shared-key (one per job class that compiles the same
  artifacts: workspace/tests/clippy/native-e2e/mac-unit) and save-if
  restricted to main, via new setup-rust inputs forwarded from
  core-tests. PR branches restore but never write, so PR churn stops
  LRU-evicting the main caches every PR restores from (the 10 GB pool
  is shared repo-wide).
- the two multi-GB raw actions/cache users (KVM build-linux, macOS
  artifacts stage2) split into cache/restore + main-only cache/save
  guarded on cache-hit.
- CARGO_PROFILE_DEV_DEBUG=line-tables-only in CI (setup-rust env step;
  explicit job env on the mac and KVM jobs that bypass the composite):
  usable backtraces, smaller target trees and caches, faster links -
  without a named Cargo profile, which would move output out of
  target/debug and break codesign/testbed/justfile paths.
- --locked on every workflow cargo invocation (build/test/clippy/
  archive), so a stale Cargo.lock fails loudly instead of silently
  re-resolving; previously only core-tests' cargo fetch enforced it.

Refs: #687

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@norrietaylor

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@norrietaylor
norrietaylor changed the base branch from ci/nextest-profile to main July 10, 2026 06:03
@norrietaylor norrietaylor reopened this Jul 10, 2026
@norrietaylor
norrietaylor changed the base branch from main to ci/nextest-profile July 10, 2026 06:05
@norrietaylor

Copy link
Copy Markdown
Member Author

Stacked on #702 per owner preference (base = ci/nextest-profile), so the diff shows only the cache-discipline delta. Note: lane workflows trigger only on PRs targeting main, so checks here stay empty until #702 merges and GitHub retargets this PR — I'll kick a run then; the plumbing gets its live proof at that point.

@norrietaylor

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1da0234f-9d6c-41fb-bbfd-85c6850f93f1

📥 Commits

Reviewing files that changed from the base of the PR and between cb3dcbe and 9b0c80b.

📒 Files selected for processing (3)
  • .github/workflows/ci-linux-kvm.yml
  • .github/workflows/ci-linux-native.yml
  • .github/workflows/ci-macos.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/ci-linux-native.yml
  • .github/workflows/ci-linux-kvm.yml
  • .github/workflows/ci-macos.yml

📝 Walkthrough

Walkthrough

Reusable Rust actions and CI workflows now support lane-specific cache keys, main-branch-only cache writes, reduced debug information, and --locked Cargo commands across Linux, macOS, and general test jobs.

Changes

CI cache and Cargo locking

Layer / File(s) Summary
Reusable Rust action inputs and cache wiring
.github/actions/core-tests/action.yml, .github/actions/setup-rust/action.yml
Reusable actions accept cache parameters, configure reduced debug information, forward save conditions, and run core tests with locked Cargo resolution.
Linux cache and build flow
.github/workflows/ci-linux-kvm.yml, .github/workflows/ci-linux-native.yml
Linux jobs restore caches separately from main-branch saves, use lane-specific cache settings, reduce debug information, and apply locked builds and archives.
macOS cache and build flow
.github/workflows/ci-macos.yml
macOS jobs separate cache restore and save operations, configure lane-specific caching, reduce debug information, and use locked build and test commands.
General CI test wiring
.github/workflows/ci.yml
Clippy receives a dedicated cache key, and feature-scoped test commands now use locked Cargo resolution.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: github_actions

Suggested reviewers: twitchyliquid64, jtnkminimal, bryan-minimal

Poem

A rabbit hops through cached builds,
With locked crates snug in rows.
Main saves gold beneath the moon,
While debug fluff now goes.
“CI is neat!” the bunny sings,
And bounds through green-lit flows.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the CI cache changes, debug-info slimming, and Cargo lockfile enforcement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@norrietaylor

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@norrietaylor

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Base automatically changed from ci/nextest-profile to main July 10, 2026 16:59
# Conflicts:
#	.github/actions/core-tests/action.yml
#	.github/workflows/ci-linux-kvm.yml
@norrietaylor
norrietaylor merged commit 20a9859 into main Jul 10, 2026
19 checks passed
@norrietaylor
norrietaylor deleted the ci/cache-discipline branch July 10, 2026 17:41
norrietaylor added a commit that referenced this pull request Jul 10, 2026
The changes jobs failed on every push to main since the lanes landed:
dorny/paths-filter on a push event diffs locally against event.before,
which our shallow (depth-1), credential-free (persist-credentials:
false) checkout can neither resolve nor fetch - so the step exits 128
and the lane aggregators go red on main. On pull_request events dorny
reads the file list via the API, which is why every PR run was green
while main rotted silently (the lanes are still advisory).

Gate the filter step to pull_request and flip the downstream conditions
to 'not pull_request OR filter matched': pushes to main and manual
dispatches now run everything, which is what main wants anyway - main
runs write the main-only caches (#703) and provide the soak signal.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants