Skip to content

[Fusion] Add depth limit to satisfiability validator#9486

Merged
glen-84 merged 4 commits intomainfrom
gai/satisfiability-validator-depth-limit
Mar 31, 2026
Merged

[Fusion] Add depth limit to satisfiability validator#9486
glen-84 merged 4 commits intomainfrom
gai/satisfiability-validator-depth-limit

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Mar 30, 2026

Summary of the changes (Less than 80 chars)

  • [Fusion] Add depth limit to satisfiability validator.

Copilot AI review requested due to automatic review settings March 30, 2026 15:38
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

Adds a recursion depth guard to Fusion’s satisfiability validation to prevent stack overflows on large/cyclic schemas, with a regression test to cover the scenario.

Changes:

  • Introduce a maximum recursion depth check in SatisfiabilityValidator.VisitObjectType.
  • Track current traversal depth in SatisfiabilityValidatorContext.
  • Add a stress/regression test that builds a large cyclic type graph across multiple schemas and asserts validation completes successfully.

Reviewed changes

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

File Description
src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs Adds depth tracking and a hard cutoff to avoid runaway recursion/stack overflow during satisfiability validation.
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SatisfiabilityValidatorTests.cs Adds a test that constructs a large type cycle across multiple schemas to ensure validation doesn’t stack overflow.

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

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

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

Files not reviewed (1)
  • src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.Designer.cs: Language not supported

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

@glen-84 glen-84 marked this pull request as draft March 30, 2026 17:36
@glen-84 glen-84 marked this pull request as ready for review March 31, 2026 08:04
@glen-84 glen-84 merged commit c76b385 into main Mar 31, 2026
129 checks passed
@glen-84 glen-84 deleted the gai/satisfiability-validator-depth-limit branch March 31, 2026 08:07
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (89150fc) to head (06a6220).
⚠️ Report is 1 commits behind head on main.

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

☔ 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants