Skip to content

Add polyglot exports for Aspire.Hosting.DevTunnels#14905

Merged
sebastienros merged 4 commits intorelease/13.2from
sebros/polyglot-devtunnels
Mar 4, 2026
Merged

Add polyglot exports for Aspire.Hosting.DevTunnels#14905
sebastienros merged 4 commits intorelease/13.2from
sebros/polyglot-devtunnels

Conversation

@sebastienros
Copy link
Contributor

Related to #14069

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14905

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14905"

Copilot AI review requested due to automatic review settings March 3, 2026 19:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds polyglot (TypeScript/Node.js) exports and a validation AppHost for Aspire.Hosting.DevTunnels, enabling generated SDK bindings to invoke DevTunnels capabilities via AspireExport.

Changes:

  • Added [AspireExport] attributes to DevTunnels extension methods (AddDevTunnel, WithReference overloads, WithAnonymousAccess, GetEndpoint overloads).
  • Added a TypeScript validation AppHost (tsconfig/package/apphost/run profile and .aspire settings).
  • Added generated TypeScript “.modules” runtime + SDK (transport/base + large generated aspire.ts) and a codegen hash.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs Exposes DevTunnels APIs via AspireExport for polyglot hosts.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/tsconfig.json TS compiler configuration for the validation host.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/package.json Node/TS dependencies and scripts to run/build the host.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/apphost.ts Minimal TypeScript AppHost entry point.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/apphost.run.json Local run profile + Aspire endpoints via env vars.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/transport.ts JSON-RPC transport layer used by generated SDK.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/base.ts Core TS helper types (builders, lists/dicts, ref expressions).
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/aspire.ts Generated capability-based Aspire SDK incl. DevTunnels exports.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/.codegen-hash Pins the generated module set to a generator hash.
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.aspire/settings.json Configures Aspire polyglot tooling for this validation host.
Files not reviewed (1)
  • playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/package-lock.json: Language not supported

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit ea080d3:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AgentInitCommand_WithMalformedMcpJson_ShowsErrorAndExitsNonZero ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateStartWaitAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22648755644

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
/// <param name="targetEndpoint">The endpoint to expose via the dev tunnel.</param>
/// <param name="allowAnonymous">Whether anonymous access is allowed.</param>
/// <returns>The resource builder.</returns>
[AspireExport("withReference2", MethodName = "withReference", Description = "Configures the dev tunnel to expose a target endpoint.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't call it this.

Add [AspireExport] or [AspireExportIgnore] attributes to all 11 public
extension methods in DevTunnelResourceBuilderExtensions.cs.

Exported methods (6):
- addDevTunnel: Create dev tunnel resource
- withTunnelReference: Expose specific endpoint via tunnel
- withTunnelReferenceAnonymous: Expose endpoint with access control
- withTunnelReferenceAll: Expose all endpoints on a resource
- withAnonymousAccess: Make tunnel anonymously accessible
- getTunnelEndpoint: Get public tunnel endpoint for a given endpoint

Ignored methods (5) with reasons:
- WithReference(DevTunnelPortOptions): Not ATS-compatible
- WithReference(EndpointReference, DevTunnelPortOptions): Not ATS-compatible
- GetEndpoint<TResource>: Delegates to IResource overload
- GetEndpoint(IResource, string): IResource not ATS-mapped
- WithReference(targetResource, tunnelResource): Service discovery injection

Update TypeScript validation apphost to exercise all exported methods
and regenerate SDK. TypeScript compilation (tsc --noEmit) passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros sebastienros requested a review from davidfowl March 4, 2026 00:11
@sebastienros sebastienros enabled auto-merge (squash) March 4, 2026 00:14
@sebastienros sebastienros merged commit ac9fc75 into release/13.2 Mar 4, 2026
758 of 761 checks passed
@sebastienros sebastienros deleted the sebros/polyglot-devtunnels branch March 4, 2026 00:53
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 4, 2026
Copilot AI pushed a commit that referenced this pull request Mar 10, 2026
* Add polyglot exports for Aspire.Hosting.DevTunnels

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refine AspireExport descriptions for polyglot-devtunnels

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use generated methods in devtunnels apphost

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Complete AspireExport coverage for Aspire.Hosting.DevTunnels

Add [AspireExport] or [AspireExportIgnore] attributes to all 11 public
extension methods in DevTunnelResourceBuilderExtensions.cs.

Exported methods (6):
- addDevTunnel: Create dev tunnel resource
- withTunnelReference: Expose specific endpoint via tunnel
- withTunnelReferenceAnonymous: Expose endpoint with access control
- withTunnelReferenceAll: Expose all endpoints on a resource
- withAnonymousAccess: Make tunnel anonymously accessible
- getTunnelEndpoint: Get public tunnel endpoint for a given endpoint

Ignored methods (5) with reasons:
- WithReference(DevTunnelPortOptions): Not ATS-compatible
- WithReference(EndpointReference, DevTunnelPortOptions): Not ATS-compatible
- GetEndpoint<TResource>: Delegates to IResource overload
- GetEndpoint(IResource, string): IResource not ATS-mapped
- WithReference(targetResource, tunnelResource): Service discovery injection

Update TypeScript validation apphost to exercise all exported methods
and regenerate SDK. TypeScript compilation (tsc --noEmit) passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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