Skip to content

Fix Durable Task Scheduler ATS export annotations#15684

Open
davidfowl wants to merge 8 commits intomainfrom
durable-task-fix-followup
Open

Fix Durable Task Scheduler ATS export annotations#15684
davidfowl wants to merge 8 commits intomainfrom
durable-task-fix-followup

Conversation

@davidfowl
Copy link
Copy Markdown
Contributor

@davidfowl davidfowl commented Mar 28, 2026

Description

Fixes the build break in the Durable Task Scheduler Azure Functions work.

The root cause was ATS export analyzer failures on the new Durable Task builder APIs. This change now uses a cleaner overload strategy for polyglot export:

  • keep the public C# overloads for string and IResourceBuilder<ParameterResource>
  • expose a single ATS-facing method per concept using AspireUnion
  • keep RunSyncOnBackgroundThread = true on RunAsEmulator(...) because it invokes a sync callback delegate

This avoids exposing overload-specific ATS methods while preserving the existing C# API shape.

Additionally, the following issues were addressed based on PR review feedback:

  • Fixed the grpc endpoint registration in RunAsEmulator to use WithHttpEndpoint (setting UriScheme = "http") followed by Transport = "http2", matching the convention used by Milvus and Qdrant. This corrects the emulator connection string scheme from tcp:// to http://.
  • Replaced throw new NotImplementedException() with throw new InvalidOperationException(...) in DurableTaskSchedulerResource for a clearer error message when the dashboard endpoint is accessed outside of emulator mode.
  • Added missing trailing newline in playground orchestration trigger file.

Validation:

  • ./dotnet.sh build src/Aspire.Hosting.Azure.Functions/Aspire.Hosting.Azure.Functions.csproj /p:SkipNativeBuild=true
  • ./dotnet.sh test tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj -- --filter-class "*.DurableTaskResourceExtensionsTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

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 Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@davidfowl davidfowl requested a review from eerhardt as a code owner March 28, 2026 20:29
Copilot AI review requested due to automatic review settings March 28, 2026 20:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 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 -- 15684

Or

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

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

Fixes a build break caused by ASPIREEXPORT008 by adding ATS export annotations to newly introduced Durable Task Scheduler builder extension methods, keeping the C# API available while preventing premature ATS exposure.

Changes:

  • Add a shared ignore-reason constant for ATS export suppression.
  • Mark Durable Task Scheduler/Hub builder extension methods with [AspireExportIgnore] to satisfy the analyzer and avoid ATS export.
Comments suppressed due to low confidence (1)

src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs:15

  • The shared ignore reason mentions only "Durable Task Scheduler resources", but this attribute is also applied to task hub-related methods (e.g., AddTaskHub/WithTaskHubName). Consider broadening the text (e.g., "Durable Task resources...") so the diagnostic reason remains accurate for all annotated methods.
    /// <summary>

davidfowl and others added 4 commits March 28, 2026 13:44
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidfowl davidfowl force-pushed the durable-task-fix-followup branch from 9d0c736 to c18d6c0 Compare March 28, 2026 20:45
davidfowl and others added 2 commits March 28, 2026 14:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

A few issues spotted — most notably the "latest" container tag and the missing http2 transport on the gRPC endpoint.

public const string Image = "dts/dts-emulator";

/// <remarks>latest</remarks>
public const string Tag = "latest";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Every other *ContainerImageTags.cs in the repo pins to a specific version (Redis → "8.6", PostgreSQL → "17.6", Kafka → "8.1.1", etc.). The only exception is RedisCommander which has an explicit comment explaining why.

Using "latest" makes builds non-deterministic and can break silently when the upstream image is updated. Can this be pinned to a specific version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@philliphoff do ya'll have a non latest tag yet

- Set Transport = "http2" on gRPC endpoint per repo convention
- Replace NotImplementedException with InvalidOperationException
- Use endpoint scheme expression instead of hardcoded "http://"
- Add missing trailing newline in MyOrchestrationTrigger.cs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidfowl davidfowl force-pushed the durable-task-fix-followup branch from c148d49 to 29bdd70 Compare March 30, 2026 06:20
@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.

@github-actions
Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings — 52 recordings uploaded (commit 29bdd70)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateStartAndStopAspireProject ▶️ 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
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ 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
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #23730863391

@davidfowl
Copy link
Copy Markdown
Contributor Author

@copilot fix the failing test

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

@copilot fix the failing test

Fixed in d281753. The grpc endpoint was registered with WithEndpoint() which defaults to tcp URI scheme, causing the connection string to use tcp:// instead of http://. Changed to WithHttpEndpoint() (matching the pattern used by Milvus and Qdrant) which sets UriScheme = "http", then keeps Transport = "http2". All 15 tests now pass.

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.

4 participants