Repository navigation
feat: check modules installed by Composer for updates - #439
Merged
Merged
Conversation
Step 6 of the modules specification: VersionSource (Composer repositories, GitHub), PackageVersionChecker with per-package cache, ModuleVersions matched by install path, the Version column, a Site Health test, pollora:module:outdated, a daily WP-Cron refresh and versions in pollora:status.
# Conflicts: # src/Modules/Infrastructure/Providers/ModuleServiceProvider.php
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.
Step 6 of the modules specification. Stacked on #438 (itself on #437): retarget to
developonce they are merged.What changes
VersionSourcecontract (latest(),releaseUrl()), withComposerRepositorySource({url}/p2/{package}.json: Packagist, Private Packagist, Satis — highest stable version, not the first entry) andGitHubSource(latest release, else highest tag, optional token).VersionSourcespicks one from the rootcomposer.json: acomposerrepository serving the package (itsonly), a GitHubvcsrepository named after it, else Packagist.PackageVersionChecker(Application layer):current(),cachedLatest()(never fetches),refresh()(fetches, transientpollora_latest_{sha1(package)}, 12 h, 1 h negative cache),isUpdateAvailable()(adev-*/*-devbuild never is).ModuleVersions: a module whose real path is a Composer package's install path carries its version; local modules have none — no value, no check, no request (decision of 8 October).composer update vendor/package), a Site Health test "Pollora modules are up to date",pollora:status/--json(version,latestper module), andpollora:module:outdated(--json), which refreshes on demand.pollora_refresh_module_versions(scheduled fromadmin_init) — never during a front-end request.PackagistVersionChecker,VersionComparator) is left as it is: it works and has its tests; moving it ontoComposerRepositorySourcecan come later.Verification
ModuleVersionswith a real installed package's install path vs a local module, the Site Health test, the command, the Version cell.pollora:module:outdatedsays no module is installed by Composer, the daily event is scheduled (then removed).composer.json/composer.lock, which hold uncommitted work. To do on a scratch project before the release.Full suite 1954 passed; PHPStan, Rector, Pint, type coverage clean.