Skip to content

Validate and uniquify complex-property column names - #39290

Merged
AndriySvyryd merged 8 commits into
mainfrom
copilot/uniquify-columns-mapped-to-complex-types
Nov 5, 2026
Merged

AndriySvyryd merged 8 commits into
mainfrom
copilot/uniquify-columns-mapped-to-complex-types

Conversation

Copilot AI commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Complex-property columns could collide across complex paths or inherited mappings without being rejected. Convention exemptions could also leave distinct properties sharing a generated column name.

  • Validation

    • Compare containing entity hierarchies and include inherited mapped properties.
    • Reject invalid collisions while preserving intentional sibling and table-sharing mappings.
  • Uniquification

    • Resolve same-hierarchy collisions, including primary-key and concurrency-token columns.
    • Respect explicit names and preserve base column names where possible.
    • Leave default column prefixes unchanged.
  • Regression coverage

    • Cover nested paths, inheritance, identifier truncation, configuration precedence, and intentional sharing.

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.

🟡 Changes recommended

Renaming generated concurrency-token columns can leave table-sharing dependents without required mappings, causing model validation to fail.

1 open issue
What changed in this PR

This PR strengthens EF Core’s relational column validation and naming for complex properties.

Changes:

  • Detects collisions across complex paths and inherited mappings.
  • Uniquifies convention-generated names while respecting explicit configuration and intentional sharing.
  • Adds regression coverage and model-building guidance.
File Description
test/​EFCore.Relational.Tests/​Metadata/​Conventions/​SharedTableConventionTest.cs Tests naming collisions, inheritance, and configuration precedence.
test/​EFCore.Relational.Tests/​Infrastructure/​RelationalModelValidatorTest.cs Tests invalid collisions and permitted sharing.
src/​EFCore.Relational/​Metadata/​Conventions/​SharedTableConvention.cs Refines hierarchy-aware column uniquification.
src/​EFCore.Relational/​Infrastructure/​RelationalModelValidator.cs Validates inherited properties and containing entity hierarchies.
.agents/​skills/​model-building/​SKILL.md Documents the generated-column uniqueness requirement.

Review effort: Balanced

@AndriySvyryd
AndriySvyryd marked this pull request as ready for review October 16, 2026 21:27
@AndriySvyryd
AndriySvyryd requested review from a team and wtgodbe as code owners October 16, 2026 21:27
Copilot AI balanced review requested due to automatic review settings October 16, 2026 21:27
Copilot AI requested a review from AndriySvyryd October 16, 2026 21:28
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Agent evaluation: model-building

Status: error for fcd28710c9bd32179bb69f2f58e4bcb33eeeeede
Treatment quality threshold: ✅ passed
Required skill activation model-building: ✅ passed

An error occurred while generating the evaluation report.

Download Vally reports · View workflow run

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.

🟡 Changes recommended

Validation can still miss same-entity collisions when another entity supplies the first shared-column mapping.

1 open issue
1 resolved since last review

Review effort: Balanced

@github-code-quality

github-code-quality Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: C#

C# / code-coverage

main 716a0a9 copilot/uniquify-col... e9f249c +/-
76% 76% 0%
View coverage of the 10 most impacted files.
File main 716a0a9 copilot/uniquify-col... e9f249c +/-
src/Microsoft.D...nnectionPool.cs 100% 97% -3%
src/Shared/NonC...yInitializer.cs 12% 12% 0%
src/EFCore.Rela...alConnection.cs 93% 93% 0%
src/EFCore.Rela...leConvention.cs 88% 88% 0%
src/EFCore.Rela...delValidator.cs 95% 95% 0%
src/EFCore.Anal...icSuppressor.cs 96% 96% 0%
src/EFCore.Cosm...erExtensions.cs 100% 100% 0%
src/EFCore.Cosm...erExtensions.cs 46% 46% 0%
src/EFCore.Cosm...peExtensions.cs 73% 73% 0%
src/EFCore.Rela...osticsLogger.cs 98% 99% +1%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 30, 2026 20:35 UTC

Copilot AI balanced review requested due to automatic review settings October 16, 2026 22:07
Copilot AI requested a review from AndriySvyryd October 16, 2026 22:07
@github-actions

Copy link
Copy Markdown
Contributor

Agent harness evaluation is stale

Evaluation does not run automatically for new commits. A contributor with write access can comment /eval to run all affected components or /eval component-name to run one component.

Comment thread .agents/skills/model-building/SKILL.md Resolved
Copilot AI balanced review requested due to automatic review settings October 30, 2026 02: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.

🟡 Changes recommended

The TPC tests incorrectly assume unprefixed default column names for inherited complex properties, causing assertions to fail instead of exercising the intended column-name collisions.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 30, 2026 18:52

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.

🟢 Approval recommended

No active review issues remain for the relational column-name validation and uniquification changes.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 30, 2026 19:56
Copilot AI requested a review from AndriySvyryd October 30, 2026 19:57

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.

🟢 Approval recommended

The supplied review evidence identifies no active issues requiring resolution before approval.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@AndriySvyryd
AndriySvyryd enabled auto-merge (squash) November 3, 2026 20:38
@AndriySvyryd
AndriySvyryd merged commit 14811c0 into main Nov 5, 2026
22 of 23 checks passed
@AndriySvyryd
AndriySvyryd deleted the copilot/uniquify-columns-mapped-to-complex-types branch November 5, 2026 09:55
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 6, 2026
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