feat(dfx-orbit,wallet): support --wasm-memory-persistence for external canister upgrades#642
Closed
aterga wants to merge 1 commit into
Closed
feat(dfx-orbit,wallet): support --wasm-memory-persistence for external canister upgrades#642aterga wants to merge 1 commit into
aterga wants to merge 1 commit into
Conversation
…l canister upgrades Expose the wasm_memory_persistence upgrade option (added to the station API in #634) on the two client surfaces that create ChangeExternalCanister requests. dfx-orbit CLI: - `request canister install --mode upgrade` gains `--wasm-memory-persistence <keep|replace>` and `--skip-pre-upgrade`. Both are only valid with `--mode upgrade` and are rejected otherwise. - When neither flag is set the request is built as Upgrade(None) so it matches requests created without the feature; `verify` now compares the full upgrade options and the change operation display shows them. - Unit tests cover mode building/validation, plus an integration test that asserts the `keep` option round-trips through the station. Wallet Install screen: - The upgrade mode now shows a "Wasm memory persistence" select (keep/replace, clearable) and a "Skip pre-upgrade hook" checkbox, wired into the CanisterInstallMode.upgrade options. - The options collapse back to `{ upgrade: [] }` when unset, matching the CLI, and the mode select stays selected once options are attached. - Locale strings added for en/fr/pt; component and form tests added. `keep` is required for Motoko canisters that use Enhanced Orthogonal Persistence; without it the IC clears their main memory on upgrade. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TB34uukEX3a8qNTZi5HpH1
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.
Summary
The station API gained a
wasm_memory_persistenceupgrade option in #634, but the two clients that createChangeExternalCanisterrequests — thedfx-orbitCLI and the wallet Install screen — did not expose it (#634 explicitly left this as a follow-up). This PR wires it through both, along with its siblingskip_pre_upgrade, which live in the sameCanisterInstallMode::upgradeoptions record.wasm_memory_persistence = keepis required for Motoko canisters that use Enhanced Orthogonal Persistence; without it the IC clears their main memory on upgrade.skip_pre_upgradeis useful for recovery upgrades where the existingpre_upgradehook traps.What changed
dfx-orbit CLI (
tools/dfx-orbit)request canister install --mode upgradegains--wasm-memory-persistence <keep|replace>and--skip-pre-upgrade.--mode upgrade; combining them withinstall/reinstallis rejected with a clear error.Upgrade(None), so it is byte-for-byte identical to a request created without the feature (backward compatible).verifynow compares the full upgrade options (not just the coarse install mode), and the change-operation display prints the persistence mode / skip flag when present.installintegration-test struct literal is updated for the new fields.Wallet Install screen (
apps/wallet)CanisterInstallMode.upgrade.{ upgrade: [] }when unset, matching the CLI'sUpgrade(None).upgradevariant so it stays selected once options are attached (Vuetify matches items by deep equality).WasmMemoryPersistencetype alias is added totypes/station.types.ts(validated wherever it is assigned into aCanisterInstallMode).en/fr/pt.Test plan
apps/wallet:vue-tsc --noEmitclean;vitest run— 466/466 tests pass (incl. newCanisterInstallFormcases covering show/hide, write-through, and collapse-on-clear); eslint + prettier clean.tools/dfx-orbit: new unit tests for install-mode building/validation andinstall_modes_match; new integration test asserting thekeepoption round-trips through the station and thatverifyaccepts it.rustfmt --checkclean.cargo build/test/clippyfor the Rust crates were not run in the authoring environment — the sandbox's egress policy blocks a transitive git dependency (dfinity/response-verification). CI will exercise them.Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01TB34uukEX3a8qNTZi5HpH1
Generated by Claude Code