mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-07 04:02:42 +02:00
[PR #264] [MERGED] Enforce module requires_core on load, install, update and update checks #175
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/Vateron-Media/XC_VM/pull/264
Author: @Divarion-D
Created: 10/4/2026
Status: ✅ Merged
Merged: 10/4/2026
Merged by: @Divarion-D
Base:
main← Head:feat/module-requires-core📝 Commits (3)
be115bdfeat(modules): enforce requires_core when loading, installing and updating0ac6f08docs(modules): document requires_core and its effecte28dd50Merge branch 'main' into feat/module-requires-core📊 Changes
9 files changed (+433 additions, -20 deletions)
View changed files
📝
docs/en/development/module-authoring.md(+27 -1)📝
src/Core/Module/ModuleLoader.php(+83 -2)📝
src/Core/Module/ModuleManager.php(+65 -9)📝
src/Core/Module/ModuleUpdateChecker.php(+51 -6)📝
src/Public/Views/admin/modules.php(+1 -1)➕
tests/Unit/ModuleCoreRequirementTest.php(+46 -0)📝
tests/Unit/ModuleLoaderTest.php(+14 -0)📝
tests/Unit/ModuleManagerMigrationsTest.php(+80 -1)📝
tests/Unit/ModuleUpdateCheckerTest.php(+66 -0)📄 Description
Why
requires_coreinmodule.jsonwas only read and shown in the Modules table. Nothing enforced it:What changes
ModuleLoader::coreRequirementError($requiresCore, $coreVersion = XC_VM_VERSION)returnsnullwhen the module fits, or the reason (needs core >=2.7.0; this panel runs 2.6.0).Format. One or more conditions, all of which must hold, separated by spaces or commas:
>=,>,<=,<,=/==,!=;>=;^,~,*and ranges are unreadable and refused (fail safe);X.Y.Z-dev.Ncounts asX.Y.Z, since it is built from main as the upcoming release.Where it applies
discoverModules)placeModuleFiles: zip, LB fan-out, standard set, platform)Modules/is removed; the platform flow restores its backup as before.updateModuleFromSource)hash_idpin, before the backup.ModuleUpdateChecker)module.jsonat the repository root of each newer tag from raw.githubusercontent.com (newest first, at most 10) and offers the first compatible release; none means nothing offered (not an error). An unreadable manifest still offers its tag, and the install re-checks the archive. url: honoursrequires_coreinversion.json.An LB whose core lags behind MAIN refuses the fan-out on its own; MAIN only queues the action (
NodeActions::send), so its install is unaffected.The checks live in small helpers, so
discoverModules()(cc 7 → 6) andupdateModuleFromSource()(cc 21 → 17) come out simpler.Docs: a new Core compatibility section in
docs/en/development/module-authoring.md.Testing
ModuleCoreRequirementTestcovers 12 constraint cases, the reason text, and the default core version;Modules/is removed;hash_id) and another core;listModulesshows the warning;make gates,make phpstan, phpcs and the strictmake docs-buildare clean. The CRAP gate passes (0 new or worsened functions)."requires_core": ">=99.0"on a test module and check that:Not in this PR
plex→watch >= 1.1.0.dependenciesholds names only.installModule()(the Install button for a module already on disk) does not re-check. That is harmless, because the loader won't load the module.🤖 Generated with Claude Code
Summary by Sourcery
Enforce module core compatibility across the module lifecycle so incompatible modules are skipped, rejected, or withheld from update offers without affecting compatible installations.
New Features:
Bug Fixes:
Enhancements:
Documentation:
requires_coreconstraints and module core compatibility behavior.Tests:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.