Skip to content

Migrate installer from marketplace - #27

Merged
vovayatsyuk merged 34 commits into
masterfrom
installer
Sep 22, 2026
Merged

vovayatsyuk merged 34 commits into
masterfrom
installer

Conversation

@vovayatsyuk

Copy link
Copy Markdown
Member

No description provided.

vovayatsyuk and others added 30 commits September 16, 2026 11:52
- Update swissup/* packages only; -w also updates their 3rd party dependencies
- Move ensureRepositoryEnabled into PackageAbstractCommand to share with update
- Drop disabled modules check: setup:upgrade runs with --safe-mode=1 anyway

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The table stored nothing but the identity key used by the deprecated
subscription-checker module, and keeping db_schema.xml forced a
setup:upgrade run. Dropped the model, resource model, collection and the
Module\{Installer,LicenseValidator,MessageLogger} classes that only
served it, along with setup_version.

swissup:module now reads dependencies from PackageInfo directly and no
longer prints the identity key.

Core replaces swissup/module-subscription-checker in composer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A metapackage and the module it requires share one module code, since
convertPackageNameToModuleName strips the "module-" prefix. Both
collapsed into a single item, and the metapackage - which sorts first
in the feed - won every field. The remote loader worked around that by
dropping metapackages altogether.

Key the items by package name, which is unique, and let the consumers
that list components hide the metapackages instead.

This fixes latest_version for the packages whose metapackage lags
behind the module: Swissup_BreezeAi reported 1.2.0 instead of 1.8.8,
so no update was ever offered for it.

The synthetic swissup/subscription entry is dropped as well - it
collided with swissup/module-subscription the same way, and the only
field it contributed that anything still reads is a homepage link.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
auth:show prints plain Username/Password lines, auth:check adds
Username column and moves provider into its own column.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vovayatsyuk and others added 2 commits September 21, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

There are confirmed runtime/behavior bugs in newly added installer code paths (e.g., uninitialized variables, incorrect translation placeholder usage, and unsafe realpath() handling) that should be fixed before merge.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 3 Medium severity · 3 Low severity

Open (7)
What changed in this PR

This PR migrates Swissup’s installer and package/channel management functionality into swissup/module-core, removing the legacy DB-backed “module” model and aligning module listing with the component list loaders.

Changes:

  • Add a new installer runtime (config reader, helpers, commands) and new CLI commands for channel/auth/package operations.
  • Refactor module listing to use component list items (and filter out metapackages via getModuleItems()).
  • Remove legacy module DB schema + models and related marketplace-era license/installer classes.
File Description
view/​adminhtml/​ui_component/​swissup_module_manager.xml Adjusts admin grid link labels.
Ui/​DataProvider/​ModuleListingDataProvider.php Switches grid data source to getModuleItems() and normalizes sort field.
README.md Updates module description and documents new Swissup Installer commands.
Model/​ResourceModel/​Module/​Collection.php Removes legacy DB collection for modules.
Model/​ResourceModel/​Module.php Removes legacy DB resource model for modules.
Model/​Module/​MessageLogger.php Removes legacy installer message logger.
Model/​Module/​LicenseValidator.php Removes legacy license validation implementation.
Model/​Module/​Installer.php Removes legacy module installer orchestration.
Model/​Module.php Removes legacy DB-backed module model.
Model/​Installer/​Process.php Adds child-process runner for Symfony-console-based scripts.
Model/​Installer/​ComposerRepository.php Adds composer.json repo enable/disable + auth key management + package discovery.
Model/​Installer/​Composer.php Adds wrapper to run bundled composer in a child process with proper env.
Model/​ComponentList/​Loader/​Remote.php Updates remote mapping/logic and package list URL prefix.
Model/​ComponentList/​Loader/​AbstractLoader.php Changes item indexing to be keyed by package name (ID), not module code.
Model/​ComponentList/​Loader.php Adds getModuleItems() filter to exclude metapackages.
Installer/​Request.php Adds installer request DTO for commands (store ids, params).
Installer/​Installer.php Adds installer runner that executes configured installer commands and cleans caches.
Installer/​Helper/​Theme.php Adds helper to resolve theme IDs with memoization.
Installer/​Helper/​Text.php Adds helper wrapper for sprintf for config-driven helpers.
Installer/​Helper/​Serializer.php Adds helper to JSON-serialize values.
Installer/​Helper/​Request.php Adds helper to read request data with defaults.
Installer/​Helper/​Renderer.php Adds helper to read file contents for installer templates/assets.
Installer/​Helper/​Collection.php Adds helper to build/filter Magento collections and retrieve IDs.
Installer/​Helper/​Arr.php Adds helper for array join/implode.
Installer/​ConfigReader.php Adds reader/parser for etc/marketplace/installer.xml and included command configs.
Installer/​Command/​Widget.php Adds widget installer command (backup/replace and create widgets).
Installer/​Command/​Unpack.php Adds archive unpack command for installer assets.
Installer/​Command/​ProductCollection.php Adds product collection preparation command (attribute population).
Installer/​Command/​ProductAttribute.php Adds product attribute creation/assignment command.
Installer/​Command/​Product.php Adds compatibility command delegating to ProductCollection.
Installer/​Command/​CopyMediaDir.php Adds media directory copy command.
Installer/​Command/​Config.php Adds store config update command (scalar and string replace).
Installer/​Command/​CmsPage.php Adds CMS page backup + install command with URL rewrite cleanup.
Installer/​Command/​CmsBlock.php Adds CMS block backup + install command.
Installer/​Command/​CategoryUpdate.php Adds category update command based on filtered collections.
etc/​module.xml Removes explicit setup_version.
etc/​di.xml Registers new installer/auth/channel/package CLI commands.
etc/​db_schema.xml Removes legacy swissup_core_module declarative schema.
etc/​db_schema_whitelist.json Removes whitelist for the deleted schema.
Console/​Command/​ModuleListCommand.php Filters module list output to real modules (excludes metapackages).
Console/​Command/​ModuleCommand.php Refactors module info command to resolve packages via loader and use PackageInfo.
Console/​Command/​Installer/​PackageUpdateCommand.php Adds swissup:package:update command.
Console/​Command/​Installer/​PackageRequireCommand.php Adds swissup:package:require command with preflight availability checks.
Console/​Command/​Installer/​PackageRemoveCommand.php Adds swissup:package:remove command.
Console/​Command/​Installer/​PackageInstallCommand.php Adds swissup:package:install command to run package installers and optionally download missing packages.
Console/​Command/​Installer/​PackageAbstractCommand.php Adds shared workflow (validation, maintenance mode, rollback, safe-mode upgrade).
Console/​Command/​Installer/​ChannelEnableCommand.php Adds swissup:channel:enable to add repo and keys.
Console/​Command/​Installer/​ChannelDisableCommand.php Adds swissup:channel:disable to remove repo (keys remain).
Console/​Command/​Installer/​AuthShowCommand.php Adds swissup:auth:show.
Console/​Command/​Installer/​AuthRemoveCommand.php Adds swissup:auth:remove.
Console/​Command/​Installer/​AuthCheckCommand.php Adds swissup:auth:check with per-key package summary.
Console/​Command/​Installer/​AuthAddCommand.php Adds swissup:auth:add.
composer.json Adds runtime dependencies for new installer/CLI implementation.
Api/​Data/​ModuleInterface.php Removes legacy module API interface.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Installer/ConfigReader.php Outdated
Comment thread Installer/Command/ProductCollection.php
Comment thread Installer/Command/Widget.php
Comment thread Installer/Helper/Renderer.php
Comment thread Installer/Command/Unpack.php Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Confirmed logic/runtime issues were found in newly added installer commands (incorrect attribute default-scope updates, unsafe array access, and type normalization/import hygiene) that should be fixed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (7)
Previously missed (3)

In code that hasn't changed since last review

Medium severity Handle missing remove key in processArray()

Installer/​Command/​Config.php:77

processArray() reads $data['remove'] without checking it exists, which will raise an "Undefined array key" warning when neither 'search' nor 'remove' is provided. Add a safe fallback and early return when no search terms are configured.

Medium severity Normalize scalar store_id before iterating store IDs

Installer/​Request.php:13

Request::getStoreIds() can return a non-array if store_id is set as a scalar, but callers iterate it as an array. Normalizing the value avoids runtime warnings/fatal errors.

Low severity Remove unused ScopeConfigInterface and ScopeInterface imports

Installer/​Command/​Unpack.php:6

Unused imports (ScopeConfigInterface, ScopeInterface) add noise and may fail strict coding standards; they are not referenced in this class.

Comment thread Installer/Command/ProductCollection.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

There are verified runtime issues in the new installer commands (incorrect scope constant usage and getStoreIds() returning non-arrays) that can cause fatal errors/TypeErrors during installation flows.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)
Previously missed (3)

In code that hasn't changed since last review

Medium severity Guard against missing search and remove keys

Installer/​Command/​Config.php:73

$search = $data['search'] ?? $data['remove']; will raise an "Undefined index: remove" notice when neither key is present in the installer config. Guard for missing keys and exit early (or throw) with a clear error.

Medium severity Normalize scalar store_id values to arrays

Installer/​Request.php:12

getStoreIds() can return a non-array value when store_id is provided as a scalar (e.g., string/int). Several installer commands iterate and call in_array() on this value, which will throw a TypeError if it isn't an array. Normalize the value to an array and read it via getData() instead of accessing _data directly.

Low severity Remove unused scope-related imports

Installer/​Command/​Unpack.php:8

Unused imports (ScopeConfigInterface, ScopeInterface) should be removed to avoid confusing readers and to keep the file lint-clean.

Comment thread Installer/Command/Config.php
@vovayatsyuk
vovayatsyuk merged commit 3c85de4 into master Sep 22, 2026
2 checks passed
@vovayatsyuk
vovayatsyuk deleted the installer branch September 22, 2026 12:33
@vovayatsyuk
vovayatsyuk restored the installer branch September 22, 2026 12:33
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.

3 participants