Skip to content

chore: migrate rust/canister_logs to icp-cli#1407

Draft
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-rust-canister-logs-to-icp-cli
Draft

chore: migrate rust/canister_logs to icp-cli#1407
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-rust-canister-logs-to-icp-cli

Conversation

@marc0olo

Copy link
Copy Markdown
Member

Summary

  • Replaces dfx.json with icp.yaml using @dfinity/rust@v3.3.0 (backend-only, no package field needed)
  • Moves src/lib.rsbackend/lib.rs; root Cargo.toml becomes a workspace with members = ["backend"]
  • Upgrades Rust dependencies: ic-cdk 0.20, ic-cdk-timers 1.0, ic-cdk-management-canister 0.1.1
  • Replaces removed ic_cdk::api::management_canister with ic_cdk_management_canister::raw_rand
  • Adds Makefile with 11 numbered tests covering all public canister methods (print, print_query, trap, trap_query, panic, memory_oob, failed_unwrap, raw_rand, timer trap)
  • Rewrites README with icp-cli deploy/test instructions, preserving key behavioral explanation (update vs. non-replicated query log recording)
  • Adds rust-canister_logs CI job using icp-dev-env-rust:1.0.0 to the existing canister_logs.yml workflow
  • Deletes: dfx.json, BUILD.md, poll_logs.sh, canister_logs.did, .devcontainer/devcontainer.json, package-lock.json

Test plan

  • icp network start -d && icp deploy succeeds in rust/canister_logs
  • make test passes all 11 tests locally
  • CI rust-canister_logs job passes
  • icp canister logs backend shows timer trap entries after 5 seconds
  • icp canister logs --follow backend streams logs in real time
  • Non-replicated query calls do NOT appear in canister logs (Tests 3 and 6)
  • Intentionally-trapping calls (trap, panic, memory_oob, failed_unwrap) do appear in logs despite returning errors

🤖 Generated with Claude Code

- Replace dfx.json with icp.yaml using @dfinity/rust@v3.3.0
- Move src/lib.rs → backend/lib.rs; add workspace Cargo.toml
- Upgrade dependencies: ic-cdk 0.20, ic-cdk-timers 1.0, ic-cdk-management-canister 0.1.1
- Replace ic_cdk::api::management_canister with ic_cdk_management_canister::raw_rand
- Add Makefile with 11 tests covering all public canister methods
- Rewrite README with icp-cli deploy/test instructions
- Add rust-canister_logs CI job (icp-dev-env-rust:1.0.0) to canister_logs.yml
- Delete dfx.json, BUILD.md, poll_logs.sh, canister_logs.did, .devcontainer/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant