Plugin Update Strategy - The Right Way

Plugin Update Strategy - The Right Way

by Marty Gilbert -
Number of replies: 3
Picture of Core developers
Hello,

I have written and maintain several plugins (mainly blocks) that we use at my small institution.

I'm curious about your strategy to update blocks when you upgrade to a newer Moodle version.

Typically, I upgrade the Moodle core on a dev server and see if the blocks throw any errors on update. Then, I tail the logs as I use the block to see if it makes any recommendations on deprecated function calls - for example, the new context_XXX:get_instance().

This is not The Right Way to do this, I know. Is there a simple doc that lists the changes needed to upgrade plugins from one version to the next? If not, what is The Right Way to prepare my plugins for a Moodle version upgrade?

Thanks,

Marty


Average of ratings: -
In reply to Marty Gilbert

Re: Plugin Update Strategy - The Right Way

by Chris Wharton -
Hi Marty. The release notes come with a list of API changes, eg https://docs.moodle.org/dev/Moodle_2.7_release_notes#Developer_Notes
Read the upgrade.txt files within the Moodle codebase for details.
Usually this is enough to get plugins up to date.
Ideally having proper tests (Behat and phpunit) in your plugin code will reduce your manual testing workload.
Average of ratings: Useful (1)
In reply to Chris Wharton

Re: Plugin Update Strategy - The Right Way

by Marty Gilbert -
Picture of Core developers

Thanks, Chris. That was easy.

I looked for this, but obviously incorrectly or not hard enough.


Thanks for your help!


Marty

In reply to Marty Gilbert

Re: Plugin Update Strategy - The Right Way

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Is there a simple doc that lists the changes needed to upgrade plugins from one version to the next?

Yes, there is. There are upgrade.txt files across the Moodle code base especially for this. You will probably want to check for the main one at lib/upgrade.txt for the general core changes and then other ones for plugin type specific changes - such as blocks/upgrade.txt.

Still, manually checking for your plugins functionality in full developer debugging mode is expected. Having Behat tests written for your plugins helps a lot with this.

Average of ratings: Useful (1)