Skip to content

ci: local gate + attestation skips, quick gate for full builds, ccache for Tier 2 - #12

Merged
zackees merged 3 commits into
masterfrom
ci/fast-gate
Oct 9, 2026
Merged

zackees merged 3 commits into
masterfrom
ci/fast-gate

Conversation

@zackees

@zackees zackees commented Oct 9, 2026

Copy link
Copy Markdown
Member

Speeds up lint and unit tests, locally and in CI, by adopting zackees/ci.yml's local gate and attestations (C++ gaps tracked in forge-ci/ci.yml#393).

Measured locally

Before After
Full lint (clang-format over 1573 files, gersemi over 198, rustfmt, clippy) needed zsh + brew formatters 8 s (./lint)
Tier 2 harness after a fresh clone or worktree (every mtime changed) ~600 s 40 s (ccache 245/245 hits)
Whole local gate, stamping the commit n/a 52 s
Local gate rerun on an unchanged tree n/a 1 s (lane cache)

The new lint lane already caught a real problem: libobs/cmake/rust.cmake (from phase 2) was not gersemi-formatted, and the CI format check passed it. Fixed here.

CI changes

  • Quick gate (check-event → native output): PRs that only touch rust/, test/cmocka/, libobs/cmake/rust*, the local gate or docs skip the four full OBS builds. Those builds use ENABLE_RUST_LIBOBS/ENABLE_UNIT_TESTS OFF, so such PRs can't affect them. The Windows x64 build alone was 16 of the last green run's 17 min. Pushes, workflow edits, any other path, and the ci-full label always run them.

  • Attestation skips (ci-mode job, local-gate.toml [gate.trust] enforce): an attested, in-policy PR head skips rust-tests-linux and rust-linux-tier2. The skip only applies when all of these hold:

    • it fails closed for forks and non-writer authors;
    • the ci-full label forces a full run;
    • changed gate surfaces force a full run;
    • 1 in 10 heads is still sampled for an audit run.

    Pushes to master always run everything.

  • Tier 2 Linux in CI restores a ccache on PRs and saves it on master pushes only.

  • pr-pull.yaml also runs for PRs into grind/** (grind goal PRs previously got no CI; that cost a whole integrate round on Phase 2: finish cmocka suite (os_path, serializer, darray) + CI + Windows/macOS Tier 2 #10).

  • .coderabbit.yaml (GATE-012), soldr rustup instead of bare rustup (RUST-001).

This PR's base has no local-gate.toml yet, so its own run is not-opted-in (no skips). It also edits workflows, so it runs the full builds. The skip path is exercised by the first stamped Rust-only PR after merge.

Remaining ci-lint findings (static, not blocking)

  • GATE-008 on build-project.yaml is a false positive: it is a workflow_call invoked by push.yaml on master pushes.
  • GATE-012 "codeql" is a false positive: a string match on Flatpak cleanup steps.
  • GATE-001 mirrors are left for a follow-up.

…er 2

- ci/local_gate.py with ./lint and ./unittest: pinned clang-format 22.1.3
  and gersemi 0.25.0 via uvx (no zsh/brew), rustfmt, clippy, Rust tests,
  Tier 2 in Docker. The full lint lane runs in ~8 s and caught an
  unformatted libobs/cmake/rust.cmake that CI let through (fixed here).
- local-gate.toml + ci-attestations.yml (zackees/ci.yml GATE-001..010):
  an attested, in-policy PR head skips the Linux Rust test and Tier 2
  jobs via the new ci-mode job; pushes always run everything.
- Quick gate in build-project.yaml: PRs touching only rust/, test/cmocka/,
  the local gate or docs skip the full OBS builds (they build with
  ENABLE_RUST_LIBOBS/ENABLE_UNIT_TESTS OFF). The ci-full label forces them.
- Tier 2 harness uses ccache: a run after every mtime changes (fresh clone
  or worktree) drops from ~600 s to 40 s (245/245 hits). CI restores the
  cache on PRs and saves it on master pushes.
- pr-pull.yaml also runs for PRs into grind/** feature branches.
- .coderabbit.yaml (GATE-012), soldr rustup instead of bare rustup
  (RUST-001), AGENTS.md documents the gate.

Local-Gate: v1 tree=3237d0ea8ab7d2591d7aa097f933dee4207fb572 secs=52 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791507315,"gate":"rust/all/fmt","host":"linux-x86_64","key":"81ea11f5e6f670097a420e92f323df260487c9062ce521f986041ff63e98d8a2","lane":"lint","parents":["893ac489800fca888843a10e19c3e0d5784c7039"],"secs":8,"stamp":"bd07f4ca1c47868c290cd54e87b85ce9","tree":"3237d0ea8ab7d2591d7aa097f933dee4207fb572","v":1,"via":"run"}
Ci-Attestation: {"at":1791507315,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"81ea11f5e6f670097a420e92f323df260487c9062ce521f986041ff63e98d8a2","lane":"lint","parents":["893ac489800fca888843a10e19c3e0d5784c7039"],"secs":8,"stamp":"f0749aa780433588f1af11d1977c7d8a","tree":"3237d0ea8ab7d2591d7aa097f933dee4207fb572","v":1,"via":"run"}
Ci-Attestation: {"at":1791507315,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"9f04a753236734e8bccc51be2695ff6761a98e3a50706f24ec97985e1971f300","lane":"rust-test","parents":["893ac489800fca888843a10e19c3e0d5784c7039"],"secs":4,"stamp":"ce97cf19e12a7b5d481252f50b45c070","tree":"3237d0ea8ab7d2591d7aa097f933dee4207fb572","v":1,"via":"run"}
Ci-Attestation: {"at":1791507315,"gate":"general/linux-x64/tier2","host":"linux-x86_64","key":"cdd1f640cc8fdfb461010db953502eb0374c0a544502b9b66f20f1cf3cd4cf42","lane":"tier2-linux","parents":["893ac489800fca888843a10e19c3e0d5784c7039"],"secs":39,"stamp":"45733cddee44ce3c37d46485f94fb895","tree":"3237d0ea8ab7d2591d7aa097f933dee4207fb572","v":1,"via":"run"}
The Rust jobs passed cache: false and installed components by hand.
setup-soldr now provisions the toolchain from rust-toolchain.toml and
restores the zccache build cache and cargo registry (saved only on master
pushes, save-cache: auto). macOS/Windows Tier 2 route Corrosion's cargo
through soldr shims.

Local-Gate: v1 tree=e0bc81f6ff5fd6b3dd79968e841d308c29859d56 secs=53 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791507587,"gate":"rust/all/fmt","host":"linux-x86_64","key":"2987894d89f9e4fa679a8d9de48bacab77a455436d08914cb13e0f8ffde5f4ee","lane":"lint","parents":["7f16a6b99cb736860566a276c8e337ae97ee69ab"],"secs":15,"stamp":"45325f029b4a99854081d1b9471088d5","tree":"e0bc81f6ff5fd6b3dd79968e841d308c29859d56","v":1,"via":"run"}
Ci-Attestation: {"at":1791507587,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"2987894d89f9e4fa679a8d9de48bacab77a455436d08914cb13e0f8ffde5f4ee","lane":"lint","parents":["7f16a6b99cb736860566a276c8e337ae97ee69ab"],"secs":15,"stamp":"635fd585235ec0912467533eb20982cc","tree":"e0bc81f6ff5fd6b3dd79968e841d308c29859d56","v":1,"via":"run"}
Ci-Attestation: {"at":1791507587,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"069bfc99d076aeda8e4151bb2c86fd6799c1db4e17d4366144df15489dd1e78d","lane":"rust-test","parents":["7f16a6b99cb736860566a276c8e337ae97ee69ab"],"secs":5,"stamp":"cc44bf2b9f112f637b5657ed35fd0a4a","tree":"e0bc81f6ff5fd6b3dd79968e841d308c29859d56","v":1,"via":"run"}
Ci-Attestation: {"at":1791507587,"gate":"general/linux-x64/tier2","host":"linux-x86_64","key":"19d5e86a3d692d0f49f719d820d940cdfb558622d22dcec8c5d06f14589e20a2","lane":"tier2-linux","parents":["7f16a6b99cb736860566a276c8e337ae97ee69ab"],"secs":32,"stamp":"ca2922efcb9b90acae534c64d296d408","tree":"e0bc81f6ff5fd6b3dd79968e841d308c29859d56","v":1,"via":"run"}
zccache looks for liblibobs_rust-*.a when rustc on MSVC emits a .lib, so
the Corrosion staticlib build fails under the shims. macOS keeps them.

Local-Gate: v1 tree=0148041431e57e0229e6c8ba09083993e2e368f1 secs=60 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791508087,"gate":"rust/all/fmt","host":"linux-x86_64","key":"1f067589592997070a6c7aeb09dc3d19aaadc7913b5b578770bd66ede0e82766","lane":"lint","parents":["345e33e6a61f29d877231918577ed49cf6a09c23"],"secs":19,"stamp":"0f6c21f02ba9c1c001f82eca7cf33ecf","tree":"0148041431e57e0229e6c8ba09083993e2e368f1","v":1,"via":"run"}
Ci-Attestation: {"at":1791508087,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"1f067589592997070a6c7aeb09dc3d19aaadc7913b5b578770bd66ede0e82766","lane":"lint","parents":["345e33e6a61f29d877231918577ed49cf6a09c23"],"secs":19,"stamp":"065f3535366bb7061df482cae3e1d42e","tree":"0148041431e57e0229e6c8ba09083993e2e368f1","v":1,"via":"run"}
Ci-Attestation: {"at":1791508087,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"f72eafe899c368477d5b94638da3b891bda14e35aeb6f6f44a960dbaade227b7","lane":"rust-test","parents":["345e33e6a61f29d877231918577ed49cf6a09c23"],"secs":6,"stamp":"bc40f475ae6ce1277277b4c796f60985","tree":"0148041431e57e0229e6c8ba09083993e2e368f1","v":1,"via":"run"}
Ci-Attestation: {"at":1791508087,"gate":"general/linux-x64/tier2","host":"linux-x86_64","key":"89d69c4ea12456f110b3748697962a9d38d486d659c03c986b9c34101d968cc7","lane":"tier2-linux","parents":["345e33e6a61f29d877231918577ed49cf6a09c23"],"secs":34,"stamp":"8d066b623c009d0c27d64c71f3f68cb9","tree":"0148041431e57e0229e6c8ba09083993e2e368f1","v":1,"via":"run"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant