Skip to content

perf(ci): speed up smoke runs, sparse checkouts, and verified select-tests artifact - #3221

Open
GDemay wants to merge 1 commit into
DeusData:mainfrom
GDemay:perf/ci-smoke-sparse-and-select-artifact
Open

GDemay wants to merge 1 commit into
DeusData:mainfrom
GDemay:perf/ci-smoke-sparse-and-select-artifact

Conversation

@GDemay

@GDemay GDemay commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

PR authored with AI assistance on behalf of @GDemay; the commit carries Guillaume's DCO sign-off.

What does this PR do?

Split out from #3210 per maintainer review (Piece 5: CI-only items). Standalone on main, incorporating both Piece 5 review points from #3210:

Maintainer review items addressed directly

  1. select-tests trust boundary (scripts/ci/test-impact-bundle.sh, .github/workflows/test-impact-artifact.yml, .github/workflows/pr.yml):
    • test-impact-artifact.yml (main-branch producer on ubuntu-24.04) now also publishes the main-built codebase-memory-mcp binary and an engine.json ({"commit":"<sha>","sha256":"<hex>"}) as test-impact-engine-${{ github.sha }}.
    • scripts/ci/test-impact-bundle.sh --fetch-engine SHA DIR fetches test-impact-engine-<sha> using the exact same gh api main-branch workflow-run provenance check as --fetch (head_sha == SHA, head_branch == "main", repository.full_name == REPO, event in (push, schedule, workflow_dispatch)), then verifies both engine.json.commit == SHA and the binary's SHA-256 before making it executable (failing closed with exit 3 and removing the binary on any mismatch).
    • pr.yml select-tests fetches into $RUNNER_TEMP/base-tooling/build/c — no actions/cache, no PR cache scope, and CBM_NO_CCACHE: "1" on the clean base-tooling fallback build when no main artifact exists yet.
  2. CodeQL alert wait (.github/workflows/codeql.yml):
    • Kept sleep 60 + sleep 15 completely untouched per review.
    • Kept only blobless sparse checkouts (!/tools/ for c-cpp, !/internal/cbm/vendored/ !/tools/ for non-C), upload-database: ${{ !inputs.light }}, wait-for-processing: true, and ccache scoped strictly to the untraced --vendored-only prebuild (CBM_NO_CCACHE: "0" on that single step while job-level CBM_NO_CCACHE: "1" stays enforced for the traced CodeQL build).

Smoke & workflow provisioning speedups

  • scripts/smoke-test.sh, scripts/smoke-local.sh, scripts/smoke-wrappers.sh:
    • Fix the Phase 15 300 s hang on non-UI PR smoke builds (track/kill stdin-holder sleep PID + 30 s wall-clock deadline + bounded curl timeouts + stderr early-exit).
    • Keep daemon warm across Phases 3b–5, use CoW binary copies, drop dead retired-install copy, use COPYFILE_DISABLE=1 GZIP=-1 for local tarballs, and run wrapper suites in parallel.
  • .github/workflows/_lint.yml, _memwaste.yml, _test.yml, cache-warm.yml:
    • Add blobless sparse checkouts skipping unused vendored grammars/tools/graph-ui where not needed.
    • Merge duplicate apt-get update calls, add npm cache + NODE_OPTIONS=--dns-result-order=ipv4first on test-ui, add Homebrew bottle cache + HOMEBREW_NO_AUTO_UPDATE=1 on macOS legs, wire content-verified ccache into report-only _memwaste.yml, and warm cbm TEST_SEAMS=1 (2500M) in cache-warm.yml.

Local Verification (Apple M3, darwin/arm64)

  • 4 mocked-gh provenance & SHA-256 proofs on scripts/ci/test-impact-bundle.sh --fetch-engine:
    1. Valid verified main run + matching commit + matching sha256 → exit 0, executable binary ✅
    2. Tampered binary bytes (SHA-256 mismatch) → exit 3, binary removed (fail-closed) ✅
    3. Commit mismatch in engine.json → exit 3, binary removed (fail-closed) ✅
    4. No successful main run → exit 3 (triggers clean CBM_NO_CCACHE=1 fallback build) ✅
  • CodeQL wait check: confirmed sleep 60 and sleep 15 remain untouched in .github/workflows/codeql.yml.
  • Contracts: passed test_venue_parity_contract.sh, test_lane_wiring_contract.sh, test_lane_gate_contract.sh, test_select_lanes.sh, test_smoke_fixture_contract.sh, test_script_exec_bit_contract.sh, test_shell_line_endings.sh, check-dco.sh, bash -n, and yaml.safe_load across all 7 modified workflow files.

Checklist

  • Every commit is signed off (git commit -s)
  • Local provenance/SHA-256 proofs and all workflow/smoke contracts pass

…tests artifact

Split out from DeusData#3210 per maintainer review (Piece 5: CI-only items).

Addresses both Piece 5 review items from DeusData#3210:
- select-tests trust (scripts/ci/test-impact-bundle.sh, test-impact-artifact.yml, pr.yml): publish the main-built selection engine binary + SHA-256 receipt (engine.json) as artifact test-impact-engine-<sha> from test-impact-artifact.yml on main, and fetch/verify it in select-tests via test-impact-bundle.sh --fetch-engine using the same main-branch workflow-run provenance check as test-impact-<sha>. No actions/cache, no PR cache scope, and CBM_NO_CCACHE=1 on the clean base-tooling fallback build.
- CodeQL alert wait (.github/workflows/codeql.yml): keep sleep 60 + sleep 15 completely untouched. Keep only blobless sparse checkouts, upload-database: !inputs.light, wait-for-processing: true, and ccache strictly scoped to the untraced --vendored-only prebuild (traced CodeQL build keeps CBM_NO_CCACHE=1).

Smoke & CI provisioning speedups:
- scripts/smoke-test.sh, smoke-local.sh, smoke-wrappers.sh: fix Phase 15 300 s hang on non-UI PR smoke builds (track/kill stdin-holder sleep PID + 30 s wall-clock deadline + bounded curl timeouts + stderr early-exit), keep daemon warm across Phases 3b-5, use CoW binary copies, drop dead retired-install copy, use COPYFILE_DISABLE=1 GZIP=-1 for local tarball, and run wrapper suites in parallel.
- .github/workflows/_lint.yml, _memwaste.yml, _test.yml, cache-warm.yml: add blobless sparse checkouts skipping unused vendored grammars/tools/graph-ui, merge duplicate apt-get updates, add npm cache + IPv4 DNS order on test-ui, add Homebrew bottle cache / HOMEBREW_NO_AUTO_UPDATE=1 on macOS legs, wire ccache into report-only _memwaste.yml, and warm cbm TEST_SEAMS=1 (2500M) in cache-warm.yml.

Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
@GDemay
GDemay force-pushed the perf/ci-smoke-sparse-and-select-artifact branch from 48304fd to 7c0ac7f Compare December 6, 2026 19:20

This branch has not been deployed

No deployments
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