Skip to content

feat: support URLs with path components#1361

Merged
adamspofford-dfinity merged 3 commits into
mainfrom
spofford/suburl
May 28, 2026
Merged

feat: support URLs with path components#1361
adamspofford-dfinity merged 3 commits into
mainfrom
spofford/suburl

Conversation

@adamspofford-dfinity

Copy link
Copy Markdown
Contributor

Changes all the absolute URLs to relative so that they can be used with API URLs that have path components like /instances/0. Allows e2e to bypass the gateway, and migrates the tests to do so.

@adamspofford-dfinity adamspofford-dfinity requested a review from a team as a code owner May 22, 2026 02:02
@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@icp-sdk/core 91 B (0%)
@icp-sdk/core/agent 52 KB (+0.13% 🔺)
@icp-sdk/core/candid 13.49 KB (0%)
@icp-sdk/core/identity 20.75 KB (0%)
@icp-sdk/core/identity/secp256k1 33.94 KB (0%)
@icp-sdk/core/principal 4.44 KB (0%)

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

This PR adds support for HttpAgent hosts that include path prefixes, enabling API requests to target deployments such as PocketIC instance URLs while preserving existing behavior for bare hosts.

Changes:

  • Normalizes HttpAgent host paths with a trailing slash and switches API URL construction to relative paths.
  • Updates e2e setup to expose GATEWAY_PORT and SERVER_URL, allowing tests to bypass the gateway when available.
  • Migrates selected e2e tests to use the shared makeAgent helper.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/agent/agent/http/index.ts Preserves host path prefixes when constructing agent API URLs.
e2e/node/utils/agent.ts Centralizes agent creation using either a PocketIC instance URL or gateway fallback.
e2e/node/setup-pic.ts Updates setup messaging and wait checks for renamed/new environment variables.
e2e/node/pic-helpers.ts Writes GATEWAY_PORT and SERVER_URL for e2e consumers.
e2e/node/global-setup.ts Reuses existing PocketIC environments using the renamed gateway port variable.
e2e/node/basic/trap.test.ts Uses the shared agent helper.
e2e/node/basic/counter.test.ts Uses the shared agent helper for counter actors.
e2e/node/basic/canisterStatus.test.ts Uses the shared agent helper while preserving root-key behavior.
e2e/node/basic/basic.test.ts Uses the exported gateway port for topology requests.
pnpm-lock.yaml Updates transitive lockfile dependency versions.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

@adamspofford-dfinity adamspofford-dfinity merged commit ecad008 into main May 28, 2026
27 checks passed
@adamspofford-dfinity adamspofford-dfinity deleted the spofford/suburl branch May 28, 2026 14:07
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.

3 participants