Skip to content

Update HostFactoryResolver to account for lack of application name with new host pattern #59743

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

Closed
wants to merge 1 commit into from

Conversation

ajcvickers
Copy link
Contributor

Based on dotnet/efcore#26198

The fix should go here, rather than in EF Core, because then anybody using this code will get the fixed behavior. I have tested this locally and it fixes https://github.com/dotnet/efcore/issues/26177. However tests should be added to this repo.

…th new host pattern

Based on dotnet/efcore#26198

The fix should go here, rather than in EF Core, because then anybody using this code will get the fixed behavior. I have tested this locally and it fixes https://github.com/dotnet/efcore/issues/26177. However tests should be added to this repo.
@ghost
Copy link

ghost commented Sep 29, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

Based on dotnet/efcore#26198

The fix should go here, rather than in EF Core, because then anybody using this code will get the fixed behavior. I have tested this locally and it fixes https://github.com/dotnet/efcore/issues/26177. However tests should be added to this repo.

Author: ajcvickers
Assignees: -
Labels:

area-Extensions-Hosting

Milestone: -

@ajcvickers
Copy link
Contributor Author

@davidfowl You're probably the best person to add tests here.

ajcvickers added a commit to dotnet/efcore that referenced this pull request Sep 29, 2021
…ate pattern

EF-side tests for dotnet/runtime#59743

These will fail until the new source package for HostFactoryResolver is available. I have tested locally that they work once this is done.
@ajcvickers
Copy link
Contributor Author

I have added tests on the EF side of this: dotnet/efcore#26204. Testing should still be done here.

=> arg.Equals("--applicationName", StringComparison.OrdinalIgnoreCase) ||
arg.Equals("/applicationName", StringComparison.OrdinalIgnoreCase);

args = args.Any(arg => IsApplicationNameArg(arg)) || assembly.FullName is null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is assembly.FullName null?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you're writing unit tests 😄

@maryamariyan
Copy link
Contributor

@ajcvickers thanks for initiating the fix here. Seems like it needs unit test to go with it. Are you planning on adding the test for this? If you'd prefer, I could take over the PR from here, let me know thanks.

@ajcvickers
Copy link
Contributor Author

@maryamariyan I was hoping @davidfowl would do it, since he made the change that broke things. Or am I expecting too much from a partner architect? :trollface: But if you want to let him off easy then go for it...

@davidfowl
Copy link
Member

Or am I expecting too much from a partner architect? :trollface: But if you want to let him off easy then go for it...

Entirely, but we have a slew of wonderful tests here https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs 😄

@maryamariyan maryamariyan self-assigned this Sep 30, 2021
@maryamariyan
Copy link
Contributor

Closing this PR in favor of #60053

@akoeplinger akoeplinger deleted the ajcvickers-host-factory-resolver branch October 7, 2021 18:38
ajcvickers added a commit to dotnet/efcore that referenced this pull request Oct 11, 2021
…ate pattern

EF-side tests for dotnet/runtime#59743

These will fail until the new source package for HostFactoryResolver is available. I have tested locally that they work once this is done.
@ghost ghost locked as resolved and limited conversation to collaborators Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants