Conversation
dkattan
force-pushed
the
feature/fac109-migration-complexity-analyzer
branch
from
July 28, 2026 11:49
12a9bf9 to
f3d0d72
Compare
dkattan
marked this pull request as draft
July 28, 2026 12:06
Scores handwritten DTOs for Facet migration difficulty: - Info severity: easy migration (all get/set auto-properties) - Warning severity: needs behavior changes (read-only or computed props) Features: - Shadow cache (ConditionalWeakTable<Compilation, ConcurrentDictionary>) inspired by Vogen's BoundedCache pattern, keyed by Compilation with SymbolEqualityComparer for proper symbol equality - Fail-fast: throws InvalidOperationException on unexpected manifest state - Gratuitous logging with severity levels (DEBUG-only via Conditional attribute) - DTO-to-entity name matching by stripping common prefixes/suffixes - Skips entity classes themselves and already-Facet-configured types - 10 unit tests covering easy/medium/no-diagnostic/multiple-DTO scenarios Includes devloop-fac109.sh inner dev loop script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…teTime detection - Read-only properties are no longer a migration blocker (GenerateReadOnlyProperties handles init-only) - Computed properties move to OnInitialized hook - DateTime/DateTimeOffset detection for PropertySuffix suggestions - Updated diagnostic messages and test expectations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 'RequestBody' and 'Body' to suffix list, track DtoKind (Response, Create, Update) from prefix, adjust line savings estimate per kind, update diagnostic message to show kind label, add per-kind configured filtering so entities with only Response configured still surface Create/Update candidates. Add 3 new tests for Create/Update request DTO matching and configured filtering. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dkattan
force-pushed
the
feature/fac109-migration-complexity-analyzer
branch
from
July 28, 2026 15:10
ad5bb79 to
0ed75b7
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cancel the token immediately instead of after 5ms to eliminate a race condition on fast CI runners. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds a Roslyn analyzer (FAC109) that scores the migration complexity of handwritten DTOs that could be replaced with Facet-generated partials. For each handwritten class that corresponds to a manifest entity, the analyzer counts entity-shaped properties, read-only properties, computed properties, and Sieve-attributed properties, then reports a diagnostic whose severity encodes the difficulty.
Changes
src/Facet/Analyzers/MigrationComplexityAnalyzer.cs: New analyzer that matches handwritten DTOs to manifest entities and scores migration complexitytest/Facet.Tests/UnitTests/Core/GenerateDtos/MigrationComplexityAnalyzerTests.cs: Comprehensive test coveragedevloop-fac109.sh: Development loop script for rapid iterationsrc/Facet/AnalyzerReleases.Unshipped.md: FAC109 rule registrationFeatures
Split out from #408 — this analyzer depends on the EF model manifest infrastructure but is independent of the TsInterfaceName feature.
🤖 Generated with Copilot
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com