Skip to content

Conversation

donker
Copy link
Contributor

@donker donker commented Oct 3, 2025

This PR is a first submission of the work of the MVC Pipeline team to bring the main project up to date with what has been developed in a forked repo.

donker and others added 30 commits March 20, 2025 11:36
client dependecy for mvc (because it not exist in nuget)
@mitchelsellers
Copy link
Contributor

@bdukes @donker I believe we discussed that this is just a reset PR and initial review, as it is into their branch correct? High level review only?

@valadas
Copy link
Contributor

valadas commented Oct 3, 2025

Awesome, I'll try to get my review in this weekend...

@mitchelsellers
Copy link
Contributor

@donker In looking at this at this moment the solution isn't building, would you be able to review this and resolve the issue?

[IsDependentOn(typeof(CreateUpgrade))]
[IsDependentOn(typeof(CreateNugetPackages))]
[IsDependentOn(typeof(GeneratePackagesChecksums))]
public sealed class BuildPackages : FrostingTask<Context>
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose/goal of this task addition? I'm concerned that this will be deleting a source controlled file.

Copy link
Contributor

Choose a reason for hiding this comment

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

@donker Can you answer this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry ... that is my code bleed. I can delete it. It just builds the packages. But I believe the "default" task also does this.

@mitchelsellers mitchelsellers added this to the Future: Major milestone Oct 7, 2025
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DotNetNuke.ContentSecurityPolicy
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the same as the pending CSP PR into develop?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes it's the same. It need to be removed from here after the pr in develop is merged, so we can remerg it in this branch.
Or some other sujestion how to manage this ?

{
get
{
var settingsVersion = this.dnnSettingsHelper.AreCompositeFilesEnabled();
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the changes to CDF (In pending state now) should this be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the idee is to remove all CDF for mvc that is done here once the changes to CDF are ready to be integrated in this branch.

private static readonly ReaderWriterLockSlim LockFileExistsCache = new ReaderWriterLockSlim();

/// <summary>Adds the necessary configuration to website root <c>web.config</c> to use the Client Dependency component.</summary>
public static void AddConfiguration()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this beind done as a Web.Client item, shouldn't this be handled by the existing functionality? I'm concerned this is going to introduce a duplicate or race condition

Copy link
Contributor

@sachatrauwaen sachatrauwaen Oct 13, 2025

Choose a reason for hiding this comment

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

Yes, you are right, it's will beter to do all the web.config modification in one place.
In reality, this class will be removed once the new CDF is used.

@sachatrauwaen
Copy link
Contributor

sachatrauwaen commented Oct 13, 2025

@donker In looking at this at this moment the solution isn't building, would you be able to review this and resolve the issue?

@mitchelsellers I just try to build a fresh checkout of feature/mvc-pipeline-old without issuues (.\build.ps1).

Can you tell witch build you use or what kind of errors you get ?

@mitchelsellers
Copy link
Contributor

@sachatrauwaen It is the AzureDevOps build that is failing, it looks like it is unit tests that are failing to execute.

The most recent run - https://github.com/dnnsoftware/Dnn.Platform/pull/6749/checks?check_run_id=51891737747

@donker
Copy link
Contributor Author

donker commented Oct 14, 2025

@bdukes @donker I believe we discussed that this is just a reset PR and initial review, as it is into their branch correct? High level review only?

Yes. This is what we discussed in an earlier meeting to have the first code submission a proper PR.

Copy link
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

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

Ok, I found a bit of time and reviewed about the first 1/4 of this PR.

I think we should bring this PR to the minimal viable MVC working state (even if incomplete) just with the minimum to load up an mvc theme and module.

MVC Pipeline and CSP are 2 big ticket items and bringing both in the same PR makes putthing this in a reviewable state hard IMO. The goal of this PR was to have a baseline so that we can review smaller additions in an easier way.

Other than that, it does not have to be in this PR but I would like that we add our stylecop rules to the new projects to enforce our coding standards on this huge amount of new code.

I'll try to review some more the next coming days.

Thanks @sachatrauwaen for this huge contribution!

Comment on lines +212 to +222
private void CheckPermissions()
{
// Verify that the current user has access to edit this module
if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "MANAGE", this.Module))
{
if (!(this.IsSharedViewOnly() && TabPermissionController.CanAddContentToPage()))
{
throw new UnauthorizedAccessException("Access denied");
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This one hurts my brain a bit specially since it relates to permissions and should be very clear and intuitive.

Suggested change
private void CheckPermissions()
{
// Verify that the current user has access to edit this module
if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "MANAGE", this.Module))
{
if (!(this.IsSharedViewOnly() && TabPermissionController.CanAddContentToPage()))
{
throw new UnauthorizedAccessException("Access denied");
}
}
}
private void CheckPermissions()
{
// Verify that the current user has access to edit this module
if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "MANAGE", this.Module))
{
return;
}
if (this.IsSharedViewOnly() && TabPermissionController.CanAddContentToPage())
{
return;
}
throw new UnauthorizedAccessException("Access denied");
}

Which then begs the question, should we allow the module settings control to be viewed for a shared module to content editors? It looks wrong to me unless I am missing something.

}
}

private void CheckPermissions()
Copy link
Contributor

Choose a reason for hiding this comment

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

Same concern here as my previous comment on the similar code in ModuleSettingsController.cs

Also what is the difference between ModuleSettingscontroller and MOduleSettingsViewController.cs?

Comment on lines +63 to +93
public bool EditMode
{
get
{
return this.ModuleContext.EditMode;
}
}

public bool IsEditable
{
get
{
return this.ModuleContext.IsEditable;
}
}

public int PortalId
{
get
{
return this.ModuleContext.PortalId;
}
}

public int TabId
{
get
{
return this.ModuleContext.TabId;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we expose ModuleContext, do we need to also expose those properties, could we make the API surface simper by limiting the redundant properties?

Comment on lines +95 to +117
public UserInfo UserInfo
{
get
{
return this.PortalSettings.UserInfo;
}
}

public int UserId
{
get
{
return this.PortalSettings.UserId;
}
}

public PortalAliasInfo PortalAlias
{
get
{
return this.PortalSettings.PortalAlias;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for PortalSetings which is already exposed, do we need those properties also exposed?

type is { IsClass: true, IsAbstract: false });
foreach (var controller in mvcControllerTypes)
{
services.TryAddTransient(controller);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be scoped @bdukes ?

Copy link
Contributor

Choose a reason for hiding this comment

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

We're using scoped for web API controllers, but transient for MVC controllers:


Scoped it probably the right way

@sachatrauwaen
Copy link
Contributor

MVC Pipeline and CSP are 2 big ticket items and bringing both in the same PR makes putthing this in a reviewable state hard IMO. The goal of this PR was to have a baseline so that we can review smaller additions in an easier way.

There an separate PR for CSP on the develop branch.

But removing it from this PR needs to remove a lot of code.
The idee is to replace the CSP project of this PR with the PR on develop when the PR is merged in develop.

Actually we heave a lot of sync issues between the differnt PR's.
I don'tknow the best way. So your advice is welcome.

@valadas
Copy link
Contributor

valadas commented Oct 15, 2025

MVC Pipeline and CSP are 2 big ticket items and bringing both in the same PR makes putthing this in a reviewable state hard IMO. The goal of this PR was to have a baseline so that we can review smaller additions in an easier way.

There an separate PR for CSP on the develop branch.

But removing it from this PR needs to remove a lot of code. The idee is to replace the CSP project of this PR with the PR on develop when the PR is merged in develop.

Actually we heave a lot of sync issues between the differnt PR's. I don'tknow the best way. So your advice is welcome.

So if that is the case, we need to review/agree on the CSP one first before spending too much time reviewing this one...

1 similar comment
@valadas
Copy link
Contributor

valadas commented Oct 15, 2025

MVC Pipeline and CSP are 2 big ticket items and bringing both in the same PR makes putthing this in a reviewable state hard IMO. The goal of this PR was to have a baseline so that we can review smaller additions in an easier way.

There an separate PR for CSP on the develop branch.

But removing it from this PR needs to remove a lot of code. The idee is to replace the CSP project of this PR with the PR on develop when the PR is merged in develop.

Actually we heave a lot of sync issues between the differnt PR's. I don'tknow the best way. So your advice is welcome.

So if that is the case, we need to review/agree on the CSP one first before spending too much time reviewing this one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants