You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
main does not build since #332 merged: CA1506 on Schema (class coupling 97, limit 96) #336
Every target framework of Schema/Schema.csproj fails to compile on main (f3b46fc):
Schema/Models/Schema.cs(18,22): error CA1506: 'Schema' is coupled with '97' different types from '18' different namespaces. Rewrite or refactor the code to decrease its class coupling below '96'.
.editorconfig sets dotnet_diagnostic.CA1506.severity = error, so this breaks the build, not just the lint. The scheduled CI run on main fails: run 39869970714. Any open PR based on main, including the Dependabot PRs, will go red for the same reason.
Cause
The failure came from merging several PRs together. Building the first-parent merges in order:
#332 adds SchemaRename and SchemaRenameKind to the Schema partial class (Schema/Models/Schema.cs, Schema/Models/Schema.Rename.cs). That fit the budget on #332's own base. By the time it merged, #318 and #319 had already added references to main (for example, ReportReservedNames uses Generation.SchemaGenerator/ISchemaCodeGenerator in Schema.Validation.cs), and the combination tips over the limit.
Fix / acceptance criteria
Bring Schema's coupling back under the limit by moving logic out of the type rather than suppressing the warning. Two options:
Move the rename-history bookkeeping (RecordRename, RenamesInternal) into its own collection type.
Move ReportReservedNames/GeneratedFileNames into a separate validator helper.
If you suppress it instead, use a SuppressMessage with a justification.
dotnet build and dotnet test pass on main for net8.0, net9.0 and net10.0, and CI is green.
Optionally, require branches to be up to date before merging, so batched merges cannot break main again.
Duplicates / in progress: none found. No open PR references this issue.
Notes: The issue already recommends extracting rename-history bookkeeping or ReportReservedNames instead of suppressing the warning. Turning on "require branches to be up to date" would stop batched merges from breaking main like this again.
Activity
matt-edmondson commentedon Oct 25, 2026
Triage
main)maingoes red too, including Dependabot Bump the ktsu group with 8 updates #334 and Bump ktsu.ForceDirectedLayout and 3 others #335 and the hook PR Add a SessionStart hook for Claude Code cloud sessions #325.Schema/Models/Schema*.cspartial class (coupling budget, CA1506)mainbuilds.ReportReservedNamesinstead of suppressing the warning. Turning on "require branches to be up to date" would stop batched merges from breakingmainlike this again.Generated by Claude Code