feat: Add gateway and API urls to sync input - #757
Open
adamspofford-dfinity wants to merge 2 commits into
Open
Conversation
adamspofford-dfinity
force-pushed
the
spofford/input-urls
branch
from
September 3, 2026 19:41
1fe2e3f to
2c2e61e
Compare
Contributor
There was a problem hiding this comment.
🟡 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>, |
adamspofford-dfinity
force-pushed
the
spofford/input-urls
branch
from
September 3, 2026 21:18
2c2e61e to
ec019f4
Compare
adamspofford-dfinity
force-pushed
the
spofford/input-urls
branch
from
September 4, 2026 10:41
ec019f4 to
01f9b76
Compare
adamspofford-dfinity
force-pushed
the
spofford/input-urls
branch
from
September 4, 2026 10:42
01f9b76 to
0a8c8eb
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.
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 CLI • Give Feedback 💬