Skip to content

feat(experimental): Customizations files - #574

Open
adamspofford-dfinity wants to merge 8 commits into
mainfrom
spofford/app-bundle-customize
Open

adamspofford-dfinity wants to merge 8 commits into
mainfrom
spofford/app-bundle-customize

Conversation

@adamspofford-dfinity

@adamspofford-dfinity adamspofford-dfinity commented May 27, 2026

Copy link
Copy Markdown
Contributor

A project can ship an icp_customize.yaml next to its manifest declaring what whoever deploys it should be asked for, and icp deploy --customize asks every question up front and then installs with the answers. An option either substitutes a Candid value into a field of the canister's init_args — addressed by arg index and field path, asked for at the declared type — or sets one of its environment variables, which needs no placeholder in the manifest. Options name canisters by store key, so a workspace declares its customizations once in the root project's file and can still reach a member's canister, and one option may name several canisters to be asked once and answered for all of them. icp project bundle packages the file and validates its references, so a bundled app prompts the same way wherever it is extracted. Without the flag the file is inert; --args/--args-file still outrank it, and init-arg options are skipped when they are given. The flag is hidden while the format settles.

# icp_customize.yaml
options:
  - canister: backend
    field_path: ".supply"
    candid_type: "nat64"
    description: "Initial token supply"

  - canister: [frontend, "services/open-crm:backend"]
    env: API_ENDPOINT
    description: "Upstream API base URL"

🤖 Generated with Claude Code

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.

Pull request overview

Adds support for project-level customization prompts driven by an icp_customize.yaml file, and ensures this customization manifest is preserved when projects are bundled so deployments can keep the same interactive customization behavior.

Changes:

  • Introduces operations::customize to load icp_customize.yaml, prompt for values, and substitute them into Candid init args.
  • Updates deploy to apply customization-derived init args with defined precedence relative to CLI --args/--args-file and manifest init_args.
  • Updates bundle to include icp_customize.yaml at the archive root and adds a regression test for this behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/icp-cli/tests/bundle_tests.rs Adds test asserting icp_customize.yaml is bundled verbatim at archive root.
crates/icp-cli/src/operations/mod.rs Registers the new customize operations module.
crates/icp-cli/src/operations/customize.rs Implements customize manifest parsing, interactive prompting, and init-args field substitution with unit tests.
crates/icp-cli/src/operations/bundle.rs Reads and appends icp_customize.yaml into the bundle archive and adds an error variant.
crates/icp-cli/src/commands/deploy.rs Collects customization overrides pre-build and applies them between CLI args and manifest init args.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/icp/src/operations/bundle.rs
Comment thread crates/icp-cli/src/commands/deploy.rs Outdated
Comment thread crates/icp-cli/src/operations/customize.rs Outdated
Comment thread crates/icp-cli/src/operations/customize.rs Outdated
Base automatically changed from spofford/app-bundle to main June 4, 2026 18:32
@adamspofford-dfinity
adamspofford-dfinity force-pushed the spofford/app-bundle-customize branch from 177d6de to 4c252f8 Compare August 31, 2026 18:06
…ustomize

main moved the operations into `crates/icp`, where nothing may touch the
terminal, so the customize module splits along that line: the file, the
substitution and the plan of what to ask stay in the operation, as
`icp::operations::customize`, while `icp deploy` asks the questions and
hands the answers to the deploy through `DeployParams`.
@adamspofford-dfinity
adamspofford-dfinity marked this pull request as ready for review September 18, 2026 21:47
@adamspofford-dfinity
adamspofford-dfinity requested a review from a team as a code owner September 18, 2026 21:47
@adamspofford-dfinity adamspofford-dfinity changed the title feat: Customizations files feat(experimental): Customizations files Sep 18, 2026
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.

2 participants