Skip to content

Add WithGraphQLHttpEndpoint and require declared routes for Aspire composition - #10196

Merged
michaelstaib merged 3 commits into
mainfrom
mst/fusion-aspire-http-endpoint
Aug 4, 2026
Merged

michaelstaib merged 3 commits into
mainfrom
mst/fusion-aspire-http-endpoint

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings August 4, 2026 14:46

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 refactors Fusion composition to carry per-schema local URL overrides via a new LocalSourceSchema type, introduces WithGraphQLHttpEndpoint for Aspire resources, and makes Aspire schema composition require an explicitly declared GraphQL route (so schema download and URL override injection can be deterministic).

Changes:

  • Introduces WithGraphQLHttpEndpoint (and obsoletes older file/schema-endpoint APIs) and updates Aspire composition to require declared GraphQL routes and schema paths.
  • Replaces tuple-based source schema plumbing with LocalSourceSchema (schema + settings + optional URL override) across Nitro CLI and Fusion composition helpers.
  • Simplifies settings composition URL resolution by removing SettingsComposerOptions and passing explicit urlOverrides + preferDevUrls inputs.

Reviewed changes

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

Show a summary per file
File Description
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/LegacyFusionArchiveMigrator.cs Migrates legacy archive schemas into LocalSourceSchema containers.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishHelpers.cs Updates publish/composition flow to use LocalSourceSchema and new compose signature.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs Switches downloaded source schemas to LocalSourceSchema.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionCompositionHelpers.cs Returns/handles LocalSourceSchema dictionaries and disposes settings via .Settings.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionComposeCommand.cs Adapts settings ownership tracking and compose invocation to new API.
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SettingsComposerUrlResolutionTests.cs Updates tests for new SettingsComposer inputs and adds URL override edge cases.
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/LocalSourceSchemaTests.cs Adds constructor validation test for relative URL overrides.
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/GatewaySettingsComposerTests.cs Updates composer invocation to pass overrides + preferDevUrls.
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/CompositionHelperTests.cs Updates composition helper tests to use LocalSourceSchema and new compose signature.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/SchemaEndpointServer.cs Adds a real Kestrel-backed schema endpoint test helper for endpoint composition tests.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/SchemaCompositionTests.cs Updates Aspire tests to new endpoint API; adds coverage around deprecated file-based API.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/Nitro/NitroSchemaCompositionTests.cs Updates Nitro/Aspire harness tests to use endpoint-based schemas and running-state waits.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/GraphQLResourceBuilderExtensionsTests.cs Adds tests for WithGraphQLHttpEndpoint defaults/validation and adjusts deprecated API expectations.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/CompositionHarness.cs Adds a harness-specific SchemaComposition subclass to wait on resource state without an orchestrator.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/AspireCompositionHelperTests.cs Replaces local URL override building with TryBuildLocalSourceSchemas and adds route-required failure tests.
src/HotChocolate/Fusion/src/Fusion.Composition/SettingsComposerOptions.cs Removes options record in favor of explicit composer inputs.
src/HotChocolate/Fusion/src/Fusion.Composition/SettingsComposer.cs Changes compose API to accept urlOverrides + preferDevUrls and removes external-environment logic.
src/HotChocolate/Fusion/src/Fusion.Composition/LocalSourceSchema.cs Introduces LocalSourceSchema value type with optional absolute URL override.
src/HotChocolate/Fusion/src/Fusion.Composition/CompositionHelper.cs Updates composition pipeline to accept LocalSourceSchema and pass derived URL overrides into settings composer.
src/HotChocolate/Fusion/src/Fusion.Aspire/SourceSchemaInfo.cs Carries the declared GraphQL route (GraphQLPath) through discovery/composition.
src/HotChocolate/Fusion/src/Fusion.Aspire/SchemaEndpointConfiguration.cs Removes implicit default path logic to require declared routes/paths.
src/HotChocolate/Fusion/src/Fusion.Aspire/SchemaComposition.cs Requires declared GraphQL paths; selects schema fetch path based on federation vs schema download path; makes wait overridable for tests.
src/HotChocolate/Fusion/src/Fusion.Aspire/GraphQLSourceSchemaAnnotation.cs Adds GraphQLPath to annotations to distinguish route vs schema download path.
src/HotChocolate/Fusion/src/Fusion.Aspire/GraphQLResourceBuilderExtensions.cs Adds WithGraphQLHttpEndpoint, obsoletes older APIs, and simplifies schema URL building.
src/HotChocolate/Fusion/src/Fusion.Aspire/AspireCompositionHelper.cs Builds LocalSourceSchema map (and fails when routes are missing) before composing archives.

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

Comment on lines +5 to +7
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

99.5% of changed lines covered (181/182)

File Covered Changed Patch %
…/src/CommandLine/Commands/Fusion/FusionCompositionHelpers.cs 9 10 90.0% 🟡
…/Fusion/src/Fusion.Aspire/AspireCompositionHelper.cs 43 43 100.0% 🟢
…/Fusion/src/Fusion.Aspire/GraphQLResourceBuilderExtensions.cs 24 24 100.0% 🟢
…/Fusion/src/Fusion.Aspire/GraphQLSourceSchemaAnnotation.cs 1 1 100.0% 🟢
…/HotChocolate/Fusion/src/Fusion.Aspire/SchemaComposition.cs 42 42 100.0% 🟢
…/HotChocolate/Fusion/src/Fusion.Aspire/SourceSchemaInfo.cs 1 1 100.0% 🟢
…/Fusion/src/Fusion.Composition/CompositionHelper.cs 19 19 100.0% 🟢
…/Fusion/src/Fusion.Composition/LocalSourceSchema.cs 13 13 100.0% 🟢
…/Fusion/src/Fusion.Composition/SettingsComposer.cs 14 14 100.0% 🟢
…/src/CommandLine/Commands/Fusion/FusionComposeCommand.cs 3 3 100.0% 🟢
…/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs 5 5 100.0% 🟢
…/src/CommandLine/Commands/Fusion/FusionPublishHelpers.cs 3 3 100.0% 🟢
…/CommandLine/Commands/Fusion/LegacyFusionArchiveMigrator.cs 4 4 100.0% 🟢
Uncovered changed lines (JSON)
{
  "sha": "bd9951b8ff7226f11adc422a4f92cfbbbf59a797",
  "files": [
    { "path": "src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionCompositionHelpers.cs", "ranges": [[65, 65]] }
  ]
}

Project coverage: 54.4% (242336/445607 lines)

@michaelstaib
michaelstaib merged commit 385c3ec into main Aug 4, 2026
289 of 291 checks passed
@michaelstaib
michaelstaib deleted the mst/fusion-aspire-http-endpoint branch August 4, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants