Repository navigation
Validation: rules from base classes, interfaces, [InheritFrom], [Mutable] and other assemblies - #3384
Merged
david-driscoll merged 5 commits intoDec 4, 2026
Conversation
…de, [Mutable] and other assemblies A validator now holds only the rules declared for its type, with a public rule method for each member (the rule manifest) and a ValidateDeclared that runs them. The validator of a type calls the validator of every base class and interface that has rules, in the compilation or in a referenced assembly, so a type with no rules of its own is validated by what it derives from. [InheritFrom] and Include carry rules member by member, with their services and whether they wait; LPAD3112 says which rules can't be carried. The validator of a [Mutable] view model validates the whole value as the type it is of. Every validator is an IValidateMembers, which checks one member at a time. A Validate function may declare rules for a type of another assembly: its validator runs the other assemblies' and replaces their registration. LPAD3113 is an asynchronous rule added to a type its own assembly validates synchronously. Which members [InheritFrom] and [Mutable] write moves to src/Shared, linked into both analyzer assemblies. Part of #3378. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Dec 4, 2026
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 171 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This was referenced Dec 4, 2026
|
Test Results 33 files 33 suites 1h 16m 21s ⏱️ Results for commit 5def661. ♻️ This comment has been updated with latest results. |
SummarySummary
CoverageRocket.Surgery.LaunchPad.Analyzers - 92.5%
Rocket.Surgery.LaunchPad.AspNetCore - 79.7%
Rocket.Surgery.LaunchPad.AspNetCore.Mvc - 86.1%
Rocket.Surgery.LaunchPad.EntityFramework - 100%
Rocket.Surgery.LaunchPad.Foundation - 87.5%
Rocket.Surgery.LaunchPad.Foundation.Tasks - 83.9%
Rocket.Surgery.LaunchPad.Grpc - 100%
Rocket.Surgery.LaunchPad.Hosting - 100%
Rocket.Surgery.LaunchPad.HotChocolate - 35.7%
Rocket.Surgery.LaunchPad.NodaTime - 97.4%
Rocket.Surgery.LaunchPad.NodaTime.HotChocolate - 100%
Rocket.Surgery.LaunchPad.NodaTime.StrawberryShake - 100%
Rocket.Surgery.LaunchPad.Primitives - 100%
Rocket.Surgery.LaunchPad.Primitives.Analyzers - 96.4%
Rocket.Surgery.LaunchPad.Spatial - 83%
Rocket.Surgery.LaunchPad.StrawberryShake - 100%
Rocket.Surgery.LaunchPad.StrawberryShake.Spatial - 44.8%
Rocket.Surgery.LaunchPad.Validation - 58.5%
Rocket.Surgery.LaunchPad.Validation.Analyzers - 95.4%
Rocket.Surgery.LaunchPad.ZeroAlloc.AspNetCore - 65.5%
Sample.BlazorServer - 27.6%
Sample.BlazorWasm - 19.2%
Sample.Classic.Restful - 8.5%
Sample.Command - 7.2%
Sample.Core - 86.2%
Sample.Graphql.Executable - 85.8%
Sample.Grpc - 85.1%
Sample.Minimal - 70.7%
Sample.Pages - 13%
Sample.Restful - 71.7%
Sample.Worker - 2.9%
|
david-driscoll
marked this pull request as ready for review
December 4, 2026 06:21
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## claude/sad-herschel-7f10db #3384 +/- ##
==================================================
==================================================
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Phase 4 of LaunchPad's own validation (#3374), for #3378. Stacked on #3382: review and merge that one first.
What changes
Ensure{Member}), aValidateDeclaredthat runs them, andValidate, which runs theValidateDeclaredof every validator of what the type is and then its own. These methods and their[GeneratedRule]are the rule manifest the generator reads from referenced assemblies.Validatefunction, apply to every type that derives from or implements it, in the same assembly or across a reference. A type with no rules of its own gets a validator when something it derives from has one.[InheritFrom]andInclude<TOther>()carry rules member by member, with the services they take and whether they wait. LPAD3112 (warning) names the rules that can't be carried: those that read the whole source value, or compare with a member that was not copied.[Mutable<T>]: the view model's validator validates the whole value asT, then the view model's own rules.IValidateMembers<T>: every generated validator checks one member at a time, which a form field needs. A view model checksT's rules for a member without making aT.[InheritFrom]and[Mutable]write moves tosrc/Shared/GeneratedMembers.cs, linked into both analyzer assemblies. The two existing generators are otherwise unchanged (their 1108 tests pass).Not in this pull request
[Mutable]'s generator still writes its ZeroAlloc.Validation validator; it goes with that library in #3380.Test plan
test/Validation.Tests: 72 pass, 13 new inCompositionTests(base class and interface, cross-assembly throughtest/Validation.Tests.Contracts, every source of rules in one validator, asynchronous inherited rule,Include, composed registration, view model whole and by member).test/Validation.Analyzers.Tests: 16 snapshot tests pass, 4 new, covering LPAD3112 and LPAD3113.test/Sdk.TestsSdkValidationTests: a library and an application built from packed packages.test/Analyzers.Tests: 1108 pass.mise run buildon CI.🤖 Generated with Claude Code