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

[release/6.0] Regression Fix - Update HostFactoryResolver, set the app name via an argument #60132

Merged
merged 2 commits into from
Oct 9, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 7, 2021

Backport of #60053 to release/6.0
Updates HostFactoryResolver to account for lack of application name with new host pattern and adds test.

Description

Changes to the templates for 6.0 required a new mechanism for tools to discover and use registered services in an ASP.NET Core or any other app based on a hosted service provider. This new mechanism results in a host setup that does not by default have an application name available. This in turn results in user secrets not being found, and so any tooling that is using user secrets will fail. This was discovered using EF Core which supports obtaining the database connection string from user secrets.

The fix is to set a default application name based on the assembly when using this new mechanism to discover services.

Customer impact

EF Core database operations executed from the command line may fail, or worse, use the wrong connection string and update the wrong database.

How found

Customer reported on RC1.

Regression

Yes and no. It's a regression to the experience when the new templates or the patterns shipped in those templates are used. It is not technically a regression if the application is still using the patterns from previous versions.

Testing

Testing is tricky here because this runtime package is consumed as source in EF Core. This is what we have done and plan to do:

  • We have manually tested end-to-end with EF Core by including the updated source in an EF Core local build.
  • We have added unit tests as part of this PR.
  • We have unit tests in EF Core that will validate that the change flows into EF Core correctly. See [6.0] Test changes to make sure applicationName is set when using new template pattern efcore#26204.
  • Once the change has made its way into EF Core, we will test again end-to-end using a daily build of the EF Core GA package.
  • We will do a final end-to-end test once the GA build for validation is available.

Risk

Low. Simple code change to add a default application name on in the new code path introduced in 6.0.

@ghost
Copy link

ghost commented Oct 7, 2021

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

Issue Details

Backport of #60053 to release/6.0

/cc @ericstj @maryamariyan

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: -
Labels:

area-Extensions-Hosting

Milestone: -

@ericstj ericstj requested review from davidfowl and eerhardt and removed request for davidfowl October 7, 2021 18:10
@ericstj ericstj added the Servicing-approved Approved for servicing release label Oct 7, 2021
@ericstj
Copy link
Member

ericstj commented Oct 7, 2021

Approved in tactics if I'm not mistaken @ajcvickers

…pplicationNameSetFromAgrument/ApplicationNameSetFromAgrument.csproj

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
@ericstj
Copy link
Member

ericstj commented Oct 9, 2021

Failure here is due to #60119 which has been fixed with #60140.

@dotnet/runtime-infrastructure can this be merged, please?

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

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

LGTM infra-wise, I see no issues there, the library test failure is obviously unrelated to this change.

@safern safern merged commit 3a81450 into release/6.0 Oct 9, 2021
@safern safern deleted the backport/pr-60053-to-release/6.0 branch October 9, 2021 00:20
@ericstj
Copy link
Member

ericstj commented Oct 9, 2021

Thank you @safern

@ghost ghost locked as resolved and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Hosting Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants