Repository navigation
chore: migrate motoko/composite_query to icp-cli - #1382
Merged
Merged
Conversation
Replace dfx.json with icp.yaml, update mops.toml to moc 1.9.0 and core 2.5.0, move src/map/ to backend/, rename Map.mo to app.mo, add Makefile with test target, add CI workflow, and update README. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… from README Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…EADME Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Open with the core constraint: regular queries cannot call other canisters; composite queries lift this restriction - Explain why getUpdate exists: same operation as a comparison point (update call vs composite query, same result, different latency) - Add ASCII diagram of the key % 4 sharding to buckets - Move cycles note into the deploy section where it belongs - Add Candid regeneration section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t routing tests - Fix ASCII diagram: all bucket rows now start at the same column - Link to composite queries developer docs - Test 5 now uses keys 0-3 (each routes to a different bucket) instead of 0, 4, 8 (all in Bucket 0) — actually verifies cross-bucket routing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Migrates the motoko/composite_query example from dfx-based tooling to icp-cli, updating project configuration, CI, and documentation accordingly while keeping the example’s composite-query multi-canister architecture.
Changes:
- Replace
dfx.jsonwithicp.yaml, and updatemops.tomltoolchain/dependencies and moc args for the icp-cli workflow. - Update build/test automation to use
icpcommands and add atopuptarget for cycle replenishment. - Add a new GitHub Actions workflow for the example and remove the old dfx-based workflow; refresh README to match the new flow and explain composite queries.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| motoko/composite_query/README.md | Rewrites README to explain composite queries and updates command-line instructions for icp-cli. |
| motoko/composite_query/mops.toml | Bumps moc/core versions, adds --default-persistent-actors, and points the backend canister main to backend/app.mo. |
| motoko/composite_query/Makefile | Replaces dfx-based build/test with icp-cli calls and adds a topup target. |
| motoko/composite_query/icp.yaml | Adds icp-cli canister recipe using @dfinity/motoko@v5.0.0. |
| motoko/composite_query/dfx.json | Removes dfx project configuration. |
| motoko/composite_query/backend/Buckets.mo | Adds Bucket canister implementation and marks get as a query for composite-query routing. |
| motoko/composite_query/backend/app.mo | Adjusts actor persistence behavior to rely on --default-persistent-actors. |
| .github/workflows/motoko-composite-query-example.yaml | Removes the previous dfx-based CI workflow. |
| .github/workflows/composite_query.yml | Adds new CI workflow running in icp-dev-env-motoko container using icp-cli deploy + tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lwshang
approved these changes
Jun 15, 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.
Summary
Migrates
motoko/composite_queryfrom dfx to icp-cli.Code:
dfx.jsonwithicp.yamlusing@dfinity/motoko@v5.0.0mops.toml: moc 1.9.0, core 2.5.0,--default-persistent-actorssrc/map/Map.mo→backend/app.mo,src/map/Buckets.mo→backend/Buckets.mopersistentfrom the main actor (covered by--default-persistent-actors); keeppersistentonactor class Bucket(actor classes require the explicit keyword)Tests (
Makefile):put, compositeget,getUpdatecomparison, null for missing keyk % 4) to actually verify cross-bucket routing — the composite query must call the right child canister for all four bucketsDocs:
getUpdatealongsidegetas an intentional comparison (update call vs composite query, same result, different latency).github/workflows/composite_query.ymlusingicp-dev-env-motoko:0.3.2withicp deploy --cycles 30tdfx.jsonTest plan
icp network start -d && icp deploy --cycles 30t && make testpassesmake topupworks when canister runs low on cycles