Add local dev loop integration - #10162
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades Aspire dependencies and extends the Fusion Aspire schema composition workflow to better support a local development loop: it can now detect source-schema resource restarts, schedule gateway recomposition, and handle transient failures (including retrying certain server-side errors and retrying archive replacement).
Changes:
- Bump Aspire.Hosting-related package versions to 13.4.6 (including example projects) and update a few centrally pinned packages (e.g., Microsoft.Extensions.Logging, MessagePack).
- Introduce restart-aware recomposition: track first-ready vs restart signals, and run a per-gateway recomposition worker that coalesces triggers and debounces rapid restarts.
- Improve schema-fetch and archive replacement robustness: add an HTTP-status-carrying exception type, allow transient server-error retries during recomposition, and retry archive replacement on transient IO failures; add/adjust tests accordingly.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Mocha/examples/PostgresTransport/Directory.Packages.props | Updates Aspire package versions for the PostgresTransport example. |
| src/Mocha/examples/Demo/Directory.Packages.props | Updates Aspire package versions for the Demo example. |
| src/HotChocolate/Fusion/test/Fusion.Composition.Tests/DefaultSchemaFetcherTests.cs | Updates test expectations to the new schema fetch request exception and asserts status code. |
| src/HotChocolate/Fusion/test/Fusion.Composition.Tests/ApolloFederationSchemaFetcherTests.cs | Updates test expectations to the new schema fetch request exception and asserts status code. |
| src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/SourceSchemaRestartTrackerTests.cs | Adds tests for the new restart tracking helper. |
| src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/SchemaCompositionTests.cs | Extends coverage for transient retry behavior, recomposition failure behavior, map building, and archive copy retries. |
| src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/RecordingLogger.cs | Adds shared recording logger utility for tests. |
| src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/HotChocolate.Fusion.Aspire.Tests.csproj | Adds TimeProvider testing package dependency for deterministic debounce testing. |
| src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/GatewayRecompositionWorkerTests.cs | Adds tests for coalescing, debouncing, and resilience of the recomposition worker. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Http/SchemaFetchRequestException.cs | Introduces exception type that preserves HTTP status code for schema fetch failures. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Http/DefaultSchemaFetcher.cs | Throws SchemaFetchRequestException for non-success HTTP responses. |
| src/HotChocolate/Fusion/src/Fusion.Composition/ApolloFederation/ApolloFederationSchemaFetcher.cs | Throws SchemaFetchRequestException for non-success HTTP responses. |
| src/HotChocolate/Fusion/src/Fusion.Aspire/SourceSchemaRestartTracker.cs | Adds restart tracking utility to distinguish initial ready from restarts. |
| src/HotChocolate/Fusion/src/Fusion.Aspire/SchemaComposition.cs | Implements restart subscriptions, recomposition scheduling, transient retry option, and archive copy retry behavior. |
| src/HotChocolate/Fusion/src/Fusion.Aspire/HotChocolate.Fusion.Aspire.csproj | Adds conditional logging package override for net9 due to Aspire.Hosting requirements. |
| src/HotChocolate/Fusion/src/Fusion.Aspire/GatewayRecompositionWorker.cs | Adds worker that coalesces triggers, debounces, and prevents overlapping recompositions. |
| src/Directory.Packages.props | Updates centrally managed package versions (Aspire, MessagePack, Microsoft.Extensions.Logging). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Patch coverage85.1% of changed lines covered (1610/1891) +25 more changed files; see the JSON below for uncovered lines. Uncovered changed lines (JSON){
"sha": "f328f335530df9a6c9b273b571168b6191839eb8",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/SystemNitroEnvironment.cs", "ranges": [[12, 13], [15, 16]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/CompositeLogger.cs", "ranges": [[13, 13], [16, 16], [36, 36], [39, 42]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/SchemaComposition.cs", "ranges": [[35, 35], [37, 37], [40, 43], [49, 55], [57, 98], [100, 101], [146, 151], [190, 190], [258, 259], [263, 264], [266, 267], [301, 308], [310, 312], [355, 355], [363, 366], [368, 370], [372, 389], [391, 392], [394, 412], [414, 415], [509, 513], [546, 546], [763, 763], [934, 935], [1251, 1252]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroOperationDocuments.cs", "ranges": [[49, 51]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroSessionReader.cs", "ranges": [[30, 34], [108, 110], [112, 114], [118, 119]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/GatewayRecompositionWorker.cs", "ranges": [[74, 76], [87, 87], [92, 98]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroSeedCache.cs", "ranges": [[51, 51], [196, 202], [204, 204], [206, 206], [285, 288], [307, 310], [312, 314], [329, 331], [345, 346], [348, 348]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroApiLookupClient.cs", "ranges": [[103, 106], [108, 108], [123, 125], [127, 127], [129, 131]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroSeedCoordinator.cs", "ranges": [[172, 172], [174, 176], [179, 186], [188, 189]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Composition/SettingsComposerOptions.cs", "ranges": [[10, 10]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroAccessToken.cs", "ranges": [[25, 26], [40, 40], [71, 73]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/GraphQLResourceBuilderExtensions.cs", "ranges": [[137, 137]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Composition/SettingsComposer.cs", "ranges": [[162, 162], [205, 209], [261, 263], [301, 302], [311, 312], [525, 527], [555, 559]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroConnectionResolver.cs", "ranges": [[54, 57], [61, 65]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroFusionConfigurationDownloader.cs", "ranges": [[189, 191], [193, 195], [197, 199]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroSeedProvider.cs", "ranges": [[227, 228]] }
]
}Project coverage: 54.1% (235080/434475 lines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.