Skip to content

Fix detailed Nitro schema change diagnostics - #10180

Merged
michaelstaib merged 4 commits into
mainfrom
mst/more-change-events
Aug 1, 2026
Merged

Fix detailed Nitro schema change diagnostics#10180
michaelstaib merged 4 commits into
mainfrom
mst/more-change-events

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings August 1, 2026 06:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves Nitro schema change diagnostics by requesting the correct nested schema change details from the Nitro API and formatting more informative schema change messages in the Aspire integration.

Changes:

  • Fix the PollNitroSchemaValidation operation to query SchemaChange details/leaves (instead of SchemaChangeLogEntry) and include severity/__typename on leaves.
  • Improve NitroSchemaValidator schema change descriptions, especially for field add/remove, using fieldName and typeName.
  • Update persisted operation hash and adjust affected tests/snapshots to the new diagnostic output.

Reviewed changes

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

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/Nitro/NitroSchemaValidatorTests.cs Updates expected schema-change diagnostic text in validator test data.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/Nitro/NitroSchemaValidationFormatterTests.cs Updates formatter expectations to match the new detailed schema-change message.
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/Nitro/NitroOperationDocumentsTests.cs Adds coverage to validate the schema validation document includes the new schema change fragments.
src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/Operations/PollNitroSchemaValidation.graphql.sha256 Updates the persisted operation hash for the modified GraphQL document.
src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/Operations/PollNitroSchemaValidation.graphql Fixes fragment type conditions and requests nested schema change details/leaves correctly.
src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroSchemaValidator.cs Enhances schema change message generation for field add/remove and field-change cases.

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

Comment on lines +75 to +83
Assert.Contains(
"fragment SchemaChangeDetail on SchemaChange",
document,
StringComparison.Ordinal);
Assert.Contains(
"fragment SchemaChangeLeaf on SchemaChange",
document,
StringComparison.Ordinal);
}
Comment on lines +645 to +653
"FieldAddedChange" => DescribeFieldChange(change, "added"),
"FieldRemovedChange" => DescribeFieldChange(change, "removed"),
"InputFieldChanged" => DescribeNamedFieldChange(change, "Input field"),
"OutputFieldChanged" => DescribeNamedFieldChange(change, "Output field"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added a focused FieldAddedChange entry to the KnownTerminalFailureData theory in this commit. The test verifies that typeName ("Product") and fieldName ("price") are correctly surfaced through DescribeFieldChange, producing "Field 'price' was added to type 'Product'." in the violation output.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

55.6% of changed lines covered (45/81)

File Covered Changed Patch %
…/Fusion/src/Fusion.Aspire/Nitro/NitroSchemaValidator.cs 30 64 46.9% 🔴
…/src/Fusion.Aspire/Nitro/NitroSchemaValidationFormatter.cs 13 15 86.7% 🟡
…/src/Fusion.Aspire/Nitro/NitroSchemaValidationReport.cs 2 2 100.0% 🟢
Uncovered changed lines (JSON)
{
  "sha": "770e7bf3984907a8590ad3b444fb2455e25bcc12",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroSchemaValidator.cs", "ranges": [[649, 649], [651, 651], [653, 653], [656, 661], [668, 670], [672, 672], [674, 677], [679, 679], [681, 681], [683, 687], [689, 690], [693, 693], [697, 703]] },
    { "path": "src/HotChocolate/Fusion/src/Fusion.Aspire/Nitro/NitroSchemaValidationFormatter.cs", "ranges": [[156, 156], [158, 158]] }
  ]
}

Project coverage: 54.0% (237606/439971 lines)

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ michaelstaib
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@michaelstaib
michaelstaib requested a review from Copilot August 1, 2026 09:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 8 out of 8 changed files in this pull request and generated no new comments.

@michaelstaib
michaelstaib merged commit a6f0311 into main Aug 1, 2026
148 of 149 checks passed
@michaelstaib
michaelstaib deleted the mst/more-change-events branch August 1, 2026 09:19
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.

4 participants