feat(test-suite): replace fhevm bash cli with Bun runtime#2066
feat(test-suite): replace fhevm bash cli with Bun runtime#2066
Conversation
🧪 CI InsightsHere's what we observed from your CI run for 0dbf663. 🟢 All jobs passed!But CI Insights is watching 👀 |
7408594 to
a651dc5
Compare
eudelins-zama
left a comment
There was a problem hiding this comment.
Just a small note to say it would be nice to merge this feature branch first to avoid handling conflicts with this one 😇
|
@claude /pr-review |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
4b82c14 to
8fce5b0
Compare
PR Review: feat(test-suite): replace fhevm bash cli with Bun runtime
Overall AssessmentThis is an impressive piece of infrastructure engineering. The Bun-native TypeScript CLI is a significant upgrade over the legacy bash scripts, with clean architecture, strong type safety, and comprehensive test coverage. The code is well-structured with good separation of concerns across All 7 issues from the previous review have been addressed:
Additionally, the 🟢 No High-Confidence Bugs FoundAfter thorough analysis across all source files, no runtime bugs were identified at high confidence. Key areas verified:
🟡 Nit:
|
|
Opened a sacrificial draft PR to exercise the merge-queue-style E2E orchestration on the same head commit as this PR: #2087 It is draft-only and should not be merged. Once we have the workflow signal, we can close it. |
Replace the 500-line bash fhevm-cli with a structured Bun/TypeScript implementation. The new CLI resolves version bundles from GitHub releases or GitOps branches, generates compose overrides and env files under .fhevm/, and boots the stack through a 13-step pipeline with resume support. Key modules: - versions.ts: resolve targets (latest-main, latest-release, gitops) - artifacts.ts: compose/env generation, local build isolation - runtime.ts: boot pipeline, test runner, pause/unpause - compat.ts: legacy CLI flag injection for older image versions - cli.test.ts: unit tests for version resolution, compat, layout Local builds use :fhevm-local image tags to avoid overwriting registry images. Services sharing an image tag are deduplicated before buildx.
aab6a5e to
fcff473
Compare
Closes https://github.com/zama-ai/fhevm-internal/issues/1042
Summary
Replace the legacy
test-suite/fhevm/fhevm-clibash flow with a Bun-native TypeScript CLI that keeps runtime state under.fhevmand makes local stack workflows explicit, deterministic, resumable, and compatible with the current simple-ACL era.What This PR Fixes
The old bash flow worked, but too much of the system lived in operator memory.
This PR makes these workflows first-class:
latest-main,latest-release, an exact supported built SHA, or a GitOps network targetConcretely, it removes these bash-era pain points:
Architecture
What Changed
fhevm-clientrypoint with a thin Bun launcher and Bun-native TS implementationlatest-mainlatest-releaseshadevnettestnetmainnetlatest-mainby walking backzama-ai/fhevm/mainuntil a complete short-SHA image bundle exists, but only at or after the simple-ACL floor803f104--target sha --sha <git-sha>modern-only too:main803f104.fhevmcoprocessorkms-connectorgateway-contractshost-contractstest-suitecoprocessor,kms-connector,test-suite--override allas a thin alias for all full-group local overridesupgrade <group>for active runtime overrides only:coprocessor,kms-connector,test-suiteupgraderestart runtime services only and skip one-shot DB migration services--resume/--from-stepdeployas a pure alias forupdoctorin favor ofup --dry-runfhevm-cli testalways run with--no-compilegh, missing auth, and rate limiting.fhevm/envand.fhevm/composeartifacts fromstate.jsonbefore resume/upgrade/teardown.fhevmstate on disk when teardown fails so cleanup can be retriedimage_mode=registry|workspaceandoverride=...dispatch semanticsimage_mode=registry#2072, gate simple-ACL compat explicitly:latest-main/shaMULTICHAIN_ACL_ADDRESSrequirement for full modern workspace protocol overrides803f104stacksPROTOCOL_PAYMENT_ADDRESS, not a stale pre-deploy addressImportant Invariants
latest-mainandshaare modern-only after the simple-ACL cutoverCompatibility Handling
This PR keeps explicit compatibility only where supported targets still need it:
latest-mainandshaare modern-only once resolution enforces the simple-ACL floorCI Changes
test-suite-e2e-tests.ymlto boot with the Bun CLItest-suite-e2e-operators-tests.ymlto boot with the Bun CLIimage_mode=registryimage_mode=workspaceoverride=...registry*_VERSIONenvironment overridesValidation
bun run checkbun test(98 tests)fcff4739:upgrade coprocessorrebuilt V1 -> V2 from unstaged local changes and surfaced the new marker in runtime logsworkspace + override=allpassed on supported heads#2087passed after simple-ACL follow-ups