Skip to content

Commit 7b153f4

Browse files
committed
docs(test-suite): document env var version override mechanism
The CLI overlays *_VERSION env vars onto resolved bundles, which is how the merge queue workflow injects SHA-tagged images. This was undocumented.
1 parent 9dd0b75 commit 7b153f4

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

test-suite/fhevm/ARCHITECTURE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ flowchart TD
4545
L --> D
4646
```
4747

48+
## Version Override (CI Integration)
49+
50+
After resolving a target bundle, `applyVersionEnvOverrides` overlays any matching `*_VERSION`
51+
environment variables onto the bundle. This is the mechanism CI uses:
52+
53+
```
54+
resolve target (e.g. latest-release)
55+
→ baseline bundle with release tag for all repo-owned packages
56+
→ applyVersionEnvOverrides(bundle, process.env)
57+
→ env vars like COPROCESSOR_HOST_LISTENER_VERSION=<sha> replace baseline versions
58+
→ lock file records overrides in its "sources" field
59+
```
60+
61+
The merge queue workflow (`test-suite-orchestrate-e2e-tests.yml`) builds Docker images tagged
62+
with the PR's HEAD SHA, exports them as env vars, then calls `./fhevm-cli up --target latest-release`.
63+
The target provides companion defaults (CORE_VERSION, RELAYER_VERSION); the env vars provide
64+
the SHA-tagged images for every component built from the PR.
65+
4866
## Notes
4967

5068
- Version selection is explicit. The CLI does not silently use a vague "latest".

test-suite/fhevm/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,53 @@ bun test
4545

4646
Only `devnet`, `testnet`, and `mainnet` resolve from GitOps. Non-network targets do not.
4747

48+
## Version Override via Environment Variables
49+
50+
After resolving a target bundle, the CLI applies **environment variable overrides**: any
51+
`*_VERSION` env var that matches a key in the resolved bundle replaces that version.
52+
53+
This is how CI works. The merge queue workflow:
54+
55+
1. Builds Docker images tagged with the PR's HEAD SHA (e.g., `abc1234`)
56+
2. Sets env vars like `COPROCESSOR_HOST_LISTENER_VERSION=abc1234`
57+
3. Runs `./fhevm-cli up --target latest-release`
58+
59+
The CLI resolves `latest-release` as the baseline (providing companion versions like
60+
`CORE_VERSION` and `RELAYER_VERSION` that aren't built from this repo), then overlays the
61+
SHA-tagged env vars for every component that was built from the PR.
62+
63+
Supported override keys (any subset):
64+
65+
```
66+
GATEWAY_VERSION
67+
HOST_VERSION
68+
COPROCESSOR_DB_MIGRATION_VERSION
69+
COPROCESSOR_HOST_LISTENER_VERSION
70+
COPROCESSOR_GW_LISTENER_VERSION
71+
COPROCESSOR_TX_SENDER_VERSION
72+
COPROCESSOR_TFHE_WORKER_VERSION
73+
COPROCESSOR_ZKPROOF_WORKER_VERSION
74+
COPROCESSOR_SNS_WORKER_VERSION
75+
CONNECTOR_DB_MIGRATION_VERSION
76+
CONNECTOR_GW_LISTENER_VERSION
77+
CONNECTOR_KMS_WORKER_VERSION
78+
CONNECTOR_TX_SENDER_VERSION
79+
CORE_VERSION
80+
RELAYER_VERSION
81+
RELAYER_MIGRATE_VERSION
82+
TEST_SUITE_VERSION
83+
```
84+
85+
Example — test a local coprocessor image without `--override`:
86+
87+
```sh
88+
COPROCESSOR_HOST_LISTENER_VERSION=abc1234 \
89+
COPROCESSOR_TFHE_WORKER_VERSION=abc1234 \
90+
./fhevm-cli up --target latest-release
91+
```
92+
93+
The resolved lock file records which keys were overridden in its `sources` field.
94+
4895
## Main Commands
4996

5097
```sh

0 commit comments

Comments
 (0)