[codex] support plugin ZIP updates - #358
Merged
Merged
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PHPStan level 5 flagged $pluginMeta['name'] ?? 'unknown' as dead code — the 'name' offset is guaranteed on the validated $pluginMeta array (every other use in this method reads it directly). Remove the coalesce to match.
The synthetic integration test covers install→update on one disposable plugin. This adds an all-bundled test that, for each of the plugins under storage/plugins/, packages its real files with a bumped manifest version, runs installFromZip() through the in-place-update branch, and asserts the plugin id stays stable, the files are promoted and the new version is persisted — then restores the directory byte-for-byte and the plugins-row version so the database and working tree are left exactly as found. Both integration tests are now wired into the DB-backed ci-quality job (they were only runnable by hand before). The job already loads the base schema + Italian data and registers every bundled plugin, so the tests run against the same baseline as a completed install. Verified locally: 20/20 plugins pass and no -ziptest version or directory change is left behind.
fabiodalez-dev
added a commit
that referenced
this pull request
Aug 19, 2026
fabiodalez-dev
added a commit
that referenced
this pull request
Aug 19, 2026
…dening The 0.7.62 entry covered the plugin ZIP-update feature (#358) but not the lifecycle correctness added while hardening it: an active plugin's update now runs its new onActivate()/ensureSchema() on the next request with rollback on failure, and the release verifiers reject any non-.gitkeep storage/sessions entry. Document both under 0.7.62 so the release notes are complete.
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.
Problema
L'upload di un file ZIP con il nome di un plugin già installato veniva bloccato sia dal controllo della riga esistente nel database sia dalla directory già presente su disco. Per aggiornare un plugin era quindi necessario disinstallarlo, con il rischio di perdere configurazione, dati e hook associati.
Causa ed effetto
PluginManager::installFromZip()trattava ogni ZIP esclusivamente come una nuova installazione. Il controllo anticipato del nome e quello della directory restituivano entrambi un errore prima che il pacchetto potesse essere validato o sostituito.Correzione
Il flusso ora riconosce un nome già registrato come aggiornamento in-place. Il pacchetto viene estratto in una directory temporanea, validato (incluso il percorso di
main_file) e promosso solo quando è completo. Per un aggiornamento, la directory corrente viene rinominata come backup, quella in staging viene promossa in modo atomico e i metadati del manifest vengono aggiornati sullo stesso recordplugins.L'ID del plugin, lo stato di attivazione, le impostazioni, i dati, gli hook e i log non vengono modificati. Se la sostituzione o l'aggiornamento dei metadati falliscono, il pacchetto precedente viene ripristinato. Le cache dei plugin vengono invalidate dopo l'aggiornamento riuscito.
È stato inoltre aggiunto un gate che verifica tutti i manifest e i file principali dei plugin distribuiti, oltre a un test di integrazione che installa e aggiorna un plugin ZIP temporaneo controllando la preservazione di ID, stato, impostazioni, dati e hook.
Verifica
php tests/plugin-zip-update.integration.phpphp tests/plugin-package-contract.unit.phpphp tests/plugin-manager.unit.phpphp tests/plugin-schema-expectations-static.unit.phpphp tests/plugin-schema-guard.unit.phpnpm testcomposer validate --no-check-publishnpm run test:ci-policy