Skip to content

Expose endpoint property expressions to ATS#16540

Merged
sebastienros merged 5 commits intomicrosoft:mainfrom
sebastienros:sebros/endpoint-property-expression-export
Apr 29, 2026
Merged

Expose endpoint property expressions to ATS#16540
sebastienros merged 5 commits intomicrosoft: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?

Copilot AI review requested due to automatic review settings April 29, 2026 00:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 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/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"

Copy link
Copy Markdown
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

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.

Comment thread src/Aspire.Hosting/ApplicationModel/EndpointReference.cs
@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.

sebastienros and others added 5 commits April 28, 2026 21:10
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 <223556219+Copilot@users.noreply.github.com>
Remove inaccurate default-value wording from EndpointReference property docs and normalize the Python codegen snapshot to UTF-8 without BOM.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update Go and Rust generated SDK snapshots for the exported EndpointReference.Property capability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros sebastienros force-pushed the sebros/endpoint-property-expression-export branch from 04f69ec to 7dac37f Compare April 29, 2026 04:15
@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 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
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.

EndpointPropertyExpression not exported/available in TypeScript SDK

3 participants