feat: Add canister-metadata-section function - #726
Open
adamspofford-dfinity wants to merge 5 commits into
Open
Conversation
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
from
August 24, 2026 16:43
60ef041 to
2f6ec2e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds canister metadata-section reads to sync plugins, supporting direct and proxy-routed access.
Changes:
- Extends the WIT interface and runtime host implementation.
- Updates examples, schemas, and documentation.
- Adds undeclared-target and integration coverage.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
examples/icp-sync-plugin/README.md |
Documents metadata reads. |
examples/icp-sync-plugin/plugin/src/lib.rs |
Demonstrates the new host function. |
examples/icp-sync-plugin/icp.yaml |
Publishes example Candid metadata. |
docs/schemas/icp-yaml-schema.json |
Updates plugin permissions description. |
docs/schemas/canister-yaml-schema.json |
Updates plugin permissions description. |
docs/reference/configuration.md |
Documents metadata access configuration. |
docs/guides/writing-sync-plugins.md |
Adds authoring guidance and example. |
docs/concepts/sync-plugins.md |
Defines routing and return semantics. |
crates/icp/src/manifest/adapter/plugin.rs |
Updates manifest field documentation. |
crates/icp-sync-plugin/tests/fixtures/test-plugin/src/lib.rs |
Adds an undeclared-target fixture. |
crates/icp-sync-plugin/sync-plugin.wit |
Adds the metadata request and import. |
crates/icp-sync-plugin/src/runtime.rs |
Implements direct and proxied metadata reads. |
crates/icp-sync-plugin/DESIGN.md |
Records implementation rationale. |
crates/icp-sync-plugin/Cargo.toml |
Adds management-canister types. |
crates/icp-cli/tests/sync_tests.rs |
Tests absent metadata through both routes. |
Cargo.lock |
Records the dependency update. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
adamspofford-dfinity
marked this pull request as ready for review
August 24, 2026 16:49
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
from
August 26, 2026 17:53
21d9eb8 to
c98d996
Compare
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
from
August 26, 2026 17:56
c98d996 to
e620a30
Compare
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
2 times, most recently
from
September 2, 2026 16:37
17a1d28 to
0c74c79
Compare
raymondk
force-pushed
the
spofford/fetch-section
branch
from
September 3, 2026 17:17
0c74c79 to
a472dc8
Compare
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
from
September 3, 2026 18:08
a472dc8 to
c29b911
Compare
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
2 times, most recently
from
September 3, 2026 21:18
70fe9bd to
e0c3f58
Compare
raymondk
reviewed
Sep 4, 2026
| /// separates the two. A canister with no module installed has no sections at | ||
| /// all, which the certificate reports as an absent path under a canister that | ||
| /// exists, and so as [`CertifiedSection::Absent`]. | ||
| async fn certified_metadata_section( |
Collaborator
There was a problem hiding this comment.
can't this reuse icp::operations::misc::fetch_canister_metadata ?
Collaborator
There was a problem hiding this comment.
Collaborator
There was a problem hiding this comment.
.... it would introduce a cycle....
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
from
September 4, 2026 10:41
e0c3f58 to
032cc49
Compare
adamspofford-dfinity
force-pushed
the
spofford/fetch-section
branch
from
September 4, 2026 10:42
032cc49 to
cad21a1
Compare
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.
This PR adds a function to the sync plugin interface to fetch metadata sections from canisters. This is useful for type-checking canister calls by fetching
candid:service. (Does this function need to be so specific instead of fetching state-tree content? Yes, because plugins should be usable from a canister host, and canisters cannot fetch the state tree, but rather get metadata sections by calling a management canister method only available to canisters.)Stack created with GitHub Stacks CLI • Give Feedback 💬