Skip to content

chore(tooling): migrate from dfx to icp-cli - #498

Merged
yhabib merged 9 commits into
mainfrom
chore/migrate-dfx-to-icp-cli
Oct 16, 2026
Merged

yhabib merged 9 commits into
mainfrom
chore/migrate-dfx-to-icp-cli

Conversation

@yhabib

@yhabib yhabib commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

dfx is deprecated. Its local II (dfx 0.31.0) has no app_prepare_delegation, so it blocks the @icp-sdk/auth 10 upgrade. This replaces #489.

Changes

  • Replaced dfx.json and canister_ids.json with icp.yaml and .icp/data/mappings/ic.ids.json, and added @icp-sdk/icp-cli as a devDependency.
  • Switched start-pocket-ic.sh to icp network start, with a new e2e environment that has no update delay.
  • Added scripts/create-local-canister.mjs to create the backend with its mainnet ID through the PocketIC REST API.
  • Replaced dfx generate with @icp-sdk/bindgen (npm run generate:candid-bindings).
  • Pointed local login at the II frontend canister uqzsh-gqaaa-aaaaq-qaada-cai, and updated the e2e login for its dummy-auth seed prompt.
  • Moved the mainnet queries in release-prod to icp, and kept dfx-orbit for the Orbit request (Support icp-cli orbit#635).

dfx is deprecated. Its local II also lacks the app delegation methods
that @icp-sdk/auth 10 needs.

- Replace dfx.json and canister_ids.json with icp.yaml and
  .icp/data/mappings/ic.ids.json.
- Run the local network with icp-cli (devDependency). The network has
  NNS, SNS and II. Add an e2e network without the update delay.
- Create the local backend with its mainnet ID through the PocketIC
  REST API, because icp-cli has no --specified-id.
- Generate the backend declarations with @icp-sdk/bindgen.
- Use the II frontend canister for local login. Answer the dummy-auth
  seed prompt in the e2e login.
- Move the mainnet queries in release-prod to icp. dfx-orbit still
  needs a dfx identity.
@yhabib
yhabib requested a review from a team as a code owner October 14, 2026 06:30
Copilot AI balanced review requested due to automatic review settings October 14, 2026 06:30
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

📊 Build Bundle Stats

The latest build generated the following assets:

dist/index.html                                           2.55 kB │ gzip:   0.87 kB
dist/assets/index-VUlzZ8kX.css                          137.47 kB │ gzip:  22.41 kB
dist/assets/icpLedger-6LcfxDkH.js                         0.23 kB │ gzip:   0.21 kB
dist/assets/Skeleton-DcDWzMtQ.js                          0.44 kB │ gzip:   0.32 kB
dist/assets/useTvlValue-B6XGQJ5W.js                       0.60 kB │ gzip:   0.41 kB
dist/assets/SensitiveValue-CYAqxy0W.js                    0.61 kB │ gzip:   0.42 kB
dist/assets/PageHeader-Czh9Jiub.js                        0.77 kB │ gzip:   0.45 kB
dist/assets/CertifiedBadge-BTEE_I0s.js                    0.81 kB │ gzip:   0.48 kB
dist/assets/useGovernanceKnownNeurons-gquyzwt9.js         0.90 kB │ gzip:   0.58 kB
dist/assets/numbers-C-c1pUtR.js                           0.96 kB │ gzip:   0.51 kB
dist/assets/useIcpIndex-D85qJCPu.js                       1.09 kB │ gzip:   0.64 kB
dist/assets/rolldown-runtime-CMxvf4Kt.js                  1.21 kB │ gzip:   0.67 kB
dist/assets/EmptyActionState-BuFxYhQK.js                  1.61 kB │ gzip:   0.83 kB
dist/assets/AnimatedNumber-hnv-YSGt.js                    1.96 kB │ gzip:   1.12 kB
dist/assets/useIcpIndexTransactionsPolling-DJfcKOrv.js    2.06 kB │ gzip:   1.11 kB
dist/assets/useGovernanceAppCanister-BTZdvUTA.js          2.08 kB │ gzip:   1.01 kB
dist/assets/addressBook-W5vZ5nwM.js                       2.14 kB │ gzip:   1.20 kB
dist/assets/advancedFeatures-DcRVatsw.js                  2.29 kB │ gzip:   1.08 kB
dist/assets/ToggleGroup-B9SrJJy7.js                       4.71 kB │ gzip:   1.76 kB
dist/assets/tickers-CHx8SbEi.js                           6.05 kB │ gzip:   2.61 kB
dist/assets/QueryStates-v8JxYxwZ.js                       7.17 kB │ gzip:   2.64 kB
dist/assets/routes-Db0fW_dR.js                            7.48 kB │ gzip:   2.49 kB
dist/assets/AlertDialog-CMnpARXQ.js                       7.80 kB │ gzip:   2.39 kB
dist/assets/TopicFollowingAccordion-BiiP8Nbz.js           8.55 kB │ gzip:   3.42 kB
dist/assets/MutationDialog-CrmAogwO.js                    9.70 kB │ gzip:   3.54 kB
dist/assets/spamFilter-2ZIbt0lb.js                       10.79 kB │ gzip:   4.70 kB
dist/assets/_id-Co41fH5E.js                              14.49 kB │ gzip:   4.46 kB
dist/assets/AmountInput-BWfjciLK.js                      14.65 kB │ gzip:   5.99 kB
dist/assets/_auth-2hcMALIA.js                            18.75 kB │ gzip:   6.92 kB
dist/assets/GetTokens-Bj9WgHcl.js                        21.87 kB │ gzip:   8.19 kB
dist/assets/accounts-B7dhgF6E.js                         23.68 kB │ gzip:   8.27 kB
dist/assets/SendICPButton-LFFqB2VL.js                    36.09 kB │ gzip:  13.22 kB
dist/assets/settings-DwpaCJXY.js                         40.29 kB │ gzip:  11.72 kB
dist/assets/dashboard-NkUzGr4v.js                        58.55 kB │ gzip:  18.08 kB
dist/assets/button-CmKmTL0B.js                           62.59 kB │ gzip:  21.31 kB
dist/assets/voting-BNtNf0tX.js                           68.98 kB │ gzip:  21.61 kB
dist/assets/vendor-md-CgrKzPDI.js                        73.29 kB │ gzip:  19.98 kB
dist/assets/neurons-DaEgAv0R.js                          76.95 kB │ gzip:  23.22 kB
dist/assets/neuronDetail-B88xw0tf.js                     87.09 kB │ gzip:  25.74 kB
dist/assets/index-B5BbUiZe.js                           102.74 kB │ gzip:  29.55 kB
dist/assets/vendor-jsqr-CLmE8syL.js                     129.98 kB │ gzip:  47.50 kB
dist/assets/vendor-tanstack-sp7xRh2L.js                 161.18 kB │ gzip:  49.34 kB
dist/assets/vendor-core-react-qLCIanUQ.js               189.81 kB │ gzip:  59.76 kB
dist/assets/vendor-recharts-Ydyhy8OZ.js                 280.27 kB │ gzip:  76.84 kB
dist/assets/vendor-icp-qGbRjjIG.js                      411.81 kB │ gzip: 104.30 kB
dist/assets/vendor-libs-DR16ufqG.js                     583.65 kB │ gzip: 188.18 kB

@zeropath-ai

zeropath-ai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to a0da93a.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► .github/workflows/check.yaml
    Switch candid bindings generation command from dfx to npm run generate:candid-bindings
► .github/workflows/e2e.yml
    Add ICP_HOME_DIR and enable icp cli token usage in E2E workflow
► docker/Dockerfile.build
    Use generate:candid-bindings instead of dfx generate
► docker/Dockerfile.base
    Install libdbus-1-3 for icp-cli linkage
► scripts/start-pocket-ic.sh
    Improve shell options handling and environment support (local/e2e) and startup flow
► icp.yaml
    Add icp local/e2e networks and canister governance-app-backend wiring
► scripts/config.sh
    Update canister ID reference for Internet Identity to new value
► scripts/create-local-canister.mjs
    New script to create a local canister with a fixed ID via PocketIC REST API
► src/governance-app-frontend/package.json
    Add generate:candid-bindings script and include icp-cli in devDependencies
► src/governance-app-frontend/src/common/hooks/addressBook/useAddressBook.ts
    Update IDL type import path to backend.did
► src/governance-app-frontend/src/common/hooks/addressBook/useGovernanceAppCanister.ts
    Update idlFactory import path to backend.did and adjust export usage
► src/governance-app-frontend/src/common/hooks/addressBook/useSaveAddressBook.ts
    Update imported backend declarations path to backend.did
► src/governance-app-frontend/src/common/hooks/tickers/useExchangeRate.ts
    Update IcpExchangeRateResponse type import path to backend.did
► src/governance-app-frontend/src/common/hooks/tickers/useFiatExchangeRates.ts
    Update FiatExchangeRate type import path to backend.did
► src/governance-app-frontend/src/common/hooks/tickers/useIcpRateHistory.ts
    Update CachedRate type import path to backend.did
► src/governance-app-frontend/src/common/utils/addressBook.ts
    Update AddressType import path to backend.did
► src/governance-app-frontend/src/common/utils/errors/addressBook.ts
    Update SetAddressBookResponse import path to backend.did
► src/governance-app-frontend/src/features/account/components/SendICPButton.tsx
    Update NamedAddress import path to backend.did
► src/governance-app-frontend/src/features/addressBook/components/AddAddressModal.tsx
    Update AddressType and NamedAddress imports to backend.did
► src/governance-app-frontend/src/features/addressBook/components/AddressBookModal.tsx
    Update AddressBook and NamedAddress imports to backend.did
► src/governance-app-frontend/src/features/addressBook/components/RemoveAddressConfirmation.tsx
    Update NamedAddress import to backend.did
► src/governance-app-frontend/tests/e2e/utils/login.ts
    Adjust II login flow to seed-based identity creation and updated button names
► src/governance-app-frontend/tests/fixtures/exchangeRate.ts
    Update IcpExchangeRateResponse import path to backend.did
► src/governance-app-frontend/vite.config.js
    Switch alias from governance-app-backend.did.js to backend.did.js and adjust replacement
► package.json (root)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

PocketIC 202 responses are resubmitted instead of polled, risking duplicate fixed-ID creation failures.

2 open findings
What changed in this PR

Migrates local development, bindings generation, CI, and release queries from dfx to icp-cli.

Changes:

  • Adds icp-cli network configuration and fixed-ID local canister creation.
  • Replaces dfx-generated bindings with @icp-sdk/bindgen.
  • Updates local II login, CI, documentation, and release tooling.
File Description
.github/​workflows/​check.yaml Generates bindings with bindgen.
.github/​workflows/​e2e.yml Runs and caches icp-cli networks.
.gitignore Ignores icp-cli runtime state.
.icp/​data/​mappings/​ic.ids.json Maps the production canister ID.
canister_ids.json Removes the dfx ID mapping.
dfx.json Removes dfx project configuration.
docker/​Dockerfile.build Uses bindgen during builds.
docs/​DEVELOP.md Documents the new local workflow.
icp.yaml Defines networks, environments, and backend builds.
package-lock.json Locks icp-cli and bindgen dependencies.
package.json Adds icp-cli and binding generation.
scripts/​config.sh Updates the local II canister ID.
scripts/​create-local-canister.mjs Creates a fixed-ID PocketIC canister.
scripts/​release-prod Uses icp-cli for mainnet queries.
scripts/​start-pocket-ic.sh Starts and deploys to managed networks.
src/​governance-app-frontend/​package.json Adds the bindgen command and dependency.
src/​governance-app-frontend/​vite.config.js Updates the generated IDL alias.
…/​tests/​e2e/​utils/​login.ts Supports dummy-auth II login.
…/​tests/​fixtures/​exchangeRate.ts Updates generated type imports.
…/​components/​SendICPButton.tsx Updates generated type imports.
…/​components/​AddAddressModal.tsx Updates generated type imports.
…/​components/​AddressBookEntry.tsx Updates generated type imports.
…/​components/​AddressBookModal.tsx Updates generated type imports.
…/​components/​AddressBookSelect.tsx Updates generated type imports.
…/​components/​RemoveAddressConfirmation.tsx Updates generated type imports.
…/​hooks/​addressBook/​useAddressBook.ts Updates generated service imports.
…/​hooks/​addressBook/​useGovernanceAppCanister.ts Uses the renamed IDL factory.
…/​hooks/​addressBook/​useSaveAddressBook.ts Updates generated type imports.
…/​hooks/​tickers/​useExchangeRate.ts Updates generated type imports.
…/​hooks/​tickers/​useFiatExchangeRates.ts Updates generated type imports.
…/​hooks/​tickers/​useIcpRateHistory.ts Updates generated type imports.
…/​utils/​addressBook.ts Updates generated type imports.
…/​utils/​errors/​addressBook.ts Updates generated type imports.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/create-local-canister.mjs Resolved
Comment thread scripts/start-pocket-ic.sh Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The migration spans local networking, PocketIC provisioning, CI, and production release tooling whose end-to-end behavior requires final human validation.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

Copilot AI previously approved these changes Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The migration is cohesive, and the tooling, generated imports, CI workflows, and documentation remain aligned.

0 open findings

🧠 Review effort: Balanced

@yhabib
yhabib requested a balanced review from Copilot October 14, 2026 11:49
Copilot AI dismissed their stale review, a newer Copilot review was requested October 14, 2026 11:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The migration changes local networking, custom PocketIC provisioning, CI, and production release tooling and warrants final human verification.

0 open findings

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The migration changes local networking, direct PocketIC provisioning, CI infrastructure, and production release queries, warranting final human validation.

0 open findings

🧠 Review effort: Balanced

…igrate-dfx-to-icp-cli

# Conflicts:
#	src/governance-app-frontend/src/common/hooks/addressBook/useSaveAddressBook.ts
…icp-cli

# Conflicts:
#	src/governance-app-frontend/src/features/addressBook/components/AddressBookSelect.tsx

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't review everything here, but Claude says this is basically fine. Hence, I approve.

Comment thread docs/DEVELOP.md Resolved
Comment thread docs/DEVELOP.md Resolved
Comment thread docs/DEVELOP.md Resolved
Comment thread .github/workflows/e2e.yml Resolved
Comment thread .github/workflows/e2e.yml Resolved
Comment thread scripts/release-prod Resolved
Comment thread scripts/start-pocket-ic.sh Resolved
Comment thread scripts/start-pocket-ic.sh Resolved
AddressBook,
NamedAddress,
} from '@declarations/governance-app-backend/governance-app-backend.did';
import type { AddressBook, NamedAddress } from '@declarations/governance-app-backend/backend.did';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wanted to, I think you could avoid all this churn by renaming the .did file to governance-app-backend.did.

Comment thread package.json Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Network provisioning, authentication, and release integration still need end-to-end validation and human review.

1 open finding

🧠 Review effort: Balanced

Comment thread scripts/start-pocket-ic.sh Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Fixed-ID PocketIC initialization, local authentication, and production queries need integration validation with the pinned tooling before human approval.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@yhabib
yhabib merged commit b700ac7 into main Oct 16, 2026
12 checks passed
@yhabib
yhabib deleted the chore/migrate-dfx-to-icp-cli branch October 16, 2026 23:13
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.

3 participants