Repository navigation
[Fusion] Evaluate the include flags of a conditional incremental plan once - #160
Open
michaelstaib wants to merge 3 commits into
Open
michaelstaib wants to merge 3 commits into
michaelstaib wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change to reuse evaluated include flags in incremental plans.
No open issues 🎉
What changed in this PR
This PR removes duplicate include-condition evaluation for conditional incremental plans in the Fusion gateway, building on #150’s deferred-group exclusion handling.
Changes:
- Stores evaluated include flags alongside resolved delivery groups and reuses them when incremental plans start.
- Adds a required nullable flags parameter to context initialization, retaining evaluation when no flags are supplied.
- Updates production and test call sites without changing plan versions, JSON formats, or snapshots.
| File | Description |
|---|---|
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/OperationPlanContextRoutingTests.cs |
Passes explicit null flags in routing setup. |
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/OperationPlanContextResetTests.cs |
Passes explicit null flags in reset setup. |
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/OperationPlanContextPoolingTests.cs |
Updates the pooling fixture’s initialization call. |
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/ExecutionNodeCompletionTests.cs |
Updates completion-test context initialization. |
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Clients/SourceSchemaClientTestBase.cs |
Updates shared client-test context setup. |
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Clients/AliasBatching/AliasBatchRequestSelectionTests.cs |
Updates alias-batching context setup. |
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanExecutor.cs |
Stores and forwards per-request include flags. |
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanContext.Pooling.cs |
Uses supplied flags or evaluates them when null. |
Review effort: Balanced
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.
The gateway evaluated the include flags of a conditional incremental plan twice per request.
FindExcludedIncrementalPlansevaluated them to check whether the plan's groups are all excluded, andOperationPlanContext.Initializeevaluated them again when the plan started.Changes:
OperationPlanContext.Initialize, which evaluates them only when none are given.Initializetakes the flags as a required parameter, and every call site passes them explicitly.No new allocation: the map already exists and the flags are stored inline. Requests without conditional incremental plans are unchanged. No
OperationPlanner.Versionbump, no plan JSON change, no snapshot changes.Stacked on #150.
Tests: Fusion.Execution.Tests and Fusion.AspNetCore.Tests
DeferTestson net10.0 and net8.0, unchanged and green.No benchmark was run.