feat: prune env-specific canisters from deploys even in workspaces - #734
feat: prune env-specific canisters from deploys even in workspaces#734adamspofford-dfinity wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Honors dependency-specific environment canister selections within workspaces.
Changes:
- Prunes excluded dependency canisters during manifest consolidation.
- Adjusts member-scoped deployment binding handling.
- Adds tests and documentation for workspace environment selection.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
CHANGELOG.md |
Records the behavior change. |
docs/concepts/environments.md |
Documents workspace selection behavior. |
docs/concepts/project-dependencies.md |
Explains dependency environment precedence. |
crates/icp/src/project.rs |
Consolidates member selections and overrides. |
crates/icp-cli/src/commands/deploy.rs |
Skips missing excluded binding targets. |
crates/icp-cli/tests/dependency_tests.rs |
Adds end-to-end pruning coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
lwshang
left a comment
There was a problem hiding this comment.
Read every hunk and verified the first two findings empirically in a throwaway worktree. The partition model reads well and the nested <path>:<canister> resolution is careful, but two cases behave worse than before the change. Details inline.
936f128 to
81ad117
Compare
81ad117 to
7ae2e61
Compare
7ae2e61 to
0e3d03c
Compare
0e3d03c to
cd921f0
Compare
cd921f0 to
7d66b39
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Persisted IDs can still wire excluded canisters after an environment selection is tightened.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 3
- Review effort level: Balanced
| if !env.canisters.contains_key(target) { | ||
| continue; |
| `icp deploy` deploys **all** of the dependency's canisters into the same environment, not just the exposed ones. A dependency's canisters may call each other, and icp-cli does not track an internal "requires" graph, so the whole dependency is always deployed — exactly as it would deploy on its own. `canisters:` here is an **exposure** filter (which IDs your canisters see), not a deployment filter. | ||
|
|
||
| "Exactly as it would deploy on its own" includes its own environments: if the dependency's environment [names a subset of its canisters](#which-canisters-an-environment-holds), only those are deployed to that environment. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
icp deploy -e fooshould not deploy any canisters not listed in environmentfoo, but this does not work in workspaces. This PR fixes that.