Skip to content

feat: Add gateway and API urls to sync input - #757

Open
adamspofford-dfinity wants to merge 2 commits into
spofford/multi-syncfrom
spofford/input-urls
Open

feat: Add gateway and API urls to sync input#757
adamspofford-dfinity wants to merge 2 commits into
spofford/multi-syncfrom
spofford/input-urls

Conversation

@adamspofford-dfinity

@adamspofford-dfinity adamspofford-dfinity commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Makes plugins aware of the deployment network's configured API URL and gateway URL. Plugins do not have HTTP access and so cannot actually call these URLs, but making a canister aware of its own URL allows it to serve frontend HTTP content referencing sibling canisters better.

Stack created with GitHub Stacks CLIGive Feedback 💬

@adamspofford-dfinity
adamspofford-dfinity requested a review from a team as a code owner September 3, 2026 18:09
Copilot AI balanced review requested due to automatic review settings September 3, 2026 19:41

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

The modified v0.2 WIT record breaks compatibility with existing v0.2 plugin binaries and requires a new interface version.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds deployment network API and gateway URLs to sync plugin inputs.

Changes:

  • Resolves and propagates network URLs through sync operations.
  • Extends the plugin WIT/runtime interface and documentation.
  • Adds URL passthrough tests and example output.
File summaries
File Description
examples/icp-sync-plugin/plugin/src/lib.rs Reports network URLs.
docs/guides/writing-sync-plugins.md Documents URL usage.
docs/concepts/sync-plugins.md Describes new input fields.
crates/icp/src/operations/sync.rs Propagates URLs through synchronization.
crates/icp/src/operations/deploy.rs Resolves URLs during deployment.
crates/icp/src/network/mod.rs Adds URL-only network access.
crates/icp/src/network/access.rs Introduces NetworkUrls.
crates/icp/src/canister/sync/script.rs Updates test parameters.
crates/icp/src/canister/sync/plugin.rs Passes URLs to plugin runtime.
crates/icp/src/canister/sync/mod.rs Adds URLs to sync parameters.
crates/icp-sync-plugin/tests/fixtures/test-plugin/src/lib.rs Echoes URL inputs in tests.
crates/icp-sync-plugin/sync-plugin.wit Adds API and gateway fields.
crates/icp-sync-plugin/src/runtime.rs Supplies URLs to v2 plugins.
crates/icp-sync-plugin/DESIGN.md Updates runtime design documentation.
crates/icp-sync-plugin/Cargo.toml Adds the URL dependency.
crates/icp-cli/tests/sync_tests.rs Verifies managed-network URL output.
crates/icp-cli/src/commands/sync.rs Resolves URLs for direct sync.
Cargo.lock Records the dependency update.
Review details
  • Files reviewed: 17/18 changed files
  • Comments generated: 1
  • Review effort level: Balanced

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

Comment on lines +95 to +104
/// URL of the network's API endpoint: where the host submits the
/// canister calls it makes on the plugin's behalf. The plugin has no
/// sockets of its own, so this is something to compose a URL from or
/// hand to a canister, not something to fetch. Normalized, so a URL
/// with no path carries a trailing slash ("http://127.0.0.1:4943/").
api-url: string,
/// URL of the network's HTTP gateway, which serves canisters over
/// HTTP, normalized the same way. `none` when the network exposes no
/// gateway.
gateway-url: option<string>,
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