Skip to content

Refactor InstallController to actions. - #5578

Open
EreMaijala wants to merge 10 commits into
vufind-org:devfrom
EreMaijala:dev-refactor-installcontroller
Open

Refactor InstallController to actions.#5578
EreMaijala wants to merge 10 commits into
vufind-org:devfrom
EreMaijala:dev-refactor-installcontroller

Conversation

@EreMaijala

Copy link
Copy Markdown
Contributor

This includes removal of the slightly cumbersome showsql action, which is replaced by directly rendering the install/showsql template in FixDatabaseAction.

@EreMaijala
EreMaijala requested a review from demiankatz August 27, 2026 12:10

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I ran out of time before I could review everything here, but see below for some initial suggestions/questions based on a partial review.

Comment thread module/VuFind/src/VuFind/Action/Install/FixDependenciesAction.php Outdated
Comment thread module/VuFind/src/VuFind/Action/AbstractAction.php Outdated
Comment thread module/VuFind/src/VuFind/Action/Install/AbstractInstallAction.php
Comment thread module/VuFind/src/VuFind/Action/Install/AbstractInstallAction.php
Comment thread module/VuFind/src/VuFind/Action/Install/AbstractInstallAction.php Outdated
@EreMaijala
EreMaijala marked this pull request as draft August 28, 2026 08:53
@EreMaijala

Copy link
Copy Markdown
Contributor Author

I changed this to draft due the checkPrerequisites method. I'll update this when #5520 is done.

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just checking if this is back on your radar, @EreMaijala, now that #5520 is done.

EreMaijala and others added 3 commits September 10, 2026 12:06
# Conflicts:
#	module/VuFind/src/VuFind/Action/AbstractAction.php
#	module/VuFind/src/VuFind/Action/PluginManager.php
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
Co-authored-by: Demian Katz <demian.katz@villanova.edu>
@EreMaijala
EreMaijala force-pushed the dev-refactor-installcontroller branch from ff54679 to 5d971ef Compare September 10, 2026 09:17
@EreMaijala
EreMaijala marked this pull request as ready for review September 10, 2026 09:17
@EreMaijala

Copy link
Copy Markdown
Contributor Author

@demiankatz I had almost lost track of this, so thanks for pulling it back on my radar. :)

@demiankatz demiankatz added this to the 12.0 milestone Sep 10, 2026
@demiankatz demiankatz added the architecture pull requests that involve significant refactoring / architectural changes label Sep 10, 2026

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm still in the process of reviewing this, but I've made some adjustments to the tests in support of my work. More as soon as time permits!

);
$method = $this->getMinimalPhpVersionMethod();
// Test the method in the abstract base class by instantiating a concrete class extending it:
$action = $this->getAutowiredObject(HomeAction::class);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I revised this to use AutowireTrait, and it saved 20 lines of code!

* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org Main Page
*/
class InstallTest extends \VuFindTest\Integration\MinkTestCase

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought some Mink test coverage might be useful. We could obviously do more, but this was a minimum viable starting point.

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @EreMaijala, see below for some suggestions (some of which may be out of scope, but I thought I'd mention possible improvements while I noticed them).

The bigger issue is that FixSolrAction and FixSecurityAction seem to be missing. Did something fail to get pushed up?

Comment on lines +66 to +69
if (function_exists('posix_getpwuid') && function_exists('posix_geteuid')) {
$processUser = posix_getpwuid(posix_geteuid());
$templateParams['runningUser'] = $processUser['name'];
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We do this in at least two places, I wonder if a support method like addRunningUserToTemplateParams(& $params) would be helpful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, but in a simplified way.

// Is the sodium extension missing?
if (!defined('SODIUM_LIBRARY_VERSION')) {
$missingExtensions[] = 'sodium';
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feels to me like refactoring this to a getMissingExtensions method would allow us to eliminate some fragile redundancy in HomeAction::checkMethodDependencies()...

Comment thread module/VuFind/src/VuFind/Action/Install/FixDatabaseAction.php Outdated
Comment thread module/VuFind/src/VuFind/Action/Install/FixSslCertsAction.php Outdated
EreMaijala and others added 3 commits September 11, 2026 10:42
@EreMaijala

Copy link
Copy Markdown
Contributor Author

@demiankatz Oops. Not sure what happened, but apparently I completely skipped Solr and Security, also when testing. Now added and refactored according to your suggestions.

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

Labels

architecture pull requests that involve significant refactoring / architectural changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants