test(deploy-server): two-Anvil e2e proof + document deploymentParameters precedence (closes #139) - #148
Merged
Conversation
…cs (#139) Add a non-mocked end-to-end proof that /api/deploy?network=<name> deploys independently to two real Anvil chains, that a network's server-side deploymentParameters override any spec.parameters value the studio bakes in via its client-side networkOverrides, and that per-network journals resume idempotently without cross-network interference. Isolate the anvil-backed e2e suite from the fast gate via a dedicated vitest.e2e.config.ts (mirroring packages/core), and document the deploymentParameters-over-spec.parameters precedence in server.ts and networks.ts's doc comments. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
robercano
approved these changes
Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #139 — multi-network deploys end-to-end
This completes the acceptance criterion for #139. The two prior merged PRs built the machinery:
networks.ts),?network=<name>on/api/simulate,/api/deploy,GET /api/deployment, per-network deployment/journal dirs.GET /api/networksdiscovery, toolbar network selector, unified with the studio's client-sidenetworkOverrides.#145 deliberately left #139 open on two remaining points. This PR resolves both.
1.
networkOverridesvs serverdeploymentParametersprecedence — decided, documented, and provenThe studio bakes its client-side per-network
networkOverridesintospec.parameters(a flat default map) at spec-generation time, so at the wire level a studio override arrives as aspec.parameters[name]default in the request body.handleDeploypasses each network's server-sidedeploymentParameters(keyed undermoduleId) tocore.deploy(). Core resolvesspec.parametersas IgnitiondefaultValues anddeploymentParameters[moduleId]as overrides that win (m.getParameter(name, defaultValue)+resolveSpec.ts'sbuildResolverParams).Decision: server-side per-network
deploymentParametersoverride anyspec.parametersvalue for the same name — including studio-bakednetworkOverrides. Trusted server config wins. This matches the existing security boundary (rpcUrl/deployer keys are server-only, never client-supplied) and is Ignition's own precedence. Documented inserver.ts(handleDeploy) andnetworks.ts(no runtime change — the precedence already held; this makes it explicit and adds an end-to-end proof).2. Automated two-network end-to-end integration test (stands in for the suggested live smoke test)
New non-mocked test
apps/deploy-server/test/e2e/multi-network.e2e.test.ts+ a local anvil harness. It spins up two real local Anvil instances, configures two networks (alpha,beta) each with its own RPC, deployer key, deployment dir, anddeploymentParameters, then drives the real deploy-server HTTP API end-to-end (no mocked core). It asserts, on-chain viahasRole(DEFAULT_ADMIN_ROLE, …):alpharesumes to the same address without touchingbeta);adminholds the role on each network and the spec-default (studio-bakednetworkOverrides) address does not — proving serverdeploymentParametersoverride client-suppliedspec.parameters.This is the same real-Anvil pattern already used in
packages/core's e2e suite. Because a headless agent cannot perform an interactive studio click-through, this automated, deterministic, chain-level assertion is a stronger and repeatable substitute for the manual two-Anvil smoke test suggested in #145: it exercises the identical code path (studio → HTTP API → core → real chain) and verifies the on-chain outcome, not just wiring.The e2e is isolated from the fast gate: a new
vitest.config.tsexclude keeps it out ofpnpm test/pnpm coverage(so anvil-less CI stays green), and it runs via the newpnpm -F @redeploy/deploy-server test:e2e(vitest.e2e.config.ts,pool: forks, 120s/60s timeouts).Scope / boundary
All changes are confined to
apps/deploy-server/(module boundary respected).server.ts/networks.tsedits are doc-comments only.Gates
test: PASS (211 tests; e2e excluded)src/**89.65% stmts (≥80 threshold)test:e2e, two live Anvil chains): ran (not skipped) and PASSED — 1 test, multi-network deploy proven end-to-endforge testwas not run:contracts/libis absent in the isolated worktree (known pre-existing sandbox limitation, same as feat(deploy-server): server-side multi-network support #143/feat(studio): network selector + GET /api/networks for multi-network deploys (#139) #145) — not a regression from this change.Reviews
Consensus (all lenses) — correctness ✅, tests ✅, security ✅, performance ✅. Correctness independently confirmed the precedence claim against
compile.ts/deploy.tsand that the test is non-vacuous; security confirmed the precedence doc reinforces the trusted-config boundary and only anvil dev keys / temp files are used.🤖 Generated with Claude Code