mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #21850
[Bug 1215662] Re: Check for correct version.php numbers in pre-commit script
I've added a script, test/versioncheck.php, which compares the version
numbers from lib/version.php in HEAD and HEAD~ and complains if has
decreased or if you are on a stable release but have incremented more
than the last 2 digits of the number.
While I was doing this I started thinking of a few additional steps we
should take:
1. Check for decreasing version number in all the plugins. (Leaping
version number is okay in plugins, because we don't increment these with
each release... though maybe we should?)
2. If lib/db/upgrade.php has increased in length, check that you've
incremented lib/version.php and that the version in version.php matches
the last version in upgrade.php
3. A similar check for plugins.
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1215662
Title:
Check for correct version.php numbers in pre-commit script
Status in Mahara ePortfolio:
Triaged
Status in Mahara 1.10 series:
Triaged
Status in Mahara 1.11 series:
Triaged
Status in Mahara 1.8 series:
New
Status in Mahara 1.9 series:
New
Bug description:
Mahara's version number policy for DB versions in version.php files is
pretty simple:
1. in a _STABLE branch, a commit should only increment the version (whether for core or a plugin) by 1
2. in the master branch, a commit should increment the version to the day's date followed by 00
Since this is so simple, and we've recently had a mistake from it
being manually checked, it's a perfect candidate to add to our pre-
commit checks. The logic can be as follows:
IF you're modifying a version.php file && changing its $config->version value THEN
IF the branch ends with "_STABLE" THEN
Make sure the $config->version is being incremented by 1.
ELSE
Make sure the $config->version is higher than the old value, and ends with 00, and is less than or equal to today's date.
In some cases you might want to increment a version number on the
master branch by 1 (like if you're pushing through multiple commits on
the same day). But that's okay, that's what bypassing the pre-commit
hook is for. ;)
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1215662/+subscriptions
References