feat(plugin-lifecycle): add plugin install/uninstall/reinstall lifecycle action#176
Merged
Martin Krzykawski (MartinKrzykawski) merged 6 commits intoJul 20, 2026
Merged
Conversation
…cle action Add a composite action that validates a plugin's install/uninstall/reinstall lifecycle and DAL wiring against an already-installed Shopware. It boots the container (catching a plugin that references core symbols missing on the target release), runs dal:validate, and optionally asserts the plugin's tables are dropped on uninstall and recreated on reinstall. Extracted from the SwagDynamicAccess CI so every plugin can reuse it without copy-pasting the bash/PDO lifecycle logic.
Add a job to the actions test suite that exercises assert-tables.php against a MySQL service: present/absent for an existing and a missing table, plus the empty-table-list no-op. Mirrors the existing helper-script test convention (downstream-wait).
Johannes Berthel (joberthel)
requested changes
Jul 20, 2026
SHOW TABLES LIKE treats _ as a single-char wildcard, so a table name like swag_dynamic_access_product_rule could match unintended tables. Use an exact information_schema lookup with a prepared statement instead.
setup-extension (install: true) already installs and activates the plugin, so the action's leading plugin:refresh + plugin:install were a redundant no-op. Start from dal:validate and document the install: true precondition; the uninstall -> reinstall step still exercises the install path.
Martin Krzykawski (MartinKrzykawski)
requested a review
from Johannes Berthel (joberthel)
July 20, 2026 12:51
Johannes Berthel (joberthel)
approved these changes
Jul 20, 2026
Dominik Grothaus (dgrothaus-sw)
approved these changes
Jul 20, 2026
Martin Krzykawski (MartinKrzykawski)
deleted the
feat/plugin-lifecycle-action
branch
July 20, 2026 13:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a composite action
plugin-lifecyclethat validates a plugin's uninstall/reinstall lifecycle and DAL wiring against an already-installed Shopware — complementing the container-compile gate thatsetup-extensionalready provides, i.e. the class of breakage from shopware/shopware#18086 where SwagDynamicAccess compiled ontrunkbut failed to install on the released version merchants actually ran.What it does
Run it after
setup-extensionwithinstall: true(which installs + activates the plugin — that step already gates a plugin that doesn't compile on the target release). This action then:dal:validate— validates every registered definition + associations against the real schemaplugin:uninstall→ assert the configured tables are gone (clean uninstall)plugin:install --activate→ assert tables recreated + re-rundal:validate(working reinstall)Design notes
setup-extension, reusing the single Shopware install instead of forcing a second one. Matches the granularity ofsetup-extension/phpunit/versions.tablesinput is optional — the one plugin-specific bit becomes a caller input; omit it and you still get the uninstall/reinstall +dal:validatechecks. Table existence is checked in a smallassert-tables.phphelper (exactinformation_schemalookup, readsDATABASE_URL) referenced via${GITHUB_ACTION_PATH}.versionsfor a self-updating version matrix (see the action README).Testing
test.ymlgains aplugin-lifecycle-assert-tablesjob that runs theassert-tables.phphelper against a MySQL service — present/absent for an existing and a missing table, plus the empty-table-list no-op. Mirrors the repo's existing helper-script test convention (downstream-wait).test.ymldeliberately does not boot a full Shopware, matching how the other install-heavy actions are handled here.Extracted from the SwagDynamicAccess CI so every plugin can reuse it without copy-pasting the bash/PDO lifecycle logic.