-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Default to using Humanizer.Core as reverse engineeer pluralizer #20577
Conversation
How do I investigate the test failures? (all tests passed on my Windows machine) |
Seems like intermittent issue. I restarted runs. |
@smitpatel Thanks, tests still fail - how do I as a contributor view the logs? |
|
@smitpatel Thanks a lot "You can click on build number to reach the build page for particular PR. " was the missing link! The "View more details" link was too deep 😄 |
@@ -26,6 +26,7 @@ | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Humanizer.Core" Version="$(HumanizerCorePackageVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dotnet/efcore We should discuss whether or not we want to take a direct dependency here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be privateassets all would solve our concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, tried that, but then the tests failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the dependency wouldn't flow into test project either. To clear up confusion, if you use privateassets all and use the tool in user application, does it pluralize/singularize correctly? We can hack our way for tests if functionality for user works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how to test that, but if someone can tell me how, I can give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smitpatel Sorry, I cannot figure out how to do that - can you provide more detailed steps.
I try to run from with VS with F5, and set the following debug parameters in project properties/Debug:
dbcontext scaffold "Data Source=(localdb)\mssqllocaldb;Intital Catalog=Northwind;Integrated Security=true" Microsoft.EntityFrameworkCore.SqlServer -o C:\temp\test\ef
But get: Missing required option '--assembly'.
I can run: dbcontext scaffold --help
and get a useful help message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done such testing on command line only. No trust for VS. Alternatively, you should be able to build package with these changes and use the custom build package in a sample app to install EFCore.Tools and use PMC commands to test out in VS.
I will investigate on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish there was a simple way to do this, that sounds exceedingly complicated @bricelam ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not important for me to test in VS, but the command line throws same error!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I added "privateAssets all" and added an explicit reference from the Desing.Test project - that worked.
How do I integration test this? |
@ErikEJ - You can add integration tests in CSharpEntityTypeGeneratorTest. |
@bricelam I'm pretty sure we decided that it was okay to have pluralization on by default for reverse engineering, right? That is, we won't consider it a breaking change if the pluralization gets updated and we then start scaffolding with different names. |
@Pilchie We want to bring in https://www.nuget.org/packages/Humanizer.Core/ as a third-party dependency for Microsoft.EntityFrameworkCore.Design. What steps do we need to take? |
Let's discuss in a design meeting. I feel like it's ok so long as we have an option (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Sounds like we have a couple things to discuss in the next design meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good.
Things to discuss as a team:
- Should we remove NullPluralizer
- Should we pluralize by default?
- If so, do we need an option to disable pluralization?
Discussed as a team. Decisions:
Other follow-up questions:
|
Any proposal for implementation? How would you pass that all the way through - to the Pluralizer?
How would that prevent disruption, since pluralization is now on by default, and disabling it is an opt-in? |
@ErikEJ We just want to avoid having people not be able to use the preview because they can't switch the behavior back to the way they want it without messing with services. |
Makes sense. How do you propose floating the option? How to implement "opt out" ? |
Fine, will await some proposals from @bricelam |
Updated:
|
src/EFCore.Design/Scaffolding/Internal/RelationalScaffoldingModelFactory.cs
Outdated
Show resolved
Hide resolved
@bricelam Thanks, Neo! |
374605b
to
f43c845
Compare
Fix test localization bug fixes dotnet#11160
Fix test localization bug
fixes #11160