fix: keep an upgradeable version in version.php - #100
Conversation
The dev sentinel 9999999999 makes any install done from the repository - a clone or GitHub's Download ZIP - register 9999999999 in the site's database. From then on that site can never upgrade the plugin: every real release version is lower and Moodle rejects it as a downgrade. The sentinel also hides which code a site actually runs. Keep $plugin->version at the latest release plus one (2026070701) so repo installs register a real, upgradeable version. $plugin->release stays 'dev': it is informational only, does not affect upgrade logic, and preserves the existing signal that a repo checkout is development code. The packaging flow is untouched: make package still stamps the final YYYYMMDDXX and the git tag on the ZIP copy (DEC-0030), so released packages are identical to today's.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
=========================================
Coverage 89.48% 89.48%
Complexity 979 979
=========================================
Files 52 52
Lines 4221 4221
=========================================
Hits 3777 3777
Misses 444 444
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Superseded by #111, which keeps this PR's core diagnosis — the |
What. One line: keeps
$plugin->versionat the latest release plus one (2026070701) instead of the9999999999sentinel.$plugin->releasestays'dev'— it is informational only, does not affect upgrade logic, and preserves the existing signal that a repo checkout is development code.Why this matters.
9999999999is the highest valueversion.phpcan hold. As soon as it lands in a site's database (agit cloneintomod/, or GitHub's "Download ZIP", both common ways people try a plugin), that site is stuck forever: every real release is a lower number, and Moodle refuses lower versions as a downgrade. There is no in-product recovery — the admin has to edit the database or uninstall/reinstall, losing data. We hit exactly this on our own test site while reviewing.9999999999tells you nothing — not the release, not the date, not the commit. A real version number (2026070701) is traceable; the sentinel turns every "what version are you on?" into guesswork.In short: the sentinel protects nobody at runtime but can permanently break a real site and complicate support. Committing a real, ever-increasing version removes that failure mode at zero cost to the release process.
What does NOT change. The packaging flow is untouched:
make packagestill stamps the finalYYYYMMDDXXand the git tag on the ZIP copy, exactly as today (scripts/package.sh). Released packages are byte-identical to the current flow's output.Trade-off. Maintenance cost of bumping one line when a release is cut (or leaving it — the stamp always wins in packages).
Testing. Install from a repo checkout → site registers
2026070701; install the next release ZIP on top → clean upgrade (no downgrade error).