Skip to content

[Fusion] Align composition between Aspire and CommandLine#9084

Merged
tobias-tengler merged 2 commits intomainfrom
tte/fix-fusion-aspire-composition
Feb 5, 2026
Merged

[Fusion] Align composition between Aspire and CommandLine#9084
tobias-tengler merged 2 commits intomainfrom
tte/fix-fusion-aspire-composition

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

@tobias-tengler tobias-tengler commented Feb 2, 2026

No description provided.

@tobias-tengler tobias-tengler changed the title [Fusion] Centralize composition [Fusion] Centralize composition using archives Feb 2, 2026
@tobias-tengler tobias-tengler force-pushed the tte/fix-fusion-aspire-composition branch from 46b8079 to 5662f9b Compare February 5, 2026 14:26
@tobias-tengler tobias-tengler marked this pull request as ready for review February 5, 2026 14:27
Copilot AI review requested due to automatic review settings February 5, 2026 14:28
@tobias-tengler tobias-tengler changed the title [Fusion] Centralize composition using archives [Fusion] Align composition between Aspire and CommandLine Feb 5, 2026
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 pull request centralizes GraphQL schema composition logic by moving it from the Nitro CLI into the HotChocolate.Fusion.Composition library, making it reusable across different contexts (CLI and Aspire). The refactoring improves code organization and reduces duplication.

Changes:

  • Moved composition logic from FusionComposeCommand to a new shared CompositionHelper class in HotChocolate.Fusion.Composition
  • Relocated settings classes from ChilliCream.Nitro.CommandLine.Settings namespace to HotChocolate.Fusion namespace
  • Refactored Aspire integration to use the centralized composition helper with proper resource disposal

Reviewed changes

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

Show a summary per file
File Description
src/Nitro/CommandLine/src/CommandLine/Properties/CommandLineResources.resx Removed unused resource string for disabled global object identification
src/Nitro/CommandLine/src/CommandLine/Properties/CommandLineResources.Designer.cs Auto-generated changes from resource file update
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs Updated import to use HotChocolate.Fusion namespace
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishHelpers.cs Removed unused import and updated to use CompositionHelper
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs Removed unused import
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionComposeCommand.cs Removed composition logic (moved to CompositionHelper), updated imports, and removed unused helper methods
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaPreprocessor.cs Updated directive name references (with minor style inconsistency)
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaEnricher.cs Updated directive name references (with minor style inconsistency)
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/SourceSchemaSettings.cs Changed namespace from ChilliCream.Nitro.CommandLine.Settings to HotChocolate.Fusion
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/SettingsJsonSerializerContext.cs Changed namespace from ChilliCream.Nitro.CommandLine.Settings to HotChocolate.Fusion
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/SettingsExtensions.cs Changed namespace and removed unused import
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/CompositionSettings.cs Changed namespace from ChilliCream.Nitro.CommandLine.Settings to HotChocolate.Fusion
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/HotChocolate.Fusion.Composition.csproj Added InternalsVisibleTo for nitro and Aspire, added Fusion.Packaging project reference
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/CompositionHelper.cs New file containing centralized composition logic
src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/SourceSchemaInfo.cs Changed SchemaSettings type from JsonElement to JsonDocument for proper resource management
src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/SchemaComposition.cs Added JsonDocument disposal, updated to use AspireCompositionHelper
src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/GraphQLCompositionSettings.cs Changed EnableGlobalObjectIdentification from bool to bool?
src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/CompositionHelper.cs Deleted - functionality moved to shared CompositionHelper
src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/AspireCompositionHelper.cs New file containing Aspire-specific composition wrapper
Files not reviewed (1)
  • src/Nitro/CommandLine/src/CommandLine/Properties/CommandLineResources.Designer.cs: Language not supported

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

sourceMetadata.IsLookup = outputField.Directives.ContainsName(Lookup);
sourceMetadata.HasExternalDirective = outputField.Directives.ContainsName(External);
sourceMetadata.HasInternalDirective = outputField.Directives.ContainsName(Internal);
sourceMetadata.HasInternalDirective = outputField.Directives.ContainsName(WellKnownDirectiveNames.Internal);
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The use of WellKnownDirectiveNames.Internal is inconsistent with the rest of the file. Line 11 imports using static HotChocolate.Fusion.WellKnownDirectiveNames;, which brings all constants into scope. Other directives in this file (such as Lookup on line 85, External on line 86, Override on line 88, etc.) are referenced without the WellKnownDirectiveNames. prefix. For consistency, Internal should be used directly instead of WellKnownDirectiveNames.Internal.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It conflicts with a namespace otherwise
CleanShot 2026-02-05 at 15 39 00@2x
Not sure why this is suddenly the case though.

Comment thread src/Nitro/CommandLine/src/CommandLine/Properties/CommandLineResources.resx Outdated
@tobias-tengler tobias-tengler force-pushed the tte/fix-fusion-aspire-composition branch from b4d792b to 1e952c6 Compare February 5, 2026 14:44
@tobias-tengler tobias-tengler merged commit 1e4b904 into main Feb 5, 2026
117 checks passed
@tobias-tengler tobias-tengler deleted the tte/fix-fusion-aspire-composition branch February 5, 2026 14:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
5824.87 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.81ms 7.07ms 161.97ms 8.43ms 13.45ms 18.97ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
4522.28 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.86ms 39.28ms 233.77ms 49.15ms 109.62ms 125.24ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
      }
    }
  }
}

Deep Recursion Query

Constant Load (50 VUs)

Requests/sec Error Rate
268.83 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
12.89ms 175.46ms 657.76ms 180.34ms 225.88ms 250.30ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
310.30 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
3.03ms 665.56ms 1691.45ms 682.42ms 1371.02ms 1483.37ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  users {
    ...User
    reviews {
      ...Review
      product {
        ...Product
        reviews {
          ...Review
          author {
            ...User
            reviews {
              ...Review
              product {
                ...Product
              }
            }
          }
        }
      }
    }
  }
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
        reviews {
          ...Review
          product {
            ...Product
          }
        }
      }
    }
  }
}

Variable Batching Throughput

Constant Load (50 VUs)

Requests/sec Error Rate
23681.80 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 1.70ms 39.38ms 2.06ms 3.94ms 4.81ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
18850.70 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 9.14ms 102.43ms 11.25ms 23.25ms 28.10ms

Executed Query

query TestQuery_8f7a46ce_2(
  $__fusion_1_upc: ID!
  $__fusion_2_price: Long!
  $__fusion_2_weight: Long!
) {
  productByUpc(upc: $__fusion_1_upc) {
    inStock
    shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
  }
}

Variables (5 sets batched in single request)

[
  { "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
  { "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
  { "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]

No baseline data available for comparison.


Run 21715908458 • Commit 4a7ef6e • Thu, 05 Feb 2026 15:03:16 GMT

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