-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Update SDK to bring in RSG one assembly changes #30827
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
Changes from all commits
755513d
8c2efb6
e84fe3b
0e4c0f0
63e71c1
c19003c
4986a10
79e023c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,14 +31,8 @@ public WebAuthenticationTests(WebApplicationFactory<Startup> fixture) | |
public static TheoryData<string> NotAddedEndpoints => | ||
new TheoryData<string>() | ||
{ | ||
"/AzureAD/Account/AccessDenied", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happened here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, previously, the Azure AD UI projects used a NullApplicationFactory and instead relied on their own logic to discover the application parts from the related assembly (see https://github.com/dotnet/aspnetcore/pull/31039/files#diff-754ffcfbe4655cc4cca0a446a4f1b0eb3552a8795c136385b6ffad03259e0a7dL199). This API gets invoked from the Since the views are compiled into the app assembly and we are no longer using the The controllers don't change though because those are discovered with a feature provider that exists outside of the views story. |
||
"/AzureAD/Account/Error", | ||
"/AzureAD/Account/SignedOut", | ||
"/AzureAD/Account/SignIn", | ||
"/AzureAD/Account/SignOut", | ||
"/AzureADB2C/Account/AccessDenied", | ||
"/AzureADB2C/Account/Error", | ||
"/AzureADB2C/Account/SignedOut", | ||
"/AzureADB2C/Account/SignIn", | ||
"/AzureADB2C/Account/ResetPassword", | ||
"/AzureADB2C/Account/EditProfile", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ public static IdentityBuilder AddDefaultUI(this IdentityBuilder builder) | |
private static readonly IDictionary<UIFramework, string> _assemblyMap = | ||
new Dictionary<UIFramework, string>() | ||
{ | ||
[UIFramework.Bootstrap4] = "Microsoft.AspNetCore.Identity.UI.Views.V4", | ||
[UIFramework.Bootstrap4] = "Microsoft.AspNetCore.Identity.UI.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this goes away. This used to switch the related part but we're not generating any now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. You're right. I should've looked way closer at this. I made the appropriate changes in #31039. |
||
}; | ||
|
||
private static void AddRelatedParts(IdentityBuilder builder) | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -32,10 +32,7 @@ public void ConfigureServices(IServiceCollection services) | |||
typeof(ComponentFromServicesViewComponent), | ||||
typeof(InServicesTagHelper))); | ||||
|
||||
var relatedAssenbly = RelatedAssemblyAttribute | ||||
.GetRelatedAssemblies(GetType().Assembly, throwOnError: true) | ||||
.SingleOrDefault(); | ||||
foreach (var part in CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(relatedAssenbly)) | ||||
foreach (var part in CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(Assembly.GetExecutingAssembly())) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't the consolidated part factory already take care of this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does. However, this particularly startup logic removes all the discovered application parts and adds its own.
I think it does this to validate the behavior of the specific extension methods used here. |
||||
{ | ||||
manager.ApplicationParts.Add(part); | ||||
} | ||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#nullable enable | ||
Microsoft.AspNetCore.Mvc.Razor.Extensions.ConsolidatedMvcViewDocumentClassifierPass | ||
Microsoft.AspNetCore.Mvc.Razor.Extensions.ConsolidatedMvcViewDocumentClassifierPass.ConsolidatedMvcViewDocumentClassifierPass() -> void | ||
~static readonly Microsoft.AspNetCore.Mvc.Razor.Extensions.ConsolidatedMvcViewDocumentClassifierPass.MvcViewDocumentKind -> string | ||
*REMOVED*Microsoft.AspNetCore.Mvc.Razor.Extensions.MvcViewDocumentClassifierPass.MvcViewDocumentClassifierPass() -> void | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eh, since we're doing this in multiple classes now I think using a constructor that takes a flag will be better than duplicating the code to avoid ragrets later. |
||
*REMOVED*Microsoft.AspNetCore.Mvc.Razor.Extensions.RazorPageDocumentClassifierPass.RazorPageDocumentClassifierPass() -> void | ||
Microsoft.AspNetCore.Mvc.Razor.Extensions.MvcViewDocumentClassifierPass.MvcViewDocumentClassifierPass(bool useConsolidatedMvcViews = false) -> void | ||
Microsoft.AspNetCore.Mvc.Razor.Extensions.RazorPageDocumentClassifierPass.RazorPageDocumentClassifierPass(bool useConsolidatedMvcViews = false) -> void |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -36,14 +36,15 @@ public static void Register(RazorProjectEngineBuilder builder) | |||||||||
builder.Features.Add(new ModelExpressionPass()); | ||||||||||
builder.Features.Add(new PagesPropertyInjectionPass()); | ||||||||||
builder.Features.Add(new ViewComponentTagHelperPass()); | ||||||||||
builder.Features.Add(new RazorPageDocumentClassifierPass()); | ||||||||||
|
||||||||||
if (builder.Configuration.UseConsolidatedMvcViews) | ||||||||||
{ | ||||||||||
builder.Features.Add(new ConsolidatedMvcViewDocumentClassifierPass()); | ||||||||||
builder.Features.Add(new RazorPageDocumentClassifierPass(useConsolidatedMvcViews: true)); | ||||||||||
builder.Features.Add(new MvcViewDocumentClassifierPass(useConsolidatedMvcViews: true)); | ||||||||||
Comment on lines
+42
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need the if |
||||||||||
} | ||||||||||
else | ||||||||||
{ | ||||||||||
builder.Features.Add(new RazorPageDocumentClassifierPass()); | ||||||||||
builder.Features.Add(new MvcViewDocumentClassifierPass()); | ||||||||||
} | ||||||||||
|
||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yarn expects there to be a lock file even it if is empty. Commiting this to avoid the annoyance of always having this as an untracked file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BrennanConroy why do you do this to us? |
||
# yarn lockfile v1 | ||
|
||
|
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.
The build for this codepath relies on the
RazorPageDocumentClassifier
which we didn't update to support consolidated views. As a result, the types generated in the output assembly are still public and picked up by the public API analyzer during the build.I fixed this in this PR but we'll need to wait for the aspnetcore -> SDK -> installer flow with this change to finish before we can remove this check.
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.
Fair enough. I would block on that, but it's good that we picked it up quickly