Skip to content

Expose endpoint property expressions to ATS - #16540

Merged
Sébastien Ros (sebastienros) merged 5 commits into
microsoft:mainfrom
sebastienros:sebros/endpoint-property-expression-export
Apr 29, 2026
Merged

Sébastien Ros (sebastienros) merged 5 commits into
microsoft:mainfrom
sebastienros:sebros/endpoint-property-expression-export

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Description

Fixes #15868

TypeScript AppHosts could already reference endpoint properties conceptually through the C# EndpointProperty enum, but EndpointReference.Property(...) was explicitly ignored by ATS, so generated SDKs could not construct expressions such as http://${Host}:${Port} from endpoint properties.

This exposes EndpointReference.Property(EndpointProperty) through ATS, refreshes the generated TypeScript, Python, and Java SDK snapshots, and updates the polyglot validation AppHosts to build an endpoint URL from Host and Port endpoint properties.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@github-actions

github-actions Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

🚀 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16540

Or

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

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 fixes #15868 by exporting EndpointReference.Property(EndpointProperty) through ATS so polyglot SDKs (TypeScript/Python/Java) can construct endpoint property expressions (e.g., building http://{Host}:{Port}) rather than only referencing the endpoint as a whole.

Changes:

  • Exports EndpointReference.Property(EndpointProperty) (previously ignored by ATS) to enable endpoint-property expressions in generated SDKs.
  • Regenerates TypeScript, Python, and Java SDK snapshot outputs to include the new property(...) capability.
  • Updates the polyglot validation AppHosts (TS/Python/Java) to build and use an endpoint URL expression from Host + Port.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/PolyglotAppHosts/Aspire.Hosting/TypeScript/apphost.ts Uses EndpointProperty.Host/Port via endpoint.property(...) to form a URL expression and sets it as an env var.
tests/PolyglotAppHosts/Aspire.Hosting/Python/apphost.py Builds a URL ReferenceExpression from endpoint Host/Port property expressions and uses it in environment configuration.
tests/PolyglotAppHosts/Aspire.Hosting/Java/AppHost.java Builds a URL expression from endpoint HOST/PORT property expressions and uses it in environment configuration.
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts Snapshot update adding EndpointReference.property(EndpointProperty) to the generated TS surface.
tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py Snapshot update adding EndpointReference.property(...) to the generated Python surface.
tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java Snapshot update adding EndpointReference.property(EndpointProperty) to the generated Java surface.
src/Aspire.Hosting/ApplicationModel/EndpointReference.cs Exports the Property(EndpointProperty) API via [AspireExport] so ATS can surface it in generated SDKs.

@github-actions

Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

Expose EndpointReference.Property through ATS so generated polyglot SDKs can construct endpoint property expressions such as Host and Port.

Update the TypeScript, Python, and Java polyglot validation apphosts and generated SDK snapshots for the new method.

Co-authored-by: Copilot <[email protected]>
Remove inaccurate default-value wording from EndpointReference property docs and normalize the Python codegen snapshot to UTF-8 without BOM.

Co-authored-by: Copilot <[email protected]>
Update Go and Rust generated SDK snapshots for the exported EndpointReference.Property capability.

Co-authored-by: Copilot <[email protected]>
Update the Go and Rust verified snapshots to match the generated endpoint property output verified by their local codegen test projects.

Co-authored-by: Copilot <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 2 jobs were identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

Matched test failure patterns (1 test)
  • Aspire.Cli.EndToEnd.Tests.KubernetesDeployWithRabbitMQTests.DeployK8sWithRabbitMQ — MCR registry rate limiting (HTTP 403)

@sebastienros
Sébastien Ros (sebastienros) merged commit c07b45a into microsoft:main Apr 29, 2026
562 of 567 checks passed
@github-actions github-actions Bot added this to the 13.3 milestone Apr 29, 2026
Nell Shamrell-Harrington (nellshamrell) pushed a commit to nellshamrell/aspire that referenced this pull request May 18, 2026
* Expose endpoint property expressions to ATS

Expose EndpointReference.Property through ATS so generated polyglot SDKs can construct endpoint property expressions such as Host and Port.

Update the TypeScript, Python, and Java polyglot validation apphosts and generated SDK snapshots for the new method.

Co-authored-by: Copilot <[email protected]>

* Address endpoint property review feedback

Remove inaccurate default-value wording from EndpointReference property docs and normalize the Python codegen snapshot to UTF-8 without BOM.

Co-authored-by: Copilot <[email protected]>

* Refresh Go and Rust endpoint property snapshots

Update Go and Rust generated SDK snapshots for the exported EndpointReference.Property capability.

Co-authored-by: Copilot <[email protected]>

* Normalize Go and Rust codegen snapshots

Update the Go and Rust verified snapshots to match the generated endpoint property output verified by their local codegen test projects.

Co-authored-by: Copilot <[email protected]>

* Normalize TypeScript endpoint property snapshot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EndpointPropertyExpression not exported/available in TypeScript SDK

3 participants