chore: demo asset-canister sync plugin recipe (do not merge)#285
Draft
lwshang wants to merge 1 commit into
Draft
chore: demo asset-canister sync plugin recipe (do not merge)#285lwshang wants to merge 1 commit into
lwshang wants to merge 1 commit into
Conversation
Add a commented-out recipe URL line pointing at the asset_plugin branch of icp-cli-recipes so reviewers can switch the frontend canister's sync mechanism from the built-in assets step to the plugin without changing the canister wasm.
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.
Why this branch is forked 3 commits behind
mainThis demo needs a starting point where
icp.yamlstill uses the versioned recipe (type: "@dfinity/asset-canister@v2.1.0"), since the whole point is to demonstrate upgrading from that. On currentmain, #280 already migrated the frontend canister away from the versioned recipe to the fully-expandedbuild/syncform with the snapshot wasm and sync plugin, so there is no versioned recipe left to upgrade from there.To reproduce the real upgrade path an existing user would take, this branch is forked from
4d1be64(3 commits behindmain, immediately before #280), whereicp.yamlstill pins the versioned recipe.What this demonstrates
An existing project pinned to
@dfinity/asset-canister@v2.1.0can upgrade to a recipe version that swaps the sync step from the built-intype: assetsmechanism totype: plugin, without changing the canister wasm. The canister stays the legacyassetstoragecanister; only the sync mechanism changes. This eases the upgrade path for existing asset-canister users oncetype: assetssync is dropped in the upcoming icp-cli release.See dfinity/icp-cli-recipes#28 for the full rationale and the pinned plugin wasm details.
The change
icp.yamlkeeps the original versioned recipe line and adds a commented-out URL line pointing at the recipe PR branch:How to run the demo
Deploy with the old recipe (
type: "@dfinity/asset-canister@v2.1.0"active, as committed):This deploys the frontend asset canister using the built-in
type: assetssync.Switch to the new recipe by editing
icp.yaml:@dfinity/asset-canister@v2.1.0line)Redeploy:
The same canister wasm is reused and the sync now runs through the plugin. A successful redeploy demonstrates the upgrade is fully compatible.