chore: migrate rust/daily_planner to icp-cli#1403
Merged
Merged
Conversation
e99fe03 to
94bf541
Compare
94bf541 to
8f077c8
Compare
Replace dfx.json with icp.yaml, update frontend to use @icp-sdk/bindgen and actor.js pattern, update backend HTTP outcalls to ic-cdk 0.20 API, add Makefile with tests, and add rust-daily_planner CI job. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…p.yaml
- ic_cdk::management_canister was moved to ic-cdk-management-canister in ic-cdk 0.20
- Add ic-cdk-management-canister = '0.1.1' to Cargo.toml
- Update import to use ic_cdk_management_canister::{http_request, ...}
- Remove redundant networks block from icp.yaml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d!() instead With candid: specified, the recipe does not run candid-extractor and the candid:service metadata is not embedded, causing icp canister call to output raw bytes for update calls. Let export_candid!() + candid-extractor handle the metadata embedding as in other examples. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rust's Result<T,E> serializes to variant { Ok : text; Err : text } (capital)
while the .did had lowercase ok/err (Motoko convention). Update both the
.did file and the test assertion to use capital Ok/Err.
This also explains the previous raw bytes issue: the embedded Candid (from
backend.did with lowercase ok/err) didn't match the actual response (with
capital Ok/Err), causing icp canister call decoding to fail.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d-extractor Replaces the manually written .did (which had wrong lowercase ok/err from Motoko convention) with the correctly generated interface from the compiled WASM. Uses a Result type alias and correct Ok/Err casing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… correct With the properly generated backend.did, the candid: field can correctly embed the interface. The original failure was due to the wrong .did, not the candid: mechanism itself. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dates are stored in ISO format (e.g. '2024-01-15') but the prefix was
generated without zero-padding ('2024-1-'), causing get_month_data to
return empty results for single-digit months.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without await, hideLoading() fired before the state update completed, and the UI didn't re-render with the fetched on_this_day data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The @icp-sdk/bindgen converts Candid opt T to T | null (not [] | [T]).
Two bugs caused by the old @dfinity/agent array convention:
1. get_day_data: data?.length > 0 ? data[0] always fell back to the
default since DayDataEntry | null has no .length → use data ?? {...}
2. on_this_day: checked .length > 0 and indexed [0] but OnThisDay |
undefined is a plain object → use on_this_day ? and direct access
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- https-outcalls-how-to-use → docs.internetcomputer.org/guides/backends/https-outcalls - cost calculator URL: icp0.io → icp.net Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
raymondk
approved these changes
Jun 19, 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
rust/daily_plannerfrom dfx to icp-cli.Removed:
dfx.json,BUILD.md,.devcontainer/Changed:
vite-plugin-environmentto@icp-sdk/bindgen+actor.js; fixed opt-type handling (@icp-sdk/bindgenreturnsT | null, not[] | [T]as in the old@dfinity/agentconvention)ic_cdk::api::management_canistertoic_cdk_management_canister(new separate crateic-cdk-management-canister = "0.1.1"required by ic-cdk 0.20)get_month_datazero-pads month to match ISO date keys (pre-existing bug surfaced by tests)Added:
icp.yamlwith@dfinity/rust@v3.3.0(backend, with committedbackend.didgenerated viacandid-extractor) and@dfinity/asset-canister@v2.2.1(frontend)test.shwith 6 tests covering all public canister methodsrust-daily_plannerCI job indaily_planner.ymlusingicp-dev-env-rust:1.0.1Test plan
icp network start -d && icp deploy && bash test.shpassesrust-daily_plannerjob passes🤖 Generated with Claude Code