Skip to content

Conversation

@tobias-tengler
Copy link
Member

@tobias-tengler tobias-tengler commented Oct 10, 2025

  • Scopes document caches to schema, but not a specific executor
  • Aligns regular Hot Chocolate cache configuration to the options based approach in Fusion
  • Removes IRequestExecutorOptionsMonitor, since async configuration is no longer used

Copilot AI review requested due to automatic review settings October 10, 2025 19:19
@github-actions github-actions bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Oct 10, 2025
Copy link
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 PR moves cache configuration from separate service collection methods to the standard GraphQL options pattern, consolidating cache size settings with other schema options for better consistency and discoverability.

Key changes include:

  • Moving cache size configuration from AddDocumentCache/AddOperationCache methods to SchemaOptions properties
  • Adding proper validation that throws exceptions for invalid cache sizes instead of silently clamping values
  • Updating documentation and tests to reflect the new configuration approach

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md Added migration documentation showing the old vs new cache configuration patterns
src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/FusionOptions.cs Updated cache size validation to throw exceptions instead of silently clamping values
src/HotChocolate/Core/test/Execution.Tests/WarmupRequestTests.cs Simplified service provider access by removing GetCombinedServices() calls
src/HotChocolate/Core/test/Execution.Tests/PreparedOperationCacheTests.cs Updated test to use new ModifyOptions pattern instead of AddOperationCache method
src/HotChocolate/Core/test/Execution.Tests/DocumentCacheTests.cs Added new test for document cache configuration using the new options pattern
src/HotChocolate/Core/src/Types/SchemaOptions.cs Added cache size properties with validation and updated FromOptions method
src/HotChocolate/Core/src/Types/IReadOnlySchemaOptions.cs Added cache size property definitions and fixed truncated comment
src/HotChocolate/Core/src/Execution/RequestExecutorManager.cs Updated cache instantiation to use schema options instead of separate options classes
src/HotChocolate/Core/src/Execution/DependencyInjection/RequestExecutorServiceCollectionExtensions.cs Removed deprecated AddDocumentCache and AddOperationCache methods
src/HotChocolate/Core/src/Execution/DependencyInjection/InternalServiceCollectionExtensions.cs Removed TryAddDefaultCaches method that registered the old cache options
src/HotChocolate/Core/src/Execution/Caching/PreparedOperationCacheOptions.cs Deleted obsolete cache options class

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tobias-tengler tobias-tengler force-pushed the tte/move-cache-configuration-to-options branch from e5d91a1 to 56f1043 Compare October 10, 2025 19:33
@tobias-tengler tobias-tengler marked this pull request as draft October 14, 2025 12:47
@tobias-tengler tobias-tengler force-pushed the tte/move-cache-configuration-to-options branch from 56f1043 to f254399 Compare October 16, 2025 16:28
@tobias-tengler tobias-tengler force-pushed the tte/move-cache-configuration-to-options branch from f254399 to caba57d Compare October 16, 2025 17:19
@tobias-tengler tobias-tengler marked this pull request as ready for review October 16, 2025 18:11
@tobias-tengler tobias-tengler merged commit b159d27 into main Oct 16, 2025
111 checks passed
@tobias-tengler tobias-tengler deleted the tte/move-cache-configuration-to-options branch October 16, 2025 18:24
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (20f556d) to head (55c9c82).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #8793   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants