Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0.3] Don't generate Fluent API in model snapshot for certain annotations #23852

Merged
merged 1 commit into from
Jan 13, 2021

Conversation

roji
Copy link
Member

@roji roji commented Jan 11, 2021

Fixes #23456, replaces #23847

Description

When generating the model snapshot for migrations, provider extension method calls generated for certain annotations are ambiguous across providers. This change replaces these ambiguous calls will direct reading of the associated metadata attribute, which was what we generated before 5.0, and is what we still generate for unknown annotations.

Customer Impact

When both SQL Server and Npgsql are used, fluent API calls are mismatched, leading to incorrect migration logic. Specifically, the same migration code is scaffolded again and again because the previous code doesn't work correctly. (Note that most cases cause compiler warnings. However, for some attributes there are different numbers of parameters on the extension methods, which causes the compiler to silently choose the incorrect one.)

How found

Reported by multiple customers on 5.0.x releases.

Test coverage

We have added test coverage in this PR. We have also done due diligence to find any other annotations that have this same issue.

Regression?

Yes.

Risk

Low. Only affects the design-time model context generation for migrations (no runtime impact).

@roji roji requested a review from a team January 11, 2021 18:21
@roji roji changed the base branch from main to release/5.0 January 11, 2021 18:22
@roji
Copy link
Member Author

roji commented Jan 11, 2021

/azp run all

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@roji roji changed the title Don't generate Fluent API in model snapshot for certain annotations [5.0.3] Don't generate Fluent API in model snapshot for certain annotations Jan 11, 2021
@ajcvickers ajcvickers added this to the 5.0.x milestone Jan 11, 2021
@ajcvickers ajcvickers modified the milestones: 5.0.x, 5.0.3 Jan 12, 2021
@wtgodbe wtgodbe merged commit 8e7ac85 into release/5.0 Jan 13, 2021
@wtgodbe wtgodbe deleted the ModelSnapshotFluentAPI branch January 13, 2021 17:16
@ajcvickers ajcvickers removed this from the 5.0.3 milestone Jan 14, 2021
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.

Builder method mismatch across providers in model snapshot
5 participants