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

Fixes missing dependencies in the ShellBlueprint #16379

Merged
merged 9 commits into from
Jul 2, 2024

Conversation

gvkries
Copy link
Contributor

@gvkries gvkries commented Jun 27, 2024

If a module contains no feature that matches the extension ID, some dependencies like startup classes were not being added to the ShellBlueprint and therefore not executed at all.

This PR fixes that by changing the ExtensionManager to always add every exported type to the features contained in the module. Any type that had no associated feature before, is now added to each feature as a dependency. By doing this, the CompositionStrategy will correctly find all dependencies and all startup classes are executed.

Note that while working on this fix, I found another issue. The order in which startup classes are executed depends on the ExtensionManager.LoadFeaturesAsync() method, which must already return the features in order of dependencies. However, it returns an unordered list that comes from the Dictionary.Values property. I've fixed that as well, which allows us to use another FrozenDictionary as a small tweak as well.

This PR is based on #16324 because this change is in the same area and there is no benefit to fixing before #16324.

Fixes #16375

Copy link
Contributor

This pull request has merge conflicts. Please resolve those before requesting a review.

@Piedone
Copy link
Member

Piedone commented Jul 2, 2024

Does this need triage @MikeAlhayek or can be merged?

@MikeAlhayek
Copy link
Member

This LGTM. But another set of eye may be great. I trust @gvkries

@Piedone
Copy link
Member

Piedone commented Jul 2, 2024

Let's check this on Thursday together.

Copy link
Member

@sebastienros sebastienros left a comment

Choose a reason for hiding this comment

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

Let's see if we can get an easy test for that.

@Piedone Piedone merged commit 1524e0f into OrchardCMS:main Jul 2, 2024
10 checks passed
@Piedone
Copy link
Member

Piedone commented Jul 2, 2024

Let's merge it, then.

@gvkries gvkries deleted the gvkries/shellblueprint-16375 branch July 3, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell blueprint is missing dependencies
4 participants