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

Enh: Add module manager test and add some improvements and bug fixes #6511

Merged
merged 12 commits into from Aug 17, 2023

Conversation

martin-rueegg
Copy link
Contributor

@martin-rueegg martin-rueegg commented Aug 14, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Tests

Please have a look at the commit titles to get an idea!

Does this PR introduce a breaking change?

  • Unlikely. There are some return types added to ModuleManager though.

If yes, please describe the impact and migration path for existing applications:

  • a developer would have to adapt their inheritance of ModuleManager if they use a custom Manager in their setup or for the module itself.

The PR fulfills these requirements:

  • It's submitted to the develop branch, not the master branch if no hotfix
  • When resolving a specific issue, it's referenced in the PR's description (e.g. Fix #xxx[,#xxx], where "xxx" is the Github issue number)
    Would it make sense to create different issues for documentation/tracking purposes?
  • All tests are passing
  • New/updated tests are included
  • Changelog was modified

Other information:

@martin-rueegg
Copy link
Contributor Author

martin-rueegg commented Aug 14, 2023

@luke-,

While writing a test case to test the ModuleManager I came across a anomailty:

While registering modules, there is no test if the module is inheriting from \humhub\components\Module. However, in many other places, the module will fail if it does not do so, e.g. in

  • getModules(),
  • filterModulesByKeyword (class is not tested, but methods are accessed that do not exist in \yii\base\Module)
  • enable() and disable() require this type in the parameter
  • enableModules() and disableModules()

I would suggest to test for either that inheritance, or even better to create an interface that needs to be met (which is to be implemented by \humhub\components\Module, of course).

@martin-rueegg martin-rueegg marked this pull request as ready for review August 15, 2023 05:15
protected/humhub/components/ModuleManager.php Outdated Show resolved Hide resolved
protected/humhub/components/ModuleManager.php Outdated Show resolved Hide resolved
protected/humhub/components/ModuleManager.php Outdated Show resolved Hide resolved
@martin-rueegg
Copy link
Contributor Author

Requested changes applied!

@luke-, how would you like the CHANGELOG to be ammended? I guess it makes sense to have more than one line. Shall I create issues or add multiple lines with the same PR number, in order to document the separate the changes?

@luke-
Copy link
Contributor

luke- commented Aug 17, 2023

@martin-rueegg As you like, but probably it is easier to add several lines with the same PR number.

Is it sufficient for you if we merge this PR into v1.16? I would like to minimize changes to the current beta as little as possible.

@martin-rueegg martin-rueegg changed the base branch from develop to next August 17, 2023 18:13
@luke- luke- merged commit 48ba9de into humhub:next Aug 17, 2023
6 checks passed
@martin-rueegg martin-rueegg deleted the enh/add-module-manager-test branch August 18, 2023 03:21
martin-rueegg added a commit to metaworx/humhub that referenced this pull request Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants