Skip to content

perf(ci): speed up validation without reducing coverage - #1441

Merged
XingYu-Zhong merged 4 commits into
developfrom
kun/ci-throughput-isolated
Nov 2, 2026
Merged

XingYu-Zhong merged 4 commits into
developfrom
kun/ci-throughput-isolated

Conversation

@XingYu-Zhong

@XingYu-Zhong XingYu-Zhong commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Speed up GitHub Actions without removing necessary tests or native/platform validation. The original CI-only commit was a0afddb154758d4ae7b689629cef88647e6045b3; current integration head is 3d78d0fdf5c82407530537f9bd7f2fac58f019ab. Measurements below are historical and do not certify the updated combination.

This is the isolated CI-only continuation of #1440. Its shared checkout acquired unrelated ADE work during verification; that branch and draft PR were preserved. This PR contains only the CI optimization commit and its reviewed dotenv correction, touching 16 CI/build/test files and no ADE feature code.

Measured results

Metric Before Final Change
PR Checks wall time 68m17s 32m23s -52.6%
Test execution critical step, excluding setup 29m51s serial npm test 4m04s longest parallel shard -86.4%
Second consecutive local build 197.401s 1.081s -99.45%

Baseline: authenticated gh snapshot of the latest 50 runs at task start, comprising 130 jobs. PR Checks baseline uses the median of five complete successful runs; canceled/failed samples are excluded. The first complete optimized run also passed at 31m08s. Final local measurement used a clean, isolated Node 22.23.1 install: full build 196.330s, unchanged second build 1.081s, both exit 0. These are observed samples, not a claim that runner/cache/network variability or every individual job improved.

Final PR Checks run 41327610438: 18/18 jobs successful. All 10 triggered workflows passed; 31 automatic jobs succeeded and the one existing opt-in OS credential probe remained skipped.

Changes

  • Start independent PR packages and Windows recovery concurrently with quality gates; keep all results required by the existing PR gate. Historical package wait was mostly about 39m14s of needs, with only 2–4s of scheduler wait.
  • Run all GUI and Kun tests in four Ubuntu shards each. Reuse the same suite for stable release validation; preserve SQLite/Electron ABI routing and run the isolated large-history regression exactly once.
  • Keep extension, packaging, workflow and Kun runner tests in a separate Ubuntu job, explicitly preparing the SDK test harness formerly built as a side effect of typecheck.
  • Skip heavy jobs for root README/docs-only PR changes without removing PR gate. Fail closed on API truncation, code renames, detection failures and unexpected skipped/failed code checks.
  • Cancel superseded PR runs. Stable publication stays serialized with cancel-in-progress: false and GitHub's documented queue: max, so the default single-pending replacement does not discard stable commits.
  • Keep setup-node's npm cache and both lockfiles in the touched native workflows; add no node_modules, build-output or unrelated Rust/Go caches. Historical repository cache pressure remains; no other PR's caches were deleted.
  • Reuse local builds only when input/dependency/environment hashes and complete emitted output hashes match a successful build. Include ignored dotenv files for all current Vite envDirs and symlink target bytes. Invalidate on additions/deletions, missing/tampered chunks, version/channel/flavor changes and failures, without persisting plaintext environment values.
  • Avoid duplicate API compilation and duplicate full builds for signed dual-architecture macOS packages; retain architecture preparation, signatures, smoke gates and size checks.
  • Make Settings smoke's long verification/evidence steps cancellable while retaining evidence on ordinary failures.

Tests and limitations

  • Clean isolated npm ci; 199 workflow contract tests, 10 build-reuse regressions, 14 Kun runner tests and 20 Settings geometry tests passed. Packaging contracts: 118 passed with one existing platform skip. Complete application build and unchanged-repeat reuse both succeeded.
  • Actual Vitest BaseSequencer coverage: GUI 2,266 files => 567/567/566/566; ordinary Kun 1,688 files => 422/422/422/422 plus the isolated large-history test; no overlaps or omissions.
  • Targeted ESLint, file-size and whitespace checks passed. Changed workflows pass actionlint except its outdated schema for concurrency.queue; the field is documented by current GitHub Actions and covered by workflow contracts.
  • The real OS credential probe remains explicit manual opt-in. No production signing, notarization, release publication or merge was triggered. Documentation-only behavior is covered by the gate contract tests; no extra documentation-only probe PR was created.
  • PR wall time is measured from run creation to the last job completion. Shorter wall time is not the same as an equal reduction in aggregate runner minutes.

Integration after #1445

Integrated actual develop merge a1d4e82, including #1445 update repair and all current pet fixes. Required Windows recovery, authentic cross-version normal/busy/rollback, candidate old-GUI pending protection and strict native finalization matrices remain required by PR gate. Same-run package/source provenance and complete script-test union are retained. Added an explicit contract guarding these integration requirements.

Independent review cleared exact tree a7bacf0564f64ea274b8cb94febb2088927c5ac5 (local b1ce5af0). Root verified uploaded tree and exact parents original a0afddb + actual develop a1d4e82. Focused CI contracts 33/33; packaging 119 passed/2 platform skips; Kun scripts 14/14; pet preview 4/4; lint, file-line and diff checks passed. Workflow suite 249/250, with one local sandbox Unix-socket EPERM failure; no test assertion removed. Independent review also ran 42 focused contracts successfully.

Fresh full CI for the integrated head is pending. Prior performance and green-check results above remain historical; this version must demonstrate all newly retained native update gates before merge. No release or deployment.

Refreshed develop integration

Head 1a009c9 passed all ten workflows, all eight GUI/Kun shards, scripts/extensions, native lease tests, packaging and genuine required pending-protection/finalization plus normal/busy/rollback (PR Checks 41487524560). Workspace Windows passed one scoped retry after its unchanged ~100ms fixture poll timed out; no assertions were weakened. Fresh native evidence artifacts: prepared 13165049105, standard 13166542597.

Before merge, develop advanced to 3c5f3ad, including an installer abort-path old-app relaunch and pet protocol/CSP updates. All 11 upstream files were integrated verbatim; the same 16-file CI optimization diff and required gates remain. Independent review cleared frozen tree 4b4d517f66b593ab39753005197b3fbe625d06d7 (local 22357cc7). 52 focused contracts and 10 focused Vitest tests passed; 4 Windows-only tests and Windows syntax were explicitly not run locally. Lint/line/diff checks passed. Because installer behavior changed, fresh full/native CI is required for this head; earlier green checks are not reused as certification.

Final integrated validation

Exact head 3d78d0f passed all ten workflows on their first attempt, including PR Checks 41497803508 and PR gate. All eight GUI/Kun shards, extension/script suites, four platform packages/handoffs and native workflows executed successfully. Fresh Windows native lease cases ran; required prepared protection/finalization and normal/busy/rollback passed with verified same-run package provenance and no cleanup errors.

Required prepared artifact: https://github.com/KunAgent/Kun/actions/runs/41497803508/artifacts/13170737441
Normal/busy/rollback artifact: https://github.com/KunAgent/Kun/actions/runs/41497803508/artifacts/13171211207

The latest validation includes the new develop installer abort behavior. Base was rechecked at 3c5f3ad before merge. This certifies the retained tests and current integrated behavior, not a fixed wall-time guarantee or resolution of the originally unreproduced #1421 stall. No release/deployment was performed.

@XingYu-Zhong
XingYu-Zhong merged commit a55e11d into develop Nov 2, 2026
36 checks passed
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